/**
 * Authentic Upholstery - "Talk to a Specialist" AI Chatbot Styles
 *
 * Theme: authenticupholstery
 * Version: 1.0.0
 * Branding:
 *   - Primary Warm Gold: #c49e58
 *   - Accent Warm Gold:  #d8b776
 *   - Dark Charcoal:     #1f1d1a
 *   - Crisp White:       #ffffff
 *   - Linen Background:  #f8f6f2
 *
 * Fully responsive across all devices (991px, 767px, 575px).
 */

/* ==========================================================================
   1. CSS Custom Properties / Theme Tokens
   ========================================================================== */
:root {
    --au-chat-gold: #c49e58;
    --au-chat-gold-light: #d8b776;
    --au-chat-gold-dark: #a8823b;
    --au-chat-gold-glow: rgba(196, 158, 88, 0.35);
    --au-chat-gold-soft: rgba(196, 158, 88, 0.12);
    --au-chat-gold-border: rgba(196, 158, 88, 0.26);

    --au-chat-charcoal: #1f1d1a;
    --au-chat-charcoal-dark: #161412;
    --au-chat-charcoal-light: #2c2925;
    --au-chat-charcoal-soft: rgba(31, 29, 26, 0.05);

    --au-chat-white: #ffffff;
    --au-chat-bg: #f8f6f2;
    --au-chat-border: #eae5de;
    --au-chat-text-main: #1f1d1a;
    --au-chat-text-muted: #736c64;
    --au-chat-text-light: #ded8ce;

    --au-chat-font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --au-chat-font-heading: "Syne", "Inter", Georgia, serif;

    --au-chat-radius-window: 18px;
    --au-chat-radius-bubble: 18px;
    --au-chat-radius-chip: 20px;
    --au-chat-radius-button: 10px;

    --au-chat-shadow-window: 0 16px 48px -8px rgba(18, 16, 14, 0.28), 0 6px 20px -4px rgba(18, 16, 14, 0.12);
    --au-chat-shadow-fab: 0 8px 24px rgba(196, 158, 88, 0.38), 0 3px 8px rgba(31, 29, 26, 0.16);
    --au-chat-shadow-bubble: 0 2px 8px rgba(31, 29, 26, 0.05);
    --au-chat-shadow-chip: 0 2px 6px rgba(31, 29, 26, 0.04);
    --au-chat-shadow-chip-hover: 0 6px 16px rgba(196, 158, 88, 0.3);

    --au-chat-transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --au-chat-transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   2. Floating Action Button (FAB / Launcher)
   ========================================================================== */
.specialist-chat-launcher,
.chatbot-launcher,
#specialist-chat-launcher {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99980;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--au-chat-gold-light) 0%, var(--au-chat-gold) 100%);
    color: var(--au-chat-charcoal);
    padding: 12px 20px 12px 16px;
    border-radius: 50px;
    border: 1px solid var(--au-chat-gold-dark);
    box-shadow: var(--au-chat-shadow-fab);
    font-family: var(--au-chat-font-body);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-decoration: none !important;
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: transform 0.3s var(--au-chat-transition-smooth),
                box-shadow 0.3s var(--au-chat-transition-smooth),
                background 0.3s ease;
}

.specialist-chat-launcher:hover,
.chatbot-launcher:hover,
#specialist-chat-launcher:hover {
    background: linear-gradient(135deg, #e4c483 0%, #caa158 100%);
    color: var(--au-chat-charcoal-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px rgba(196, 158, 88, 0.48), 0 4px 10px rgba(31, 29, 26, 0.2);
}

.specialist-chat-launcher:active,
.chatbot-launcher:active,
#specialist-chat-launcher:active {
    transform: translateY(0) scale(0.98);
}

.specialist-chat-launcher:focus-visible,
.chatbot-launcher:focus-visible,
#specialist-chat-launcher:focus-visible {
    outline: 2px solid var(--au-chat-gold);
    outline-offset: 3px;
}

