@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --secondary-color: #0f172a;
    --accent-color: #2563eb;
    --header-bg: #0f172a;
    --bg-panel: #ffffff;
    --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-subtle: #e8edf3;
    --shadow-enterprise: 0 16px 48px -12px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 20px 56px -12px rgba(15, 23, 42, 0.24), 0 0 0 1px rgba(15, 23, 42, 0.06);
    --bubble-bot-bg: #ffffff;
    --bubble-bot-border: #e8edf3;
    --bubble-user-bg: var(--primary-color);
    --bubble-user-gradient: var(--primary-color);
    --radius-panel: 16px;
    --radius-bubble: 12px;
    --radius-sm: 8px;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --surface-muted: #f4f6f9;
}

#crm-chat-widget,
#crm-chat-widget * {
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#crm-chat-widget ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
#crm-chat-widget ::-webkit-scrollbar-track {
    background: transparent;
}
#crm-chat-widget ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}
#crm-chat-widget ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.55);
}

#crm-chat-widget {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
    z-index: 99999;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --secondary-color: #0f172a;
    --accent-color: #2563eb;
    --header-bg: #0f172a;
    --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bubble-user-bg: #2563eb;
    --bubble-user-gradient: #2563eb;
}

/* ── Launcher ── */
.chat-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    position: relative;
    overflow: hidden;
    outline: none;
}

.chat-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.chat-button:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-light), 0 8px 24px rgba(15, 23, 42, 0.2);
}

.chat-button:active {
    transform: scale(0.97);
}

.chat-button.is-hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chat-button svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.chat-button img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.chat-button.has-custom-icon {
    width: auto;
    height: auto;
    min-width: 48px;
    max-width: 220px;
    min-height: 48px;
    max-height: 72px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.chat-button.has-custom-icon img {
    width: auto;
    height: auto;
    max-height: 64px;
    max-width: 200px;
    border-radius: 0;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(15, 23, 42, 0.18));
}

.chat-button.has-custom-icon:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

/* ── Tooltip ── */
.chat-tooltip {
    position: absolute;
    right: 72px;
    bottom: 12px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(4px);
    animation: tooltipEnter 0.35s ease forwards 0.8s;
    width: max-content;
    pointer-events: none;
    z-index: 5;
}

@keyframes tooltipEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-tooltip-text {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent #ffffff;
}

/* ── Panel ── */
.chat-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 620px;
    max-height: calc(90vh - 28px);
    background: var(--bg-panel);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-enterprise);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    z-index: 10;
}

.chat-panel.open {
    display: flex;
    animation: panelEnter 0.22s ease forwards;
}

@keyframes panelEnter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-panel.zoomed {
    position: absolute !important;
    top: auto !important;
    left: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 480px !important;
    height: 680px !important;
    max-width: 94vw !important;
    max-height: calc(94vh - 20px) !important;
    border-radius: var(--radius-panel) !important;
}

/* ── Header ── */
.chat-header {
    padding: 12px 12px 12px 14px;
    background: var(--header-bg, var(--secondary-color));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
}

.chat-header--menu {
    border-radius: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-header-info .niche-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.chat-header-info .niche-icon-wrap.has-logo {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.9);
}

.avatar-initials {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    line-height: 1;
}

.avatar-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    padding: 3px;
    display: block;
}

.chat-header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header-title {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 2px;
}

.status-dot-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-actions-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.header-actions-divider {
    width: 1px;
    height: 14px;
    margin: 0 2px;
    background: rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
}

.header-action-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.88);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    padding: 0;
}

.header-action-btn svg {
    width: 15px;
    height: 15px;
    display: block;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.header-action-btn:active {
    transform: scale(0.94);
}

.header-action-btn--close:hover {
    background: rgba(254, 226, 226, 0.22);
    color: #fecaca;
}

.header-action-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 1px;
}

