/* Chat Quiz Widget Styles */
:root {
  --cq-primary: #000;
  --cq-secondary: #f0f0f0;
  --cq-text: #333;
  --cq-bg: #fff;
  --cq-bubble-manager: #f0f0f0;
  --cq-bubble-user: #000;
  --cq-text-manager: #333;
  --cq-text-user: #fff;
}

/* =========================================================================
   CLASSIC THEME (SLIDES)
   ========================================================================= */

.cq-theme-classic .cq-window {
    background: #f4f5f7; /* Light gray background like screenshot */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 500px;
    max-width: 900px;
    padding: 30px;
}

.cq-theme-classic .cq-classic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cq-theme-classic .cq-features-bar {
    background: transparent;
    color: #333;
    padding: 0;
    border: none;
    font-size: 16px;
    font-weight: 500;
    justify-content: flex-start;
    gap: 20px;
}

.cq-theme-classic .cq-classic-welcome {
    font-size: 22px;
    color: #002244; /* Dark blue from screenshot */
    margin-bottom: 30px;
    line-height: 1.5;
}

.cq-theme-classic .cq-classic-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: visible; /* Убираем скролл с тела, чтобы он был на родителе */
    padding-right: 0;
}

.cq-theme-classic .cq-classic-split-left::-webkit-scrollbar {
    width: 6px;
}
.cq-theme-classic .cq-classic-split-left::-webkit-scrollbar-track {
    background: transparent;
}
.cq-theme-classic .cq-classic-split-left::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.cq-theme-classic .cq-classic-question-title {
    font-size: 20px;
    font-weight: 600;
    color: #002244;
    margin-bottom: 25px;
}

.cq-theme-classic .cq-classic-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cq-theme-classic .cq-classic-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

/* Radio button style options */
.cq-classic-option {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.cq-classic-option:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cq-classic-option.selected {
    border-color: var(--cq-primary);
}

.cq-classic-option input[type="radio"],
.cq-classic-option input[type="checkbox"] {
    display: none;
}

.cq-custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #e05c2a; /* Primary orange */
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cq-classic-option.multiple-choice .cq-custom-radio {
    border-radius: 4px; /* Square for checkbox */
}

.cq-classic-option.selected .cq-custom-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #e05c2a;
    border-radius: 50%;
}

.cq-classic-option.multiple-choice.selected .cq-custom-radio::after {
    border-radius: 2px; /* Square inner fill for checkbox */
}

.cq-multiple-choice-hint {
    font-size: 13px;
    color: #888;
    margin-top: 15px;
    font-style: italic;
    text-align: left;
}

.cq-classic-option-text {
    font-size: 15px;
    color: #333;
}

/* Card options with images */
.cq-classic-option-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    overflow: hidden;
}

.cq-classic-option-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* Скрин результатов с картинкой */
.cq-classic-options-grid:has(> .cq-classic-option-card:only-child) .cq-classic-option-card {
    grid-column: 1 / -1; 
    max-width: 100%;
    border: none;
    box-shadow: none;
    background: transparent;
    cursor: default;
}

.cq-classic-options-grid:has(> .cq-classic-option-card:only-child) .cq-classic-option-img {
    height: auto;
    max-height: 400px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.cq-classic-options-grid:has(> .cq-classic-option-card:only-child) .cq-custom-radio {
    display: none; 
}

.cq-classic-options-grid:has(> .cq-classic-option-card:only-child) .cq-classic-option-text {
    font-weight: 600;
    font-size: 18px;
    color: #002244;
}

.cq-classic-options-grid:has(> .cq-classic-option-card:only-child) .cq-classic-option-text-wrapper {
    display: none !important;
}

/* Переименование кнопки */
.cq-window:has(.cq-classic-option-card:only-child) .cq-next-btn {
    font-size: 0;
}

.cq-window:has(.cq-classic-option-card:only-child) .cq-next-btn::after {
    content: "Оставить заявку";
    font-size: 16px;
}

.cq-classic-option-text-wrapper {
    display: flex;
    align-items: center;
    padding: 15px;
    width: 100%;
}

/* Classic Footer (Progress + Buttons) */
.cq-theme-classic .cq-classic-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
    padding-top: 20px;
}

.cq-theme-classic .cq-progress-container {
    flex: 1;
    max-width: 400px;
}

.cq-theme-classic .cq-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.cq-theme-classic .cq-progress-percent {
    color: #e05c2a;
}

.cq-theme-classic .cq-progress-bar {
    height: 4px;
    background: #dcdcdc;
    border-radius: 2px;
    overflow: hidden;
}

.cq-theme-classic .cq-progress-fill {
    height: 100%;
    background: #e05c2a;
    transition: width 0.3s ease;
}