/* Launcher Icon & Avatar Badge */
.specialist-chat-launcher .launcher-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--au-chat-charcoal);
    color: var(--au-chat-gold-light);
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.3s var(--au-chat-transition-bounce);
}

.specialist-chat-launcher:hover .launcher-icon-wrap {
    transform: rotate(-8deg) scale(1.08);
}

.specialist-chat-launcher .launcher-icon-wrap svg {
    width: 17px;
    height: 17px;
    display: block;
}

/* Online status beacon on launcher */
.specialist-chat-launcher .launcher-status-dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    background-color: #22c55e;
    border: 2px solid var(--au-chat-charcoal);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: auChatBeacon 2.2s infinite;
}

.specialist-chat-launcher .launcher-label {
    line-height: 1;
    white-space: nowrap;
}

/* Pulse highlight around the launcher when unopened */
.specialist-chat-launcher::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 54px;
    border: 2px solid var(--au-chat-gold-light);
    opacity: 0;
    pointer-events: none;
    animation: auChatLauncherPulse 3s infinite;
}

/* Proactive Greeting Tooltip / Popover Bubble */
.specialist-launcher-tooltip,
.chatbot-launcher-tooltip {
    position: fixed;
    bottom: 86px;
    right: 28px;
    z-index: 99975;
    background: var(--au-chat-white);
    color: var(--au-chat-charcoal);
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--au-chat-gold-border);
    box-shadow: 0 6px 20px rgba(31, 29, 26, 0.12);
    font-family: var(--au-chat-font-body);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 260px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: auChatTooltipFade 0.4s var(--au-chat-transition-smooth);
    pointer-events: auto;
}

.specialist-launcher-tooltip::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 32px;
    width: 12px;
    height: 12px;
    background: var(--au-chat-white);
    border-right: 1px solid var(--au-chat-gold-border);
    border-bottom: 1px solid var(--au-chat-gold-border);
    transform: rotate(45deg);
}

.specialist-launcher-tooltip .tooltip-close {
    background: transparent;
    border: none;
    color: var(--au-chat-text-muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 0 0 6px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.specialist-launcher-tooltip .tooltip-close:hover {
    color: var(--au-chat-charcoal);
}

/* When the chat window is active, hide tooltip and optionally transform launcher */
body.specialist-chat-is-open .specialist-launcher-tooltip,
body.specialist-chat-is-open .specialist-chat-launcher::before {
    display: none !important;
}

/* ==========================================================================
   3. Chat Backdrop Overlay (Mobile & Modal view)
   ========================================================================== */
.specialist-chat-backdrop,
.specialist-chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 16, 14, 0.48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99988;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s var(--au-chat-transition-smooth),
                visibility 0.35s ease;
}

.specialist-chat-backdrop.is-active,
.specialist-chat-overlay.is-active,
body.specialist-chat-is-open .specialist-chat-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ==========================================================================
   4. Chat Window Container
   ========================================================================== */
.specialist-chat-window,
.chatbot-window,
#specialist-chat-window {
    position: fixed;
    bottom: 96px;
    right: 28px;
    width: 395px;
    max-width: calc(100vw - 36px);
    height: 620px;
    max-height: calc(100vh - 120px);
    background: var(--au-chat-white);
    border-radius: var(--au-chat-radius-window);
    border: 1px solid var(--au-chat-gold-border);
    box-shadow: var(--au-chat-shadow-window);
    z-index: 99990;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--au-chat-font-body);
    color: var(--au-chat-text-main);

    /* Initial Hidden State */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(24px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.35s var(--au-chat-transition-smooth),
                transform 0.35s var(--au-chat-transition-smooth),
                visibility 0.35s;
}

/* Window Opened / Active State (Slide-Up + Fade-In) */
.specialist-chat-window.is-open,
.specialist-chat-window.active,
.chatbot-window.is-open,
#specialist-chat-window.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   5. Chat Header
   ========================================================================== */