/* ── Messages ── */
.chat-messages {
    flex: 1;
    padding: 14px 12px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background:
        radial-gradient(ellipse at top, rgba(15, 23, 42, 0.015), transparent 55%),
        var(--surface-muted);
    scroll-behavior: smooth;
}

.message-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    max-width: 100%;
    animation: bubbleEnter 0.2s ease forwards;
}

.message-row--bot {
    align-self: stretch;
    justify-content: flex-start;
}

.message-row:has(.catalog-details),
.message-row:has(.catalog-container),
.message-row:has(.crm-webflow-inline-form),
.message-row:has(.crm-form-row) {
    align-items: flex-start;
}

.message-row--user {
    align-self: stretch;
    justify-content: flex-end;
}

.message-row-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 30px);
}

.message-row-content--buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flow-buttons-row .flow-skip-link {
    align-self: flex-start;
    margin-left: 0;
}

.msg-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.msg-avatar--bot {
    background: var(--secondary-color, #0f172a);
    color: #ffffff;
    border: 1.5px solid rgba(15, 23, 42, 0.08);
}

.msg-avatar--bot.has-logo {
    background: #ffffff;
    border-color: var(--border-subtle);
}

.msg-avatar--bot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
    display: block;
}

.msg-avatar--user {
    background: var(--primary-color);
    color: #ffffff;
    border: 1.5px solid transparent;
}

.msg-avatar--user svg {
    width: 12px;
    height: 12px;
    display: block;
}

.message {
    max-width: calc(100% - 30px);
    padding: 8px 11px 6px;
    border-radius: var(--radius-bubble);
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: -0.01em;
    position: relative;
    overflow-wrap: break-word;
    word-break: normal;
    font-weight: 400;
}

.message-row .message {
    max-width: min(84%, 280px);
}

@keyframes bubbleEnter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    background: var(--bubble-bot-bg);
    color: var(--text-primary);
    border: 1px solid var(--bubble-bot-border);
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.message.bot.has-ctas {
    max-width: min(92%, 300px);
    width: auto;
}

