/*
 * chatbot.css — KodePilot Floating Chat Widget
 * Intercom-style layout: welcome → contact capture → chat
 * Colors: KodePilot blue (#2196F3) primary, dark theme
 */

/* ── Scoped reset ──────────────────────────────────────────────── */
.chatbot-widget,
.chatbot-widget * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

/* ── Brand tokens ──────────────────────────────────────────────── */
:root {
    --cb-blue:       #2196F3;
    --cb-blue-dark:  #1976D2;
    --cb-blue-light: #64B5F6;
    --cb-bg:         #111111;
    --cb-surface:    #1a1a1a;
    --cb-surface-2:  #222222;
    --cb-border:     rgba(255, 255, 255, 0.09);
    --cb-text:       #f1f5f9;
    --cb-muted:      rgba(241, 245, 249, 0.5);
    --cb-shadow:     0 20px 60px rgba(0, 0, 0, 0.5);
    --cb-fab-size:   56px;
    --cb-fab-bottom: 24px;
    --cb-fab-right:  24px;
}

/* ── Animations ────────────────────────────────────────────────── */
@keyframes cbMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

@keyframes cbTyping {
    0%, 60%, 100% { transform: translateY(0);   opacity: 0.4; }
    30%            { transform: translateY(-5px); opacity: 1;   }
}

@keyframes cbPopOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(24px) scale(0.94); }
}

/* ── Screen-reader only ───────────────────────────────────────── */
.chatbot-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ══════════════════════════════════════════════════════════════════
   FAB — Floating Action Button
   ══════════════════════════════════════════════════════════════════ */
.chatbot-toggle {
    position: fixed;
    right: var(--cb-fab-right);
    bottom: var(--cb-fab-bottom);
    width: var(--cb-fab-size);
    height: var(--cb-fab-size);
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--cb-blue-light), var(--cb-blue));
    color: #fff;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.5),
                0 2px 8px  rgba(0, 0, 0, 0.3);
    transition: transform  0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
                opacity    0.28s ease,
                visibility 0.28s ease;
    overflow: hidden;
}

.chatbot-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    position: relative;
    z-index: 1;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(33, 150, 243, 0.65);
}

.chatbot-toggle:active { transform: scale(0.93); }

/* FAB hides (scales away) when window is open */
.chatbot-toggle.is-open {
    transform: scale(0.5) translateY(20px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   CHAT WINDOW
   ══════════════════════════════════════════════════════════════════ */
.chatbot-window {
    position: fixed;
    right: var(--cb-fab-right);
    bottom: calc(var(--cb-fab-bottom) + var(--cb-fab-size) + 12px);
    width: 380px;
    height: 560px;
    max-height: calc(100vh - var(--cb-fab-bottom) - var(--cb-fab-size) - 24px);
    background: var(--cb-bg);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 16px;
    box-shadow: var(--cb-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity    0.28s cubic-bezier(0.4, 0, 0.2, 1),
                transform  0.32s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

.chatbot-window.closing {
    animation: cbPopOut 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ══════════════════════════════════════════════════════════════════
   HEADER — shown on contact & chat panels only
   ══════════════════════════════════════════════════════════════════ */
.chatbot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--cb-bg);
    border-bottom: 1px solid rgba(33, 150, 243, 0.15);
    flex-shrink: 0;
    min-height: 52px;
}

.chatbot-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.1);
    border: 1.5px solid rgba(33, 150, 243, 0.38);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.chatbot-header-content { flex: 1; min-width: 0; }

.chatbot-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--cb-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chatbot-subtitle {
    font-size: 12px;
    color: var(--cb-muted);
    margin: 2px 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    flex-shrink: 0;
}

.chatbot-header-actions { display: flex; gap: 6px; }

.chatbot-header-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--cb-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.chatbot-header-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--cb-text);
}

.chatbot-header-btn svg { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════════════════════════
   PANELS — shared base
   ══════════════════════════════════════════════════════════════════ */
.chatbot-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: var(--cb-bg);
    min-height: 0;
}

.chatbot-panel[hidden] { display: none !important; }