.specialist-chat-header,
.chat-header {
    background: linear-gradient(180deg, var(--au-chat-charcoal) 0%, var(--au-chat-charcoal-dark) 100%);
    border-bottom: 2px solid var(--au-chat-gold);
    color: var(--au-chat-white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
    flex-shrink: 0;
}

/* Specialist Identity Info */
.specialist-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* Avatar with Gold Trim & Online Indicator */
.specialist-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--au-chat-gold);
    padding: 2px;
    background: var(--au-chat-charcoal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.specialist-avatar-img,
.specialist-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.specialist-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--au-chat-gold) 0%, var(--au-chat-gold-dark) 100%);
    color: var(--au-chat-charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    font-family: var(--au-chat-font-heading);
}

.specialist-avatar-wrap .specialist-status-beacon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background-color: #22c55e;
    border: 2px solid var(--au-chat-charcoal);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: auChatBeacon 2.2s infinite;
}

/* Header Text */
.specialist-header-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.specialist-header-title {
    font-family: var(--au-chat-font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--au-chat-white);
    margin: 0;
    line-height: 1.25;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.specialist-header-badge {
    font-family: var(--au-chat-font-body);
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(196, 158, 88, 0.2);
    color: var(--au-chat-gold-light);
    border: 1px solid rgba(196, 158, 88, 0.35);
    padding: 1px 6px;
    border-radius: 4px;
}

.specialist-header-subtitle {
    font-size: 12px;
    color: var(--au-chat-gold-light);
    margin: 3px 0 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.specialist-header-subtitle .status-text-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22c55e;
    flex-shrink: 0;
}

/* Header Action Buttons (Restart, Minimize, Close) */
.specialist-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.specialist-header-btn {
    background: transparent;
    border: none;
    color: var(--au-chat-text-light);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    outline: none;
}

.specialist-header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--au-chat-gold-light);
}

.specialist-header-btn:active {
    transform: scale(0.92);
}

.specialist-header-btn:focus-visible {
    outline: 2px solid var(--au-chat-gold);
    outline-offset: 1px;
}

.specialist-header-btn svg {
    width: 17px;
    height: 17px;
    stroke-width: 2;
    display: block;
}

/* ==========================================================================
   6. Chat Body & Scroll Area
   ========================================================================= */
.specialist-chat-body,
.chat-body,
.specialist-chat-messages {
    flex: 1 1 auto;
    background-color: var(--au-chat-bg);
    background-image: radial-gradient(var(--au-chat-gold-border) 0.65px, transparent 0.65px);
    background-size: 16px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Elegant Scrollbars */
.specialist-chat-body::-webkit-scrollbar,
.specialist-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.specialist-chat-body::-webkit-scrollbar-track,
.specialist-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.specialist-chat-body::-webkit-scrollbar-thumb,
.specialist-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(196, 158, 88, 0.35);
    border-radius: 10px;
}

.specialist-chat-body::-webkit-scrollbar-thumb:hover,
.specialist-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--au-chat-gold);
}