.cq-theme-classic .cq-nav-buttons {
    display: flex;
    gap: 15px;
}

.cq-theme-classic .cq-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e05c2a;
    background: transparent;
    color: #e05c2a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cq-theme-classic .cq-back-btn:hover {
    background: #fff;
}

.cq-theme-classic .cq-next-btn {
    background: #e05c2a;
    color: #fff;
    border: none;
    padding: 0 30px;
    height: 40px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cq-theme-classic .cq-next-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cq-theme-classic .cq-next-btn:not(:disabled):hover {
    background: #c04c20;
}

/* Split Form Screen */
.cq-theme-classic .cq-classic-split {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin: -30px; /* Stretch to window edges */
    min-height: calc(100% + 60px);
}
.cq-theme-classic .cq-classic-split-left {
    flex: 1;
    background: #f4f5f7;
    padding: 40px;
    display: flex;
    flex-direction: column;
    position: relative; /* Для позиционирования крестика */
    overflow-y: auto; /* Скролл теперь на всем левом блоке */
    justify-content: center;
}

.cq-theme-classic .cq-classic-split-right {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cq-theme-classic .cq-classic-result-title {
    font-size: 24px;
    font-weight: 700;
    color: #002244;
    line-height: 1.3;
    margin-bottom: 20px;
}

.cq-theme-classic .cq-classic-result-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: auto;
}

.cq-theme-classic .cq-form-group {
    margin-bottom: 20px;
}

.cq-theme-classic .cq-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #002244;
    margin-bottom: 8px;
}

.cq-theme-classic .cq-input-classic {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e05c2a;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
}

.cq-theme-classic .cq-submit-btn-classic {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 1px solid #e05c2a;
    color: #e05c2a;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.cq-theme-classic .cq-submit-btn-classic:hover {
    background: #e05c2a;
    color: #fff;
}

.cq-theme-classic .cq-consent {
    margin-top: 15px;
    font-size: 11px;
    color: #666;
}

.cq-theme-classic .cq-consent label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.cq-theme-classic .cq-consent a {
    color: #002244;
    text-decoration: underline;
}

/* =========================================================================
   BANNER THEME
   ========================================================================= */
.cq-theme-banner.cq-embedded-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.cq-theme-banner .cq-window {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    height: 100%;
    position: relative;
    border: none;
    aspect-ratio: 3 / 4;
}

.cq-banner-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.cq-banner-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,34,68,0.2) 0%, rgba(0,34,68,0.85) 100%);
    z-index: 1;
}

.cq-banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 40px 30px;
    color: #fff;
    text-align: center;
}

.cq-banner-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.cq-banner-subtitle {
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.4;
    margin-bottom: 30px;
}