/* ══════════════════════════════════════════════════════════════════
   WELCOME PANEL
   ══════════════════════════════════════════════════════════════════ */
.chatbot-welcome-panel {
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.chatbot-welcome-panel::-webkit-scrollbar       { width: 4px; }
.chatbot-welcome-panel::-webkit-scrollbar-track  { background: transparent; }
.chatbot-welcome-panel::-webkit-scrollbar-thumb  {
    background: rgba(33, 150, 243, 0.3);
    border-radius: 2px;
}

/* Hero gradient header */
.chatbot-welcome-hero {
    background: linear-gradient(160deg, #0a1628 0%, #0d2244 55%, #122b55 100%);
    padding: 10px 18px 22px;
    flex-shrink: 0;
}

.chatbot-welcome-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}

.chatbot-welcome-action-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.chatbot-welcome-action-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.chatbot-welcome-hero-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(33, 150, 243, 0.18);
    border: 1.5px solid rgba(33, 150, 243, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    overflow: hidden;
}

.chatbot-welcome-greeting {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.chatbot-welcome-tagline {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.55;
    max-width: 290px;
}

/* Body / card section */
.chatbot-welcome-body {
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--cb-bg);
    flex: 1;
}

/* New Conversation button */
.chatbot-welcome-new-chat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(33, 150, 243, 0.38);
    background: rgba(33, 150, 243, 0.06);
    cursor: pointer;
    text-align: left;
    color: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.chatbot-welcome-new-chat:hover {
    border-color: rgba(33, 150, 243, 0.65);
    background: rgba(33, 150, 243, 0.12);
}

.chatbot-welcome-new-chat-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chatbot-welcome-new-chat-text strong {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--cb-blue);
    display: block;
    line-height: 1.2;
}

.chatbot-welcome-new-chat-text span {
    font-size: 12px;
    color: var(--cb-muted);
    display: block;
}

.chatbot-welcome-arrow { color: var(--cb-blue); flex-shrink: 0; }

/* 2×2 topic grid */
.chatbot-welcome-topics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.chatbot-welcome-topic {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 13px 12px;
    border-radius: 12px;
    border: 1px solid rgba(33, 150, 243, 0.2);
    background: rgba(33, 150, 243, 0.03);
    cursor: pointer;
    text-align: left;
    color: inherit;
    min-height: 86px;
    width: 100%;
    transition: border-color 0.2s ease,
                background   0.2s ease,
                transform    0.15s ease;
}

.chatbot-welcome-topic:hover {
    border-color: rgba(33, 150, 243, 0.5);
    background: rgba(33, 150, 243, 0.09);
}

.chatbot-welcome-topic:active { transform: scale(0.97); }

.chatbot-welcome-topic svg { color: var(--cb-blue); flex-shrink: 0; }

.chatbot-welcome-topic strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--cb-text);
    display: block;
    line-height: 1.2;
}

.chatbot-welcome-topic span {
    font-size: 11.5px;
    color: var(--cb-muted);
    display: block;
}

/* ══════════════════════════════════════════════════════════════════
   CONTACT PANEL
   ══════════════════════════════════════════════════════════════════ */
.chatbot-contact-intro {
    padding: 20px 18px 0;
}

.chatbot-contact-intro p {
    font-size: 14px;
    color: var(--cb-text);
    line-height: 1.55;
}

.chatbot-contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 18px 14px;
    flex: 1;
}

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

.chatbot-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--cb-muted);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.chatbot-field-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(33, 150, 243, 0.22);
    background: var(--cb-surface-2);
    color: var(--cb-text);
    font-size: 14px;
    outline: none;
    caret-color: var(--cb-blue);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.chatbot-field-input::placeholder { color: rgba(241, 245, 249, 0.28); }

.chatbot-field-input:focus {
    border-color: var(--cb-blue);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.18);
}

.chatbot-field-input[aria-invalid="true"] {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.chatbot-field-error {
    font-size: 11.5px;
    color: #f87171;
    min-height: 16px;
    line-height: 1.4;
    padding-left: 2px;
}

.chatbot-contact-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--cb-blue-light), var(--cb-blue));
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.38);
    margin-top: 4px;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chatbot-contact-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.chatbot-contact-submit:active { transform: translateY(0); }