/* Chat Timestamp Separator */
.chat-timestamp-badge {
    align-self: center;
    background: rgba(31, 29, 26, 0.05);
    color: var(--au-chat-text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
    margin: 4px 0 8px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Welcome Card / Specialist Intro */
.specialist-welcome-card {
    background: var(--au-chat-white);
    border: 1px solid var(--au-chat-gold-border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(31, 29, 26, 0.04);
    margin-bottom: 6px;
    animation: auChatMessageSlide 0.35s var(--au-chat-transition-smooth);
}

.specialist-welcome-card .welcome-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--au-chat-gold-dark);
    margin-bottom: 6px;
}

.specialist-welcome-card .welcome-title {
    font-family: var(--au-chat-font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--au-chat-charcoal);
    margin: 0 0 6px;
    line-height: 1.35;
}

.specialist-welcome-card .welcome-desc {
    font-size: 13px;
    color: var(--au-chat-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   7. Message Bubbles
   ========================================================================== */
.specialist-message-row,
.chat-message-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    animation: auChatMessageSlide 0.3s var(--au-chat-transition-smooth);
}

/* Incoming / Specialist AI Messages (Crisp Clean White Bubble) */
.specialist-message-row.message-incoming,
.specialist-message-row.specialist-msg {
    justify-content: flex-start;
}

.specialist-message-row.message-incoming .message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--au-chat-charcoal);
    color: var(--au-chat-gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 1.5px solid var(--au-chat-gold);
    flex-shrink: 0;
    margin-bottom: 4px;
}

.specialist-message-row.message-incoming .message-bubble,
.chat-bubble.bubble-incoming {
    max-width: 82%;
    background: var(--au-chat-white);
    color: var(--au-chat-charcoal);
    border: 1px solid var(--au-chat-gold-border);
    border-radius: var(--au-chat-radius-bubble) var(--au-chat-radius-bubble) var(--au-chat-radius-bubble) 4px;
    padding: 12px 16px;
    box-shadow: var(--au-chat-shadow-bubble);
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
    position: relative;
}

/* Outgoing / User Messages (Dark Charcoal with Gold Highlight) */
.specialist-message-row.message-outgoing,
.specialist-message-row.user-msg {
    justify-content: flex-end;
}

.specialist-message-row.message-outgoing .message-bubble,
.chat-bubble.bubble-outgoing {
    max-width: 82%;
    background: var(--au-chat-charcoal);
    color: var(--au-chat-white);
    border: 1px solid rgba(196, 158, 88, 0.3);
    border-radius: var(--au-chat-radius-bubble) var(--au-chat-radius-bubble) 4px var(--au-chat-radius-bubble);
    padding: 12px 16px;
    box-shadow: 0 3px 12px rgba(31, 29, 26, 0.16);
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}

/* Formatting within messages */
.message-bubble p {
    margin: 0 0 8px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble a {
    color: var(--au-chat-gold-dark);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.message-outgoing .message-bubble a {
    color: var(--au-chat-gold-light);
}

.message-bubble a:hover {
    color: var(--au-chat-charcoal);
}

.message-bubble ul,
.message-bubble ol {
    margin: 6px 0 8px 18px;
    padding: 0;
}

.message-bubble li {
    margin-bottom: 4px;
}

.message-time {
    display: block;
    font-size: 10px;
    color: var(--au-chat-text-muted);
    margin-top: 4px;
    text-align: right;
    line-height: 1;
}

.message-outgoing .message-time {
    color: rgba(255, 255, 255, 0.6);
}

/* Lead Action Cards inside Messages */
.specialist-action-card {
    margin-top: 10px;
    background: rgba(196, 158, 88, 0.08);
    border: 1px dashed var(--au-chat-gold);
    border-radius: 10px;
    padding: 12px;
}

.specialist-action-card .card-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--au-chat-charcoal);
    margin: 0 0 6px;
}

.specialist-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--au-chat-gold-light) 0%, var(--au-chat-gold) 100%);
    color: var(--au-chat-charcoal) !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none !important;
    margin-top: 8px;
    transition: all 0.25s ease;
    border: 1px solid var(--au-chat-gold-dark);
}

.specialist-cta-btn:hover {
    background: linear-gradient(135deg, #e4c483 0%, #caa158 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(196, 158, 88, 0.28);
}

/* ==========================================================================
   8. Typing Indicator (3 Bouncing Dots)
   ========================================================================== */
.specialist-typing-indicator,
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--au-chat-white);
    border: 1px solid var(--au-chat-gold-border);
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    box-shadow: var(--au-chat-shadow-bubble);
    margin-left: 36px;
    align-self: flex-start;
    animation: auChatMessageSlide 0.25s var(--au-chat-transition-smooth);
}

