/* ===== Google Font Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
  --chat-primary: #d2232a;
  --chat-primary-dark: #a81b21;
  --chat-primary-gradient: linear-gradient(135deg, #d2232a 0%, #e8555b 50%, #d2232a 100%);
  --chat-bg: #ffffff;
  --chat-messages-bg: #f7f8fc;
  --chat-user-bubble: #eef1f8;
  --chat-user-text: #1a1d26;
  --chat-bot-bubble: var(--chat-primary);
  --chat-bot-text: #ffffff;
  --chat-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
  --chat-toggle-shadow: 0 6px 24px rgba(210, 35, 42, 0.4);
  --chat-radius: 16px;
  --chat-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --chat-transition: cubic-bezier(0.22, 1, 0.36, 1);

  /* Live chat overrides */
  --livechat-primary: var(--chat-primary);
  --livechat-gradient: var(--chat-primary-gradient);
}

/* ===== Main Chat Container ===== */
#codeness-chatbot {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  height: 560px;
  background-color: var(--chat-bg);
  box-shadow: var(--chat-shadow);
  border-radius: var(--chat-radius);
  display: flex;
  flex-direction: column;
  z-index: 999999;
  opacity: 0;
  transform: translateY(24px) scale(0.9);
  transition: transform 0.4s var(--chat-transition), opacity 0.3s ease;
  transform-origin: bottom right;
  font-family: var(--chat-font);
  overflow: hidden;
}

#codeness-chatbot.collapsed {
  opacity: 0;
  transform: translateY(24px) scale(0.1);
  pointer-events: none;
  transition: transform 0.35s var(--chat-transition), opacity 0.25s ease;
}

#codeness-chatbot.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== Toggle Button ===== */
#codeness-chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: var(--chat-primary-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 99999999;
  transition: transform 0.3s var(--chat-transition), box-shadow 0.3s ease;
  box-shadow: var(--chat-toggle-shadow);
}

#codeness-chatbot-counter {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff3b30;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  min-width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border: 2px solid white;
  z-index: 100;
  animation: counterIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes counterIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

#codeness-chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(210, 35, 42, 0.5);
}

#codeness-chatbot-toggle:active {
  transform: scale(0.95);
}

#bot-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== Header ===== */
#codeness-chatbot-header {
  position: relative;
  background: var(--chat-primary-gradient);
  color: white;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  letter-spacing: 0.3px;
  transition: background 0.4s ease;
}

#bot-image-header {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

#codeness-chatbot-header span:first-of-type {
  flex: 1;
}

#codeness-chatbot-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border: none;
  font-size: 18px;
  line-height: 1;
  transition: background-color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
}

#codeness-chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

/* ===== Messages Area ===== */
#codeness-chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: var(--chat-messages-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

/* Custom scrollbar */
#codeness-chatbot-messages::-webkit-scrollbar {
  width: 5px;
}

#codeness-chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#codeness-chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

#codeness-chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ===== Input Container ===== */
#chatbot-input-container {
  background-color: var(--chat-bg);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

#codeness-chatbot-input {
  all: initial;
  font-family: var(--chat-font);
  font-size: 14px;
  color: var(--chat-user-text);
  border: none;
  padding: 10px 14px;
  flex: 1;
  box-sizing: border-box;
  resize: none;
  height: 40px;
  min-height: 40px;
  max-height: 80px;
  overflow-y: auto;
  outline: none;
  background: var(--chat-messages-bg);
  border-radius: 20px;
  line-height: 1.4;
}

#codeness-chatbot-input::placeholder {
  color: #9ca3b4;
  font-size: 13px;
}

/* ===== Action Buttons (Mic + Send) ===== */
#codeness-chatbot-mic,
#codeness-chatbot-send {
  all: initial;
  font-family: var(--chat-font);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

#codeness-chatbot-send {
  background: var(--chat-primary-gradient);
  color: white;
}

#codeness-chatbot-send i {
  color: white !important;
  font-size: 14px;
}

#codeness-chatbot-send:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(210, 35, 42, 0.35);
}