@keyframes cq-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.cq-shimmer-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(90deg, var(--cq-primary, #e05c2a) 0%, #ff9e75 50%, var(--cq-primary, #e05c2a) 100%);
    background-size: 200% auto;
    animation: cq-shimmer 3s infinite linear;
    box-shadow: 0 4px 15px rgba(224, 92, 42, 0.4);
    transition: transform 0.2s;
}

.cq-shimmer-btn:hover {
    transform: scale(1.02);
}

.cq-theme-banner .cq-classic-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cq-banner-form-container {
    position: relative;
    z-index: 2;
    background: #fff;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 25px 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Переиспользуем стили форм из classic */
.cq-theme-banner .cq-form { display: flex !important; flex-direction: column !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
.cq-theme-banner .cq-form-group { margin-bottom: 15px !important; width: 100% !important; }
.cq-theme-banner .cq-form-label { display: block !important; font-size: 12px !important; font-weight: 600 !important; color: #002244 !important; margin-bottom: 5px !important; text-align: left !important; text-transform: uppercase !important; font-family: inherit !important; }
.cq-theme-banner .cq-input-classic { width: 100% !important; height: 40px !important; padding: 0 12px !important; border: 1px solid #ccc !important; border-radius: 8px !important; font-size: 15px !important; outline: none !important; box-sizing: border-box !important; font-family: inherit !important; color: #333 !important; background: #fff !important; margin: 0 !important; box-shadow: none !important; }
.cq-theme-banner .cq-input-classic:focus { border-color: var(--cq-primary, #e05c2a) !important; }
.cq-theme-banner .cq-submit-btn-classic { width: 100% !important; height: 44px !important; padding: 0 !important; background: var(--cq-primary, #e05c2a) !important; border: none !important; color: #fff !important; border-radius: 8px !important; font-weight: 600 !important; font-size: 15px !important; cursor: pointer !important; margin-top: 5px !important; transition: all 0.2s !important; display: flex !important; align-items: center !important; justify-content: center !important; font-family: inherit !important; text-transform: none !important; }
.cq-theme-banner .cq-submit-btn-classic:hover { opacity: 0.9 !important; }
.cq-theme-banner .cq-consent { margin-top: 10px !important; font-size: 11px !important; color: #666 !important; text-align: left !important; line-height: 1.2 !important; }
.cq-theme-banner .cq-consent label { display: flex !important; align-items: flex-start !important; gap: 8px !important; cursor: pointer !important; margin: 0 !important; }
.cq-theme-banner .cq-consent input[type="checkbox"] { margin: 2px 0 0 0 !important; width: 16px !important; height: 16px !important; cursor: pointer !important; }
.cq-theme-banner .cq-consent a { color: #002244 !important; text-decoration: underline !important; }

/* Banner Theme Success Screen */
.cq-theme-banner .cq-classic-success-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
    background: #fff; /* Ensure readable background if no image overlay is visible enough */
}
.cq-theme-banner .cq-success-icon {
    font-size: 60px;
    margin-bottom: 20px;
}
.cq-theme-banner .cq-success-title {
    font-size: 22px;
    color: #002244;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.3;
}
.cq-theme-banner .cq-success-desc {
    color: #666;
    font-size: 15px;
    margin-bottom: 30px;
    line-height: 1.4;
}
.cq-theme-banner .cq-success-download-btn {
    max-width: 250px;
    color: #fff !important;
    margin-bottom: 10px !important;
}
.cq-theme-banner .cq-success-home-btn {
    max-width: 250px;
    background: #f0f0f0 !important;
    color: #333 !important;
}
.cq-theme-banner .cq-success-home-btn:hover {
    background: #e0e0e0 !important;
}

@media (max-width: 768px) {
    .cq-theme-classic .cq-classic-split,
    .cq-theme-banner .cq-classic-split {
        flex-direction: column;
        margin: 0;
        height: auto;
        min-height: auto;
        overflow-y: auto;
        flex: 1;
    }
    
    .cq-theme-classic .cq-classic-split-left {
        padding: 20px;
        flex: none;
    }
    
    .cq-theme-classic .cq-classic-split-right {
        padding: 20px;
        flex: none;
    }

    .cq-theme-classic .cq-window,
    .cq-theme-banner .cq-window {
        padding: 15px;
        display: flex;
        flex-direction: column;
        max-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .cq-theme-classic .cq-classic-body {
        padding-right: 5px;
    }

    .cq-theme-classic .cq-classic-footer {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #eee;
    }
}

#chat-quiz-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

#chat-quiz-container * {
  box-sizing: border-box;
}

/* WIDGET & AUTO-OPEN MODE (Overlay/Modal) */
.cq-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent backdrop */
    z-index: 2147483647; /* Maximum possible z-index to ensure it's always on top */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cq-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Launcher Button (Fixed in corner) */
.cq-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2147483646; /* Just below overlay */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--cq-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}

.cq-launcher:hover {
  transform: scale(1.05);
}

.cq-launcher svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

/* Chat Window */
.cq-window {
  background: var(--cq-bg);
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Скролл на всем окне */
  overflow-x: hidden;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 900px;
  height: 90vh;
  min-height: 600px;
  max-height: 800px;
  position: relative;
  margin: auto; /* Center in overlay */
}

/* Specific styling overrides for Modal/Widget mode */
.cq-modal-overlay .cq-window {
    transform: translateY(20px);
}

.cq-modal-overlay.open .cq-window {
    transform: translateY(0);
}

/* EMBEDDED MODE Container */
.cq-embedded-container {
    width: 100%;
    /* height: 100%; - убираем жесткую высоту */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Прижимаем к верху, чтобы блок мог расти вниз */
}

/* Ensure Embedded window behaves correctly */
.cq-embedded-container .cq-window {
    width: 100%;
    max-width: 900px;
    height: auto;
    min-height: 600px;
    max-height: none;
    margin: 0 0 40px 0;
    transform: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 12px;
}

/* Fix banner aspect ratio specifically for embedded */
#chat-quiz-container.cq-theme-banner {
    max-width: 400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: block !important;
    height: auto !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

#chat-quiz-container.cq-theme-banner .cq-window {
    min-height: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    aspect-ratio: 3 / 4 !important;
    max-width: 100% !important;
    width: 100% !important;
    display: flex !important;
    border-radius: 12px !important;
}

/* Переопределяем поведение сообщений для embedded */
.cq-embedded-container .cq-messages {
    overflow-y: visible; /* Отключаем внутренний скролл, чтобы окно тянулось */
}

/* Fix header for embedded mode so it doesn't scroll away */
.cq-embedded-container .cq-features-bar {
    position: sticky;
    top: 0;
    z-index: 10;
}

.cq-embedded-container .cq-header {
    position: sticky;
    top: 49px; /* Высота features bar (примерно) */
    z-index: 10;
}

/* Header */
.cq-header {
  padding: 15px 20px;
  background: var(--cq-primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Top Features Bar (New) */
.cq-features-bar {
  display: flex;
  justify-content: space-around;
  background: #1a1a1a;
  color: #fff;
  padding: 15px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cq-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cq-feature-icon {
  font-size: 18px;
}

.cq-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}

.cq-header-info h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f0f0f0;
}

.cq-header img {
    margin-right: 0;
    margin-left: 0;
}

.cq-header-info p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.8;
}

.cq-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #0c1d7e;
  cursor: pointer;
  padding: 5px;
  z-index: 100;
  font-size: 20px;
}

/* Messages Area */
.cq-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: #f9f9f9;
}

.cq-message {
  max-width: 70%;
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  animation: cq-fade-in 0.3s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

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

.cq-message.manager {
  align-self: flex-start;
  background-color: #fff;
  color: var(--cq-text-manager);
  border-bottom-left-radius: 2px;
  border: 1px solid #eee;
}

.cq-message.user {
  align-self: flex-end;
  background-color: var(--cq-bubble-user);
  color: var(--cq-text-user);
  border-bottom-right-radius: 2px;
}

/* Options / Input Area */
.cq-input-area {
  padding: 0;
  border-top: none;
  background: transparent;
  min-height: 0;
}

/* Card Style Options (Grid for Embedded and Modal) */
.cq-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  width: 100%;
  gap: 15px;
}

.cq-options-message {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 20px;
    animation: cq-fade-in 0.3s ease;
}

.cq-option-btn {
  padding: 10px 20px;
  border: 1px solid #0865a7; /* Use primary color border */
  color: #0865a7;
  background: #fff;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  /* Button style should be flex/inline-block, not grid */
  display: inline-block;
  text-align: center;
  min-width: 100px;
  justify-self: start;
}

.cq-option-btn:hover {
  background: #0865a7;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(8, 101, 167, 0.2);
}

/* Card Styles - Same for all modes */
.cq-option-card {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column; /* Always stack image and text */
  background: #fff;
  height: 100%;
}

.cq-option-card:hover {
  border-color: var(--cq-primary);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transform: translateY(-4px);
}

.cq-option-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 0;
}

.cq-option-content {
  padding: 12px;
  text-align: center;
}

/* Fix for buttons inside grid container */
.cq-options:has(> .cq-option-btn) {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Form */
.cq-form-message {
    max-width: 100%; /* Take full width of container */
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    margin-top: 10px;
    align-self: center; /* Center in chat */
    width: 100%;
    display: flex;
    justify-content: center;
}

.cq-form {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Reduced gap */
  max-width: 400px; /* Slightly narrower */
  width: 100%;
  padding: 0; /* Remove padding */
  background: transparent; /* Remove background */
  border-radius: 0;
  box-shadow: none; /* Remove shadow */
  border: none; /* Remove border */
}

/* Loading state */
.cq-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-weight: 500;
}

.cq-input {
  padding: 12px 0; /* Minimal vertical padding */
  border: none;
  border-bottom: 2px solid #eee; /* Underline style */
  border-radius: 0;
  font-size: 16px;
  outline: none;
  background: transparent;
  transition: all 0.3s ease;
  color: #333;
}

.cq-input:focus {
  border-color: var(--cq-primary);
  box-shadow: none;
  background: transparent;
}

.cq-input::placeholder {
  color: #aaa;
}

.cq-submit-btn {
  padding: 15px;
  background: var(--cq-primary);
  color: #fff;
  border: none;
  border-radius: 30px; /* Pill shape */
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(8, 101, 167, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cq-submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(8, 101, 167, 0.4);
}

/* Typing Indicator */
.cq-typing {
  display: flex;
  gap: 4px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 16px;
  border-bottom-left-radius: 2px;
  border: 1px solid #eee;
  align-self: flex-start;
  width: fit-content;
}

.cq-dot {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: cq-bounce 1.4s infinite ease-in-out both;
}

.cq-dot:nth-child(1) { animation-delay: -0.32s; }
.cq-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes cq-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@media (max-width: 600px) {
  .cq-embedded-container .cq-options {
    grid-template-columns: 1fr;
  }
  
  .cq-modal-overlay .cq-window {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    margin: 0;
  }

  .cq-features-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
  }
  .cq-classic-welcome {
    font-size:  18px!important;
  }
  .cq-close {
    top:15px!important;
    font-size: 25px;;
  }
}