.specialist-typing-indicator .typing-dot,
.typing-indicator .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--au-chat-gold);
    display: inline-block;
    animation: auChatDotBounce 1.4s infinite ease-in-out both;
}

.specialist-typing-indicator .typing-dot:nth-child(1),
.typing-indicator .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.specialist-typing-indicator .typing-dot:nth-child(2),
.typing-indicator .dot:nth-child(2) {
    animation-delay: -0.16s;
    background: var(--au-chat-gold-light);
}

.specialist-typing-indicator .typing-dot:nth-child(3),
.typing-indicator .dot:nth-child(3) {
    animation-delay: 0s;
}

/* ==========================================================================
   9. Quick Action Chips
   ========================================================================== */
.specialist-quick-chips,
.quick-action-chips,
.chat-chips-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 16px;
    background: var(--au-chat-white);
    border-top: 1px solid var(--au-chat-border);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.specialist-quick-chips::-webkit-scrollbar,
.quick-action-chips::-webkit-scrollbar {
    height: 3px;
}

.specialist-quick-chips::-webkit-scrollbar-thumb,
.quick-action-chips::-webkit-scrollbar-thumb {
    background: rgba(196, 158, 88, 0.3);
    border-radius: 4px;
}

/* Individual Chip */
.specialist-chip,
.quick-chip,
.chat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--au-chat-white);
    color: var(--au-chat-charcoal);
    border: 1px solid var(--au-chat-gold);
    border-radius: var(--au-chat-radius-chip);
    padding: 7px 13px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.2px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--au-chat-shadow-chip);
    user-select: none;
    outline: none;
    transition: transform 0.22s var(--au-chat-transition-smooth),
                background 0.22s ease,
                color 0.22s ease,
                border-color 0.22s ease,
                box-shadow 0.22s ease;
}

/* Chip Hover State */
.specialist-chip:hover,
.quick-chip:hover,
.chat-chip:hover {
    background: linear-gradient(135deg, var(--au-chat-gold-light) 0%, var(--au-chat-gold) 100%);
    color: var(--au-chat-charcoal-dark);
    border-color: var(--au-chat-gold-dark);
    transform: translateY(-2px);
    box-shadow: var(--au-chat-shadow-chip-hover);
}

/* Chip Active State */
.specialist-chip:active,
.quick-chip:active,
.chat-chip:active {
    transform: translateY(0) scale(0.97);
}

.specialist-chip:focus-visible,
.quick-chip:focus-visible,
.chat-chip:focus-visible {
    outline: 2px solid var(--au-chat-gold);
    outline-offset: 2px;
}

/* Chip Icon */
.specialist-chip svg,
.quick-chip svg,
.chat-chip svg {
    width: 13px;
    height: 13px;
    color: var(--au-chat-gold-dark);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.specialist-chip:hover svg,
.quick-chip:hover svg,
.chat-chip:hover svg {
    color: var(--au-chat-charcoal-dark);
}

/* ==========================================================================
   10. Chat Footer & Input Form
   ========================================================================== */
.specialist-chat-footer,
.chat-footer {
    background: var(--au-chat-white);
    border-top: 1px solid var(--au-chat-border);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.specialist-input-form,
.chat-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    position: relative;
}

.specialist-input-wrapper {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
}

/* Text Input Field */
.specialist-chat-input,
.chat-input-field,
.specialist-input-wrapper input[type="text"],
.specialist-input-wrapper textarea {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    background: #faf8f5;
    border: 1px solid var(--au-chat-border);
    border-radius: 22px;
    padding: 11px 16px;
    font-family: var(--au-chat-font-body);
    font-size: 13.5px;
    color: var(--au-chat-charcoal);
    line-height: 1.4;
    outline: none;
    resize: none;
    transition: border-color 0.25s ease,
                background-color 0.25s ease,
                box-shadow 0.25s ease;
}

.specialist-chat-input::placeholder,
.chat-input-field::placeholder {
    color: #9e978d;
}

.specialist-chat-input:focus,
.chat-input-field:focus,
.specialist-input-wrapper input[type="text"]:focus,
.specialist-input-wrapper textarea:focus {
    background-color: var(--au-chat-white);
    border-color: var(--au-chat-gold);
    box-shadow: 0 0 0 3px var(--au-chat-gold-soft);
}

/* Send Button */
.specialist-btn-send,
.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--au-chat-gold-light) 0%, var(--au-chat-gold) 100%);
    color: var(--au-chat-charcoal);
    border: 1px solid var(--au-chat-gold-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 3px 10px rgba(196, 158, 88, 0.32);
    transition: transform 0.2s var(--au-chat-transition-smooth),
                background 0.2s ease,
                box-shadow 0.2s ease;
    outline: none;
}