.chatbot-contact-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.chatbot-privacy-note {
    font-size: 11px;
    color: rgba(241, 245, 249, 0.35);
    text-align: center;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════
   CHAT PANEL — messages
   ══════════════════════════════════════════════════════════════════ */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.chatbot-messages::-webkit-scrollbar       { width: 4px; }
.chatbot-messages::-webkit-scrollbar-track  { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb  {
    background: rgba(33, 150, 243, 0.3);
    border-radius: 2px;
}

/* Date separator */
.chatbot-date-sep {
    text-align: center;
    font-size: 11px;
    color: var(--cb-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 3px 12px;
    display: inline-block;
    align-self: center;
    user-select: none;
    margin: 6px 0;
}

/* Message row */
.chatbot-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: cbMsgIn 0.25s ease forwards;
}

.chatbot-msg--bot  { justify-content: flex-start; }
.chatbot-msg--user { justify-content: flex-end; }

.chatbot-msg-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 12px;
    overflow: hidden;
}

.chatbot-msg-inner {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 80%;
    min-width: 0;
}

.chatbot-msg--user .chatbot-msg-inner { align-items: flex-end; max-width: 78%; }

.chatbot-bubble {
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: fit-content;
    max-width: 100%;
}

.chatbot-msg--bot .chatbot-bubble {
    background: var(--cb-surface);
    border: 1px solid rgba(33, 150, 243, 0.18);
    border-radius: 4px 14px 14px 14px;
    color: var(--cb-text);
}

.chatbot-msg--user .chatbot-bubble {
    background: linear-gradient(135deg, var(--cb-blue-light), var(--cb-blue));
    border-radius: 14px 4px 14px 14px;
    color: #fff;
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3);
}

.chatbot-ts {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    padding: 0 4px;
    display: block;
}

.chatbot-msg--bot  .chatbot-ts { text-align: left; }
.chatbot-msg--user .chatbot-ts { text-align: right; }

/* Typing dots */
.chatbot-typing {
    display: flex !important;
    align-items: center;
    gap: 5px;
    padding: 14px 20px !important;
    min-width: 68px;
}

.chatbot-typing span {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--cb-blue-light);
    opacity: 0.7;
    animation: cbTyping 1.3s ease-in-out infinite;
    flex-shrink: 0;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.30s; }

/* Suggestion pills */
.chatbot-suggestions {
    display: flex;
    overflow-x: auto;
    gap: 7px;
    padding: 10px 14px;
    border-top: 1px solid rgba(33, 150, 243, 0.1);
    flex-shrink: 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.chatbot-suggestions::-webkit-scrollbar { height: 0; }

.chatbot-suggestion-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(33, 150, 243, 0.32);
    background: transparent;
    color: var(--cb-blue-light);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background   0.18s ease,
                border-color 0.18s ease,
                color        0.18s ease;
}

.chatbot-suggestion-btn:hover {
    background: rgba(33, 150, 243, 0.15);
    border-color: var(--cb-blue);
    color: #fff;
}

/* Character counter */
.chatbot-char-counter {
    display: none;
    font-size: 11px;
    color: var(--cb-muted);
    text-align: right;
    padding: 0 18px 4px;
    flex-shrink: 0;
}

/* Input area */
.chatbot-input-container {
    padding: 10px 12px;
    border-top: 1px solid rgba(33, 150, 243, 0.1);
    background: var(--cb-bg);
    flex-shrink: 0;
}

.chatbot-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 16px;
    border-radius: 24px;
    border: 1px solid rgba(33, 150, 243, 0.22);
    background: var(--cb-surface);
    color: var(--cb-text);
    font-size: 14px;
    outline: none;
    caret-color: var(--cb-blue);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.chatbot-input::placeholder { color: rgba(241, 245, 249, 0.28); }

.chatbot-input:focus {
    border-color: var(--cb-blue);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.18);
}

.chatbot-send-btn {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--cb-blue-light), var(--cb-blue));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.4);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    padding: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.58);
}