.message.user {
    background: var(--bubble-user-bg, var(--primary-color));
    color: #ffffff;
    border-bottom-right-radius: 5px;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.message.user span,
.message.user strong,
.message.user b,
.message.user .message-text,
.message.user .message-text * {
    color: #ffffff !important;
}

.message.bot .message-text b,
.message.bot span b {
    color: var(--primary-color);
    font-weight: 700;
}

.message-time {
    font-size: 10px;
    opacity: 0.45;
    margin-top: 4px;
    display: block;
    text-align: right;
    font-weight: 500;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}

.message.user .message-time {
    color: #ffffff;
    opacity: 0.72;
}

/* ── Typing ── */
.typing-wrap {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 0 12px 10px;
    background: transparent;
}

.typing-dots {
    background: #ffffff;
    border: 1px solid var(--bubble-bot-border);
    padding: 12px 16px;
    border-radius: var(--radius-bubble);
    border-bottom-left-radius: 5px;
    display: flex;
    gap: 5px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: wavePulse 1.3s infinite ease-in-out;
}

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

@keyframes wavePulse {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* ── Composer ── */
.chat-input-container {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
    z-index: 10;
}

.chat-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chat-menu-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.chat-menu-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.chat-menu-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.chat-composer {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    gap: 5px;
    background: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 3px 3px 3px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chat-composer:focus-within {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.chat-input {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 7px 0;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    box-shadow: none;
    min-width: 0;
    resize: none;
    overflow-y: auto;
    max-height: 120px;
    line-height: 1.45;
    font-family: inherit;
}

.chat-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.chat-input:focus {
    border: none;
    box-shadow: none;
}

.chat-input:disabled {
    background: transparent;
    color: #94a3b8;
}

.send-btn {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.send-btn:hover:not(:disabled):not(.is-disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

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

.send-btn:disabled,
.send-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ── Flow / CTA buttons ── */
.flow-buttons,
.cta-card-wrap {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
}

.flow-buttons--outline {
    border-top: none;
    padding-top: 0;
}

.flow-btn {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    width: 100%;
    min-width: 0;
}

.flow-btn .btn-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.flow-btn .btn-arrow {
    width: 12px;
    height: 12px;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.flow-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.flow-btn:hover:not(:disabled) .btn-arrow {
    opacity: 1;
    transform: translateX(1px);
}

.flow-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.flow-btn.selected {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.flow-btn:disabled:not(.selected) {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--surface-muted);
    color: #94a3b8;
}

.flow-btn--outline {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-size: 12px;
}

.flow-btn--outline:hover:not(:disabled) {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.flow-btn--danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.flow-btn--danger:hover:not(:disabled) {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.flow-btn--muted {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

.flow-btn--muted:hover:not(:disabled) {
    background: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

.flow-skip-link {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 4px 0;
    font-family: inherit;
}

.flow-skip-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.flow-skip-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Validation ── */
.validation-msg {
    font-size: 12px;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Menu overlay ── */
.chat-menu-overlay {
    position: absolute;
    inset: 0;
    background: var(--surface-muted);
    z-index: 100;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: var(--radius-panel);
    overflow: hidden;
}

.chat-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.chat-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.menu-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.menu-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.menu-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.menu-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.menu-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.menu-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.menu-card-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.menu-card-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}

.menu-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* ── Confirm modal ── */
.chat-confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.chat-confirm-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.chat-confirm-box {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    box-shadow: var(--shadow-enterprise);
    width: 100%;
    max-width: 300px;
    text-align: center;
    border: 1px solid var(--border-subtle);
}

.chat-confirm-box h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-confirm-box p {
    margin: 0 0 18px 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.chat-confirm-actions {
    display: flex;
    gap: 8px;
}

.chat-confirm-actions .flow-btn {
    flex: 1;
    justify-content: center;
    padding: 9px 12px;
}

/* ── Catalog ── */
.catalog-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    width: 100%;
}

.catalog-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    display: block;
}

.catalog-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.catalog-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: block;
    background: var(--surface-muted);
}

.catalog-card-media-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.catalog-card-media-wrap .catalog-card-image {
    margin-bottom: 0;
}

.catalog-media-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.catalog-doc-preview {
    background: var(--surface-muted);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 20px 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.catalog-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.catalog-card-desc {
    color: var(--text-muted);
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.catalog-details {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-self: flex-start;
    max-width: 94%;
}

.catalog-details-image {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    display: block;
    background: var(--surface-muted);
}

.catalog-details-video {
    max-height: 260px;
    background: #000000;
}

.catalog-details-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.catalog-details-doc-link:hover {
    background: var(--surface-subtle);
    text-decoration: underline;
}

.chat-md-image {
    max-width: 100%;
    max-height: 220px;
    border-radius: var(--radius-sm);
    margin: 6px 0;
    display: block;
    object-fit: cover;
}

.chat-md-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

.catalog-details-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.catalog-details-desc {
    font-size: 14px;
    color: #475569;
    white-space: pre-wrap;
    line-height: 1.5;
}

.catalog-details-ctas {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.catalog-details-ctas .flow-btn {
    width: 100%;
}

/* ── Watermark ── */
.crm-watermark {
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
    padding: 4px 0 6px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    letter-spacing: 0.01em;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    #crm-chat-widget {
        bottom: 0;
        right: 0;
        left: auto;
        pointer-events: none;
    }
    #crm-chat-widget > * {
        pointer-events: auto;
    }
    .chat-button {
        width: 52px;
        height: 52px;
        margin: 12px;
        margin-left: auto;
        margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        margin-right: calc(12px + env(safe-area-inset-right, 0px));
    }
    .chat-tooltip {
        display: none !important; /* Tooltip shows on PC, hidden on mobile */
    }
    .chat-panel {
        position: fixed;
        inset: 0;
        width: auto;
        max-width: none;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        margin: 0;
    }
    .chat-panel.zoomed {
        position: fixed !important;
        inset: 0 !important;
        width: auto !important;
        max-width: none !important;
        height: 100dvh !important;
        max-height: none !important;
        border-radius: 0 !important;
    }
    #chat-zoom {
        display: none;
    }
    .crm-webflow-sheet--inline .crm-webflow-body {
        max-height: none;
        flex: 1;
        min-height: 0;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   Enterprise Inline Form & CTA System (Appointment / Lead / Booking / Support)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Form message row ── */
.message-row.crm-form-row {
    align-self: stretch;
    max-width: 100%;
}

.message-row.crm-form-row .crm-webflow-cta-card,
.message-row.crm-form-row .crm-webflow-success-card {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 30px);
}

/* ── Enterprise CTA Launch Card ── */
.crm-webflow-cta-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    animation: flowCtaPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-webflow-cta-card.has-inline-form {
    padding-bottom: 0;
}

.crm-webflow-cta-card.has-inline-form .crm-webflow-cta-desc {
    margin-bottom: 0;
}

.crm-webflow-cta-card.has-inline-form .crm-webflow-cta-btn {
    display: none;
}

@keyframes flowCtaPop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.crm-webflow-cta-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.crm-webflow-cta-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crm-webflow-cta-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.crm-webflow-cta-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--primary-light);
    color: var(--primary-color);
    width: fit-content;
}

.crm-webflow-cta-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.crm-webflow-cta-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 10px;
}

.crm-webflow-cta-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
    font-family: inherit;
}

.crm-webflow-cta-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.crm-webflow-cta-btn:disabled.is-opened {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

/* ── Inline Form Panel (expands below CTA in chat) ── */
.crm-webflow-inline-form {
    margin-top: 12px;
    border-top: 1px solid var(--border-subtle);
    animation: flowFormExpand 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-webflow-sheet--compact .crm-webflow-inline-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 4px;
}

.crm-webflow-sheet--compact .crm-webflow-body {
    padding-top: 0;
}

@keyframes flowFormExpand {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 800px; }
}

.crm-webflow-sheet--inline {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
}

.crm-webflow-sheet--inline .crm-webflow-header {
    padding: 14px 0 10px;
    border-bottom: none;
    background: transparent;
}

.crm-webflow-sheet--inline .crm-webflow-body {
    padding: 4px 0 10px;
    max-height: min(340px, 52vh);
    overflow-y: auto;
}

.crm-webflow-sheet--inline .crm-webflow-footer {
    padding: 12px 0 16px;
    border-top: 1px solid var(--border-subtle);
    background: transparent;
}

.crm-webflow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.crm-webflow-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.crm-webflow-header-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.crm-webflow-header-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.crm-webflow-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-muted);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.crm-webflow-close-btn:hover {
    background: #e8edf3;
    color: var(--text-primary);
}

.crm-webflow-progress-bar {
    width: 100%;
    height: 3px;
    background: var(--surface-muted);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}

.crm-webflow-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 999px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.crm-webflow-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.crm-webflow-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crm-webflow-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

.crm-webflow-label .required-star {
    color: #ef4444;
}

.crm-webflow-input,
.crm-webflow-select,
.crm-webflow-textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--surface-muted);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.crm-webflow-input:focus,
.crm-webflow-select:focus,
.crm-webflow-textarea:focus {
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.crm-webflow-input.input-error,
.crm-webflow-select.input-error,
.crm-webflow-textarea.input-error {
    border-color: #ef4444 !important;
    background: #fffbfa;
}

.crm-webflow-input.input-success,
.crm-webflow-select.input-success,
.crm-webflow-textarea.input-success {
    border-color: #10b981 !important;
}

.crm-webflow-field-error {
    font-size: 11.5px;
    color: #ef4444;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.crm-webflow-field-error svg {
    flex-shrink: 0;
}
/* ── Phone Country Code Dropdown ── */
.crm-phone-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

.crm-phone-code-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    border-right: none;
    border-radius: 8px 0 0 8px;
    background: var(--surface-muted);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
    min-width: 90px;
    justify-content: center;
}

.crm-phone-code-btn:hover {
    background: #f1f5f9;
}

.crm-phone-code-btn.open {
    background: #f1f5f9;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.crm-phone-flag {
    font-size: 16px;
    line-height: 1;
}

.crm-phone-dial {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-primary);
}

.crm-phone-chevron {
    opacity: 0.5;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.crm-phone-code-btn.open .crm-phone-chevron {
    transform: rotate(180deg);
}

.crm-phone-number-input {
    border-radius: 0 8px 8px 0 !important;
    flex: 1;
    min-width: 0;
}

.crm-phone-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    overflow: hidden;
    animation: crmPhoneDropIn 0.15s ease-out;
}

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

.crm-phone-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.crm-phone-search {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-muted);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.crm-phone-search:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
    background: #ffffff;
}

.crm-phone-search::placeholder {
    color: #94a3b8;
}

.crm-phone-list {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.crm-phone-list::-webkit-scrollbar {
    width: 5px;
}

.crm-phone-list::-webkit-scrollbar-track {
    background: transparent;
}

.crm-phone-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.crm-phone-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s ease;
    font-size: 12.5px;
}

.crm-phone-option:hover {
    background: #f8fafc;
}

.crm-phone-option.selected {
    background: var(--primary-light, #eff6ff);
}

.crm-phone-option.selected .crm-phone-opt-name {
    font-weight: 600;
    color: var(--primary-color);
}

.crm-phone-opt-flag {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.crm-phone-opt-name {
    flex: 1;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-phone-opt-dial {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.crm-phone-empty {
    padding: 16px;
    text-align: center;
    font-size: 12.5px;
    color: #94a3b8;
}

/* ── Radio choice cards (2 per row) ── */
.crm-webflow-radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.crm-webflow-radio-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.crm-webflow-radio-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-muted);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    min-width: 0;
    position: relative;
}

.crm-webflow-radio-card:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.crm-webflow-radio-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.crm-webflow-radio-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.crm-webflow-radio-card.selected .crm-webflow-radio-dot {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.crm-webflow-radio-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.crm-webflow-radio-card.selected .crm-webflow-radio-dot::after {
    opacity: 1;
    transform: scale(1);
}

.crm-webflow-radio-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
    min-width: 0;
}

.crm-webflow-radio-card.selected .crm-webflow-radio-label {
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Footer actions ── */
.crm-webflow-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.crm-webflow-btn {
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    border: none;
    font-family: inherit;
}

.crm-webflow-btn-secondary {
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.crm-webflow-btn-secondary:hover {
    background: #e8edf3;
    color: var(--text-primary);
}

.crm-webflow-btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    flex: 1;
}

.crm-webflow-btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.crm-webflow-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.crm-spin {
    animation: crmSpin 0.8s linear infinite;
}

@keyframes crmSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Success card ── */
.crm-webflow-success-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 14px 16px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: flowCtaPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-webflow-success-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #065f46;
}

.crm-webflow-success-header svg {
    color: #059669;
    flex-shrink: 0;
}

.crm-webflow-success-details {
    font-size: 13px;
    color: #047857;
    line-height: 1.45;
}

/* ── Markdown content in messages ── */
.message-text .md-pre {
    background: var(--surface-muted);
    padding: 8px 10px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    margin: 6px 0;
    display: block;
}

.message-text .md-pre code {
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
    white-space: pre-wrap;
}

.message-text .md-code {
    background: var(--surface-muted);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
}

.message-text .md-h1,
.message-text .md-h2,
.message-text .md-h3 {
    display: block;
    font-weight: 700;
    margin: 4px 0 2px;
}

.message-text .md-h1 { font-size: 15px; }
.message-text .md-h2 { font-size: 14px; }
.message-text .md-h3 { font-size: 13px; }

.message-text .md-quote {
    display: block;
    border-left: 3px solid var(--border-subtle);
    padding-left: 10px;
    color: var(--text-muted);
    margin: 4px 0;
}

/* ── Narrow panel: single-column option grid ── */
@media (max-width: 360px) {
    .crm-webflow-radio-group {
        grid-template-columns: 1fr;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    #crm-chat-widget *,
    #crm-chat-widget *::before,
    #crm-chat-widget *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .chat-tooltip {
        animation: none !important;
    }

    .chat-panel {
        transition: none !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   🎙️ FULL-DUPLEX VOICE ASSISTANT & AUDIO PLAYER STYLES
   ══════════════════════════════════════════════════════════════════════════ */

.chat-voice-btn {
    background: transparent;
    color: var(--text-muted, #64748b);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
    padding: 0;
    margin-right: 4px;
}

.chat-voice-btn:hover {
    color: var(--primary-color, #2563eb);
    background: var(--surface-muted, #f1f5f9);
    transform: scale(1.05);
}

.chat-voice-btn:active {
    transform: scale(0.95);
}

/* ── Voice Live Overlay ── */
.chat-voice-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    animation: voiceOverlayFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes voiceOverlayFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.voice-modal-card {
    background: #ffffff;
    width: 88%;
    max-width: 320px;
    padding: 28px 20px 24px;
    border-radius: 20px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.voice-avatar-pulse-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.voice-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-light, rgba(37, 99, 235, 0.15));
    animation: voicePulse 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.voice-pulse-ring.ring-2 {
    animation-delay: 0.75s;
}

@keyframes voicePulse {
    0% { transform: scale(0.85); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 0.2; }
    100% { transform: scale(1.8); opacity: 0; }
}

.voice-avatar-center {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #2563eb), #4f46e5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    z-index: 2;
}

.voice-status-text {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.voice-status-sub {
    font-size: 12.5px;
    color: #64748b;
    margin-bottom: 14px;
    max-width: 260px;
    max-height: 72px;
    overflow-y: auto;
    line-height: 1.4;
    word-break: break-word;
    padding: 0 4px;
}

.voice-lang-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.voice-lang-btn {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.voice-lang-btn.active {
    background: #ffffff;
    color: var(--primary-color, #2563eb);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.voice-wave-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 28px;
    margin-bottom: 20px;
}

.wave-bar {
    width: 4px;
    height: 18px;
    background: var(--primary-color, #2563eb);
    border-radius: 4px;
    transform-origin: center;
    transition: transform 0.08s ease;
}

.voice-actions-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.voice-action-btn {
    background: var(--primary-color, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.voice-action-btn:hover {
    background: var(--primary-hover, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.voice-close-btn {
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.voice-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ── Inline Audio Player Bubble ── */
.message-voice-bubble {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voice-player-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 12px;
    margin-top: 4px;
    width: fit-content;
    max-width: 100%;
}

.voice-player-play-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s ease;
}

.voice-player-play-btn:hover {
    transform: scale(1.08);
}

.voice-player-wave {
    display: flex;
    align-items: center;
    gap: 2.5px;
    height: 16px;
}

.voice-player-wave .v-bar {
    width: 2.5px;
    height: 8px;
    background: #94a3b8;
    border-radius: 2px;
}

.voice-player-wave.playing .v-bar {
    background: var(--primary-color, #2563eb);
    animation: vBarPlaying 0.8s infinite ease-in-out alternate;
}

@keyframes vBarPlaying {
    from { height: 4px; }
    to { height: 16px; }
}

.voice-player-duration {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-left: 2px;
}