.specialist-btn-send:hover,
.chat-send-btn:hover {
    background: linear-gradient(135deg, #e4c483 0%, #caa158 100%);
    transform: scale(1.06);
    box-shadow: 0 6px 14px rgba(196, 158, 88, 0.44);
}

.specialist-btn-send:active,
.chat-send-btn:active {
    transform: scale(0.94);
}

.specialist-btn-send:disabled,
.chat-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.specialist-btn-send svg,
.chat-send-btn svg {
    width: 17px;
    height: 17px;
    display: block;
    transform: translateX(1px);
}

/* Footer Disclaimer / Branding Notice */
.specialist-footer-brand {
    font-size: 11px;
    color: var(--au-chat-text-muted);
    text-align: center;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.specialist-footer-brand strong {
    color: var(--au-chat-charcoal);
    font-weight: 600;
}

/* ==========================================================================
   11. Keyframe Animations
   ========================================================================== */
@keyframes auChatSlideUpFade {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes auChatMessageSlide {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auChatDotBounce {
    0%, 80%, 100% {
        transform: translateY(0) scale(0.85);
        opacity: 0.6;
    }
    40% {
        transform: translateY(-6px) scale(1.15);
        opacity: 1;
    }
}

@keyframes auChatBeacon {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@keyframes auChatLauncherPulse {
    0% {
        transform: scale(0.98);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.08);
        opacity: 0;
    }
    100% {
        transform: scale(0.98);
        opacity: 0;
    }
}

@keyframes auChatTooltipFade {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   12. Responsive Breakpoints
   ========================================================================== */

/* Tablet Breakpoint (max-width: 991px) */
@media screen and (max-width: 991px) {
    .specialist-chat-launcher,
    .chatbot-launcher,
    #specialist-chat-launcher {
        bottom: 22px;
        right: 22px;
        padding: 10px 18px 10px 14px;
        font-size: 13px;
    }

    .specialist-launcher-tooltip {
        bottom: 78px;
        right: 22px;
    }

    .specialist-chat-window,
    .chatbot-window,
    #specialist-chat-window {
        bottom: 84px;
        right: 22px;
        width: 375px;
        height: 560px;
    }
}

/* Mobile Landscape & Medium Mobile (max-width: 767px) */
@media screen and (max-width: 767px) {
    .specialist-chat-launcher,
    .chatbot-launcher,
    #specialist-chat-launcher {
        bottom: 18px;
        right: 18px;
        padding: 10px 16px;
    }

    /* On mobile landscape, adapt chat window into a touch-friendly bottom sheet */
    .specialist-chat-window,
    .chatbot-window,
    #specialist-chat-window {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: calc(100vw - 24px);
        max-width: 520px;
        margin: 0 auto;
        height: min(600px, calc(100vh - 30px));
        max-height: calc(100vh - 30px);
        border-radius: 16px;
        transform-origin: bottom center;
    }

    .specialist-header-title {
        font-size: 15px;
    }

    .specialist-chat-body {
        padding: 14px 12px;
    }

    .message-incoming .message-bubble,
    .message-outgoing .message-bubble {
        max-width: 88%;
        font-size: 13px;
        padding: 11px 14px;
    }
}

/* Mobile Portrait / Small Screen (max-width: 575px) - Full-Screen View */
@media screen and (max-width: 575px) {
    /* Launcher button - compact pill or FAB on mobile */
    .specialist-chat-launcher,
    .chatbot-launcher,
    #specialist-chat-launcher {
        bottom: 16px;
        right: 16px;
        padding: 10px 14px 10px 12px;
        font-size: 12px;
        gap: 8px;
    }

    .specialist-chat-launcher .launcher-icon-wrap {
        width: 28px;
        height: 28px;
    }

    .specialist-chat-launcher .launcher-icon-wrap svg {
        width: 15px;
        height: 15px;
    }

    .specialist-launcher-tooltip {
        display: none !important; /* Avoid cluttering small screens */
    }

    /* Full-Screen Mobile Chat Experience */
    .specialist-chat-window,
    .chatbot-window,
    #specialist-chat-window {
        position: fixed;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        z-index: 999999 !important;
        transform-origin: center bottom;
    }

    /* Mobile Header with large touch-friendly targets */
    .specialist-chat-header,
    .chat-header {
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top, 12px));
    }

    .specialist-avatar-wrap {
        width: 38px;
        height: 38px;
    }

    .specialist-header-title {
        font-size: 15px;
    }

    .specialist-header-subtitle {
        font-size: 11px;
    }

    .specialist-header-btn {
        width: 38px;
        height: 38px;
    }

    .specialist-header-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Message Area on mobile */
    .specialist-chat-body,
    .specialist-chat-messages {
        padding: 12px;
        gap: 12px;
    }

    .message-incoming .message-bubble,
    .message-outgoing .message-bubble {
        max-width: 90%;
        padding: 10px 13px;
        font-size: 13px;
    }

    .specialist-typing-indicator,
    .typing-indicator {
        margin-left: 0;
        padding: 8px 12px;
    }

    /* Quick Action Chips */
    .specialist-quick-chips,
    .quick-action-chips {
        padding: 8px 12px;
        gap: 6px;
    }

    .specialist-chip,
    .quick-chip,
    .chat-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Mobile Chat Footer with Safe Area Support */
    .specialist-chat-footer,
    .chat-footer {
        padding: 10px 12px;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
        background: var(--au-chat-white);
    }

    .specialist-chat-input,
    .chat-input-field,
    .specialist-input-wrapper input[type="text"],
    .specialist-input-wrapper textarea {
        min-height: 42px;
        font-size: 14px; /* Prevents auto-zoom on iOS Safari */
        padding: 10px 14px;
        border-radius: 20px;
    }

    .specialist-btn-send,
    .chat-send-btn {
        width: 42px;
        height: 42px;
    }

    .specialist-btn-send svg,
    .chat-send-btn svg {
        width: 16px;
        height: 16px;
    }

    .specialist-footer-brand {
        font-size: 10px;
    }
}

/* Extra Small Mobile Devices (max-width: 479px) */
@media screen and (max-width: 479px) {
    .specialist-chat-launcher .launcher-label {
        font-size: 11.5px;
    }

    .specialist-welcome-card {
        padding: 12px;
    }

    .specialist-welcome-card .welcome-title {
        font-size: 14px;
    }

    .specialist-welcome-card .welcome-desc {
        font-size: 12px;
    }
}

/* ==========================================================================
   13. Accessibility & Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .specialist-chat-window,
    .specialist-chat-launcher,
    .specialist-chip,
    .specialist-message-row,
    .specialist-typing-indicator,
    .specialist-launcher-tooltip {
        animation: none !important;
        transition: none !important;
    }

    .specialist-chat-launcher::before,
    .specialist-avatar-wrap .specialist-status-beacon,
    .specialist-chat-launcher .launcher-status-dot {
        animation: none !important;
    }

    .specialist-typing-indicator .typing-dot,
    .typing-indicator .dot {
        animation: none !important;
        opacity: 0.8;
    }
}