#codeness-chatbot-mic {
  background: transparent;
  color: #6b7280;
}

#codeness-chatbot-mic i {
  font-size: 15px;
}

#codeness-chatbot-mic:hover {
  background: var(--chat-messages-bg);
  color: var(--chat-primary);
  transform: scale(1.1);
}

/* Language selector */
#language-select {
  all: initial;
  font-family: var(--chat-font);
  cursor: pointer;
  border: none;
  background: var(--chat-messages-bg);
  outline: none;
  display: flex;
  width: 42px;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  transition: background 0.2s ease;
}

#language-select:hover {
  background: #e8eaf0;
}

/* ===== Message Bubbles ===== */
.chatbot-message {
  margin: 3px 0;
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: messageIn 0.35s var(--chat-transition);
  box-shadow: none;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.user-message {
  align-self: flex-end;
  background-color: var(--chat-user-bubble);
  color: var(--chat-user-text);
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.bot-message {
  align-self: flex-start;
  background: var(--chat-primary-gradient);
  color: var(--chat-bot-text);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 16px;
  box-shadow: 0 2px 8px rgba(210, 35, 42, 0.15);
}

.message-header {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.message-content {
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

/* ===== Loading Spinner ===== */
.chatbot-message.loading-message {
  text-align: center;
  font-size: 14px;
  color: #888;
}

#codeness-chatbot-loading {
  box-shadow: none !important;
  max-width: unset !important;
  background: transparent !important;
}

.loader {
  height: 20px;
  margin: 0 auto;
  aspect-ratio: 2.5;
  --_g: no-repeat radial-gradient(farthest-side, var(--chat-primary) 90%, #0000);
  background: var(--_g), var(--_g), var(--_g), var(--_g);
  background-size: 20% 50%;
  animation: l43 1s infinite linear;
}

@keyframes l43 {
  0% {
    background-position: calc(0*100%/3) 50%, calc(1*100%/3) 50%, calc(2*100%/3) 50%, calc(3*100%/3) 50%
  }

  16.67% {
    background-position: calc(0*100%/3) 0, calc(1*100%/3) 50%, calc(2*100%/3) 50%, calc(3*100%/3) 50%
  }

  33.33% {
    background-position: calc(0*100%/3) 100%, calc(1*100%/3) 0, calc(2*100%/3) 50%, calc(3*100%/3) 50%
  }

  50% {
    background-position: calc(0*100%/3) 50%, calc(1*100%/3) 100%, calc(2*100%/3) 0, calc(3*100%/3) 50%
  }

  66.67% {
    background-position: calc(0*100%/3) 50%, calc(1*100%/3) 50%, calc(2*100%/3) 100%, calc(3*100%/3) 0
  }

  83.33% {
    background-position: calc(0*100%/3) 50%, calc(1*100%/3) 50%, calc(2*100%/3) 50%, calc(3*100%/3) 100%
  }

  100% {
    background-position: calc(0*100%/3) 50%, calc(1*100%/3) 50%, calc(2*100%/3) 50%, calc(3*100%/3) 50%
  }
}

/* ===== Prompt Buttons ===== */
.prompt-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.yes-no-buttons {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--chat-font);
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.yes-no-buttons:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* ===== Contact Modal ===== */
#form-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 15, 30, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999999;
  justify-content: center;
  align-items: center;
  animation: modalOverlayIn 0.3s ease;
}

@keyframes modalOverlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#form-modal .modal-content {
  background-color: #ffffff;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  max-width: 420px;
  width: 90%;
  box-sizing: border-box;
  position: relative;
  animation: modalContentIn 0.4s var(--chat-transition);
}

@keyframes modalContentIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#form-modal .modal-content h2 {
  font-family: var(--chat-font);
  font-size: 20px;
  font-weight: 700;
  color: #1a1d26;
  margin: 0 0 6px 0;
  text-align: center;
}

#form-modal .close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #6b7280;
  transition: all 0.2s ease;
  line-height: 1;
}

#form-modal .close:hover {
  background: #f3f4f6;
  color: #1a1d26;
}