.chatbot-send-btn:active { transform: scale(0.95); }

.chatbot-send-btn svg { width: 16px; height: 16px; fill: #fff; margin-left: 1px; }

/* ══════════════════════════════════════════════════════════════════
   FOOTER — shared across all panels
   ══════════════════════════════════════════════════════════════════ */
.chatbot-footer {
    height: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 10px;
    font-weight: 600;
    color: rgba(33, 150, 243, 0.6);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    user-select: none;
}

.chatbot-footer-dot {
    font-size: 8px;
    color: var(--cb-blue);
    vertical-align: middle;
}

.chatbot-footer-link {
    color: rgba(33, 150, 243, 0.6);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.15s ease;
}

.chatbot-footer-link:hover { color: var(--cb-blue); }

.chatbot-footer-text { color: rgba(33, 150, 243, 0.6); }

/* ══════════════════════════════════════════════════════════════════
   LIGHT MODE  [data-theme="light"]
   ══════════════════════════════════════════════════════════════════ */

/* Override design tokens so every var(--cb-*) consumer is correct in light mode. */
[data-theme="light"] .chatbot-widget {
    --cb-bg:        #ffffff;
    --cb-surface:   #f0f6ff;
    --cb-surface-2: #e8f0fe;
    --cb-text:      #1a1a1a;
    --cb-muted:     #4b5563;    /* was rgba(15,23,42,0.45) ≈ 3.1:1; #4b5563 = 7.4:1 ✓ */
    --cb-border:    rgba(33, 150, 243, 0.15);
    --cb-shadow:    0 20px 60px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .chatbot-window {
    background: #ffffff;
    border-color: rgba(33, 150, 243, 0.18);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .chatbot-header {
    background: #ffffff;
    border-bottom-color: rgba(33, 150, 243, 0.14);
}

[data-theme="light"] .chatbot-title  { color: #1a1a1a; }
[data-theme="light"] .chatbot-subtitle { color: #4b5563; }

[data-theme="light"] .chatbot-header-btn {
    border-color: rgba(0, 0, 0, 0.14);
    background: rgba(0, 0, 0, 0.04);
    color: #555;
}

[data-theme="light"] .chatbot-header-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #111;
}

[data-theme="light"] .chatbot-welcome-hero {
    background: linear-gradient(160deg, #1a3a5c 0%, #1e4a7a 60%, #1e5a96 100%);
}

/* Protect hero text — dark blue bg stays, so white text must not be overridden */
[data-theme="light"] .chatbot-welcome-greeting { color: #ffffff; }
[data-theme="light"] .chatbot-welcome-tagline  { color: rgba(255, 255, 255, 0.75); }

[data-theme="light"] .chatbot-welcome-body { background: #ffffff; }

[data-theme="light"] .chatbot-welcome-new-chat {
    background: rgba(33, 150, 243, 0.05);
    border-color: rgba(33, 150, 243, 0.28);
}

[data-theme="light"] .chatbot-welcome-new-chat:hover {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.5);
}

/* "New Conversation" subtitle — dark readable gray */
[data-theme="light"] .chatbot-welcome-new-chat-text span { color: #4b5563 !important; }

[data-theme="light"] .chatbot-welcome-topic {
    background: #f5f9ff;
    border-color: rgba(33, 150, 243, 0.2);
}

[data-theme="light"] .chatbot-welcome-topic:hover {
    background: rgba(33, 150, 243, 0.08);
    border-color: rgba(33, 150, 243, 0.42);
}

/* Card titles — dark, high-contrast, bold */
[data-theme="light"] .chatbot-welcome-topic strong {
    color: #111111 !important;
    font-weight: 700;
}
/* Card subtitles — clearly readable dark gray (10.7:1 on white) */
[data-theme="light"] .chatbot-welcome-topic span   { color: #374151 !important; }
/* Card icons — logo blue */
[data-theme="light"] .chatbot-welcome-topic svg    { color: #2196F3; }

[data-theme="light"] .chatbot-panel { background: #ffffff; }

[data-theme="light"] .chatbot-contact-intro p { color: #1a1a1a; }
[data-theme="light"] .chatbot-label           { color: #1a1a1a; }

[data-theme="light"] .chatbot-field-input {
    background: #f9fafb;
    border-color: #d1d5db;    /* solid gray — rgba(33,150,243,0.22) on white ≈ #d9ebfc, near invisible */
    color: #1a1a1a;
}

[data-theme="light"] .chatbot-field-input::placeholder { color: #9ca3af; }
[data-theme="light"] .chatbot-privacy-note { color: #6b7280; }

[data-theme="light"] .chatbot-messages { background: #f7faff; }

[data-theme="light"] .chatbot-date-sep {
    background: rgba(33, 150, 243, 0.07);
    color: #6b7280;    /* medium readable gray */
}

[data-theme="light"] .chatbot-msg--bot .chatbot-bubble {
    background: #eef5ff;    /* slightly deeper tint than #edf4ff for more definition */
    border-color: rgba(33, 150, 243, 0.35);    /* was 0.18 — too invisible on white */
    color: #1a1a1a;
}

[data-theme="light"] .chatbot-ts { color: #6b7280; }    /* was rgba(0,0,0,0.4); explicit medium gray */

[data-theme="light"] .chatbot-suggestions {
    border-top-color: #e5e7eb;    /* was rgba(33,150,243,0.1) ≈ near-invisible on white */
}

[data-theme="light"] .chatbot-suggestion-btn {
    background: #f0f7ff;    /* light blue tint — clearer than pure white */
    border-color: rgba(33, 150, 243, 0.40);    /* was 0.28; stronger = clearly clickable */
    color: #2196F3;    /* logo blue, not muted dark blue */
}

[data-theme="light"] .chatbot-suggestion-btn:hover {
    background: rgba(33, 150, 243, 0.12);
    border-color: #2196F3;
    color: #1565C0;
}

[data-theme="light"] .chatbot-input-container {
    background: #ffffff;
    border-top-color: #e5e7eb;    /* was rgba(33,150,243,0.1) — too faint */
}

[data-theme="light"] .chatbot-input {
    background: #f9fafb;    /* matches contact form inputs */
    border-color: #d1d5db;
    color: #1a1a1a;
}

[data-theme="light"] .chatbot-input::placeholder { color: #9ca3af; }

[data-theme="light"] .chatbot-send-btn {
    box-shadow: 0 2px 12px rgba(33, 150, 243, 0.40);    /* more visible pop on white row */
}

/* Footer — "Powered by OpsMonsters" — #1565C0 on white = 4.6:1 ✓ WCAG AA */
[data-theme="light"] .chatbot-footer {
    background: #fff;
    border-top-color: rgba(0, 0, 0, 0.06);
    color: #1565C0;
}

[data-theme="light"] .chatbot-footer-text         { color: #1565C0; }
[data-theme="light"] .chatbot-footer-dot           { color: #2196F3; }
[data-theme="light"] .chatbot-footer-link          { color: #1565C0; }
[data-theme="light"] .chatbot-footer-link:hover    { color: #0d47a1; }

[data-theme="light"] .chatbot-welcome-action-btn {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE  ≤ 640px
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    :root {
        --cb-fab-bottom: 16px;
        --cb-fab-right:  16px;
        --cb-fab-size:   50px;
    }

    .chatbot-window {
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: calc(100vh - var(--cb-fab-bottom) - var(--cb-fab-size) - 14px);
        max-height: calc(100vh - var(--cb-fab-bottom) - var(--cb-fab-size) - 14px);
        border-radius: 16px 16px 0 0;
        transform-origin: bottom center;
    }

    .chatbot-bubble { font-size: 13px; }
    .chatbot-input  { font-size: 14px; }
    .chatbot-title  { font-size: 13.5px; }
}

@media (max-width: 380px) {
    .chatbot-window {
        border-radius: 12px 12px 0 0;
        height: calc(100vh - var(--cb-fab-bottom) - var(--cb-fab-size) - 8px);
        max-height: calc(100vh - var(--cb-fab-bottom) - var(--cb-fab-size) - 8px);
    }
}