/* ===== Contact Form ===== */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 20px;
}

#contact-form label {
  font-family: var(--chat-font);
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  margin-top: 12px;
}

#contact-form label:first-of-type {
  margin-top: 0;
}

#contact-form input {
  font-family: var(--chat-font);
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  color: #1a1d26;
  background: #f9fafb;
  transition: all 0.2s ease;
  outline: none;
  margin-bottom: 0;
}

#contact-form input:focus {
  border-color: var(--chat-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(210, 35, 42, 0.1);
}

#contact-form input::placeholder {
  color: #9ca3af;
}

#contact-form button {
  font-family: var(--chat-font);
  margin-top: 20px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: var(--chat-primary-gradient);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

#contact-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(210, 35, 42, 0.3);
}

#contact-form button:active {
  transform: translateY(0);
}

/* Remove br tags from form (styling override) */
#contact-form br {
  display: none;
}

#form-modal.show {
  display: flex;
}

/* ===== Alert Badges ===== */
.color-red {
  color: var(--chat-primary);
}

.color-green {
  color: var(--chat-primary);
}

.color-green,
.color-red {
  font-family: var(--chat-font);
  padding: 10px 14px;
  background: #fef9ee;
  margin: 10px;
  border-radius: 10px;
  font-size: 13px;
}

/* ===== Error Message ===== */
.error-message {
  align-self: center !important;
  max-width: 90% !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-size: 12px !important;
  text-align: center;
  box-shadow: none !important;
}

/* ===== Mic Pulse Animation ===== */
@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.pulse-animation {
  animation: pulse 1.5s infinite;
}

/* ===== Info Response ===== */
#info-response {
  font-family: var(--chat-font);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  #codeness-chatbot {
    width: calc(100vw - 16px);
    height: calc(100vh - 100px);
    right: 8px;
    bottom: 80px;
    border-radius: 16px;
  }
}


/* =========================================================
   LIVE CHAT MODE STYLES
   ========================================================= */

#codeness-chatbot.livechat-active #codeness-chatbot-header {
  background: var(--livechat-gradient);
  transition: background 0.4s ease;
}

#codeness-chatbot.livechat-active #codeness-chatbot-header::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #ffffff;
  border-radius: 50%;
  margin-left: 8px;
  animation: live-pulse 1.5s infinite;
  flex-shrink: 0;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

#codeness-chatbot.livechat-active #codeness-chatbot-send {
  background: var(--livechat-gradient);
}

#codeness-chatbot.livechat-active #codeness-chatbot-send:hover {
  box-shadow: 0 4px 12px rgba(210, 35, 42, 0.35);
}

#codeness-chatbot.livechat-active #codeness-chatbot-toggle {
  background: var(--livechat-gradient);
  box-shadow: 0 6px 24px rgba(210, 35, 42, 0.4);
}

.system-message {
  align-self: center !important;
  max-width: 90% !important;
  background-color: #edf2f7;
  color: #64748b;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  box-shadow: none !important;
  margin: 6px 0;
  letter-spacing: 0.2px;
}

.agent-message {
  background: var(--chat-primary-gradient) !important;
  box-shadow: 0 2px 8px rgba(210, 35, 42, 0.15) !important;
}

.tts-disabled {
  opacity: 0.25 !important;
  cursor: not-allowed !important;
  pointer-events: none;
  filter: grayscale(1);
}

/* ===== End Chat Button ===== */
#codeness-chatbot-end-chat {
  all: initial;
  font-family: var(--chat-font);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  background: #fef2f2;
  color: #dc2626;
}

#codeness-chatbot-end-chat i {
  font-size: 15px;
  color: #dc2626;
}

#codeness-chatbot-end-chat:hover {
  background: #fee2e2;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

#codeness-chatbot.livechat-active #codeness-chatbot-end-chat {
  display: flex;
}

/* ===== Close Chat Confirmation Dialog ===== */
.chat-dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 30, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999999;
  justify-content: center;
  align-items: center;
}

.chat-dialog-overlay.show {
  display: flex;
  animation: dialogOverlayIn 0.25s ease forwards;
}

@keyframes dialogOverlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.chat-dialog-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.04);
  text-align: center;
  animation: dialogBoxIn 0.35s var(--chat-transition) forwards;
}

@keyframes dialogBoxIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-dialog-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.25);
}

.chat-dialog-icon i {
  font-size: 22px;
  color: #d97706;
}

.chat-dialog-title {
  font-family: var(--chat-font);
  font-size: 18px;
  font-weight: 700;
  color: #1a1d26;
  margin: 0 0 8px 0;
}

.chat-dialog-text {
  font-family: var(--chat-font);
  font-size: 13.5px;
  color: #6b7280;
  line-height: 1.55;
  margin: 0 0 24px 0;
}

.chat-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.chat-dialog-btn {
  font-family: var(--chat-font);
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  letter-spacing: 0.2px;
}

/* ===== Star Rating UI ===== */
.chat-rating-container {
  background: white !important;
  border-radius: 12px !important;
  padding: 16px !important;
  margin: 12px 0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
  text-align: center;
  align-self: center !important;
  max-width: 90% !important;
  color: #1a1d26 !important;
}

.chat-rating-title {
  font-family: var(--chat-font);
  font-size: 14px;
  font-weight: 600;
  color: #1a1d26;
  margin-bottom: 12px;
}

.chat-rating-stars-js {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 28px;
  color: #e5e7eb;
}

.chat-rating-stars-js i {
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

.chat-rating-stars-js i:hover {
  transform: scale(1.1);
}

.chat-rating-stars-js i:active {
  transform: scale(0.9);
}

.chat-rating-submit {
  font-family: var(--chat-font);
  margin-top: 16px;
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  background: var(--chat-primary-gradient);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
}

.chat-rating-submit:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(210, 35, 42, 0.25);
  transform: translateY(-1px);
}

.chat-rating-submit:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.chat-dialog-btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.chat-dialog-btn-cancel:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.chat-dialog-btn-confirm {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.chat-dialog-btn-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.chat-dialog-btn-confirm:active,
.chat-dialog-btn-cancel:active {
  transform: translateY(0);
}

/* ===== Animated Typing Indicator ===== */
.typing-indicator-container {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 18px;
  min-width: 36px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--chat-bot-text);
  border-radius: 50%;
  opacity: 0.9;
  animation: typing-bubble 1.4s infinite ease-in-out both;
}

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

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

@keyframes typing-bubble {

  0%,
  80%,
  100% {
    transform: scale(0.4) translateY(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1) translateY(-3px);
    opacity: 1;
  }
}

#chat-rating-box {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  text-align: center;
  max-width: 340px;
  margin: 0 auto;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.cr-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f9fafb;
  border: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.9rem;
}

.cr-title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  margin: 0 0 3px;
}

.cr-sub {
  font-size: 12px;
  color: #9ca3af;
  margin: 0 0 1.25rem;
}

.cr-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
  user-select: none;
}

.cr-star-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
}

.cr-star-wrap svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  pointer-events: none;
  transition: transform 0.12s ease;
}

.cr-star-wrap:hover svg {
  transform: scale(1.18);
}

.cr-half-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  z-index: 2;
}

.cr-full-zone {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  z-index: 2;
}

.cr-pip-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 0.9rem;
}

.cr-pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e5e7eb;
  transition: background 0.2s;
}

.cr-pip.on {
  background: #f59e0b;
}

.cr-label {
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  height: 16px;
  margin-bottom: 1rem;
  transition: color 0.15s;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.cr-label.active {
  color: #6b7280;
}

.chat-rating-submit {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: transparent;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  cursor: not-allowed;
  opacity: 0.5;
  transition: all 0.2s;
}

.chat-rating-submit.ready {
  opacity: 1;
  cursor: pointer;
  background: #111;
  color: #fff;
  border-color: #111;
}

.chat-rating-submit.ready:hover {
  background: #333;
  border-color: #333;
}

.cr-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.cr-success-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.cr-success-title {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin: 0;
}

.cr-success-sub {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
}