* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.cw-chat-bubble {
  position: fixed;
  bottom: 60px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 1000;
}

.cw-chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

.cw-chat-bubble img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cw-chat-bubble:hover img {
  transform: scale(1.1);
}

.cw-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  background: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  z-index: 10;
  animation: pulse 2s infinite;
}

.cw-notification-count {
  color: white;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.cw-chat-window {
  position: fixed;
  bottom: 130px;
  right: 20px;
  width: 380px;
  height: 600px;
  background-color: #fefefe;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(30px) scale(0.8);
  opacity: 0;
  transition: all 0.3s ease-out;
  transform-origin: bottom right;
  z-index: 2147483648;
  max-height: 600px;
  min-height: 400px;
}

/* Mobile keyboard adjustments */
@media (max-width: 768px) {
  .cw-chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    max-height: 100vh;
    max-height: 100dvh;
    min-height: 0;
    border-radius: 0;
  }
  
  .cw-chat-window.active {
    /* Use fixed positioning with viewport units */
    position: fixed;
    top: 0;
    bottom: 0;
    height: auto;
    max-height: none;
  }
  
  /* When keyboard is open, adjust using visualViewport */
  .cw-chat-window.cw-keyboard-open {
    height: var(--viewport-height, 100vh);
    transition: height 0.2s ease-out;
  }
}

.cw-chat-window.active {
  display: flex;
  transform: translateY(0) scale(1);
  opacity: 1;
  animation: chatWindowSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatWindowSlideIn {
  0% {
    transform: translateY(50px) scale(0.7) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: translateY(-10px) scale(1.05) rotate(2deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Fullscreen mode styles */
.cw-chat-window.cw-fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  z-index: 2147483648;
  opacity: 1;
  transition: all 0.3s ease-out;
  
  /* Position to fill entire screen from bottom-right */
  bottom: 0;
  right: 0;
  transform: translateY(0) scale(1);
  transform-origin: bottom right;
}

.cw-chat-window.cw-fullscreen .cw-chat-header {
  border-radius: 0;
  transition: border-radius 0.3s ease;
}

.cw-chat-window.cw-fullscreen .cw-expand-chat svg {
  transform: rotate(180deg);
  transition: transform 0.3s ease-out;
}

.cw-chat-header {
  padding: 14px 16px;
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid #e5e7eb;
}

.cw-chat-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #DC2626, #B91C1C, #991B1B);
  pointer-events: none;
}

/* decorative overlay removed */

/* hover overlay removed */

.cw-chat-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.cw-agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

.cw-agent-avatar:hover {
  border-color: #d1d5db;
}

.cw-agent-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cw-agent-name-wrapper {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cw-agent-name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.2;
  color: #111827;
  text-shadow: none;
}

.cw-agent-role {
  display: none;
}

.cw-agent-status {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0;
}

.cw-status-indicator {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d1fae5 inset;
}

@keyframes statusPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}


.cw-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.cw-expand-chat,
.cw-close-chat {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #374151;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.cw-expand-chat {
  font-size: 16px;
  display: none; /* Hidden by default on desktop */
}


.cw-close-chat {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.cw-expand-chat:hover,
.cw-close-chat:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

.cw-expand-chat:active,
.cw-close-chat:active {
  background-color: #e5e7eb;
}

.cw-expand-chat svg {
  transition: transform 0.3s ease;
}


.cw-expand-chat:hover svg {
  transform: scale(1.1);
}

.cw-chat-content {
  flex: 1 1 auto;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
  position: relative;
  min-height: 0; /* Important for flex scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Mobile chat content adjustments */
@media (max-width: 768px) {
  .cw-chat-content {
    padding: 16px;
    /* Reserve space for footer when keyboard is open */
  }
  
  .cw-chat-window.cw-keyboard-open .cw-chat-content {
    /* Additional bottom padding to ensure last message is visible */
    padding-bottom: 20px;
  }
}

.cw-chat-footer {
  flex-shrink: 0;
  padding: 16px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
/* Mobile footer adjustments */
@media (max-width: 768px) {
  .cw-chat-footer {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    position: sticky;
    bottom: 0;
    z-index: 10;
  }
  
  .cw-chat-window.cw-keyboard-open .cw-chat-footer {
    /* Ensure footer stays visible when keyboard is open */
    position: sticky;
    bottom: 0;
  }
}


.cw-message-input-container {
  width: 100%;
  transition: all 0.3s ease;
}

.cw-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
}

.cw-message-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  position: relative;
  height: 44px;
  line-height: 1.2;
  box-sizing: border-box;
}

.cw-message-input::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}

.cw-message-input:focus {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  background: linear-gradient(135deg, #ffffff, #fefefe);
  transform: translateY(-1px);
}

.cw-message-input:hover::before {
  left: 100%;
}

.cw-send-btn {
  padding: 12px;
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  min-width: 44px;
  height: 44px;
  box-sizing: border-box;
}

.cw-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.cw-send-btn img {
  width: 20px;
  height: 20px;
}

.cw-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cw-message {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  word-break: break-word;
  animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cw-message.user {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  color: white;
  margin-left: auto;
  word-break: break-word;
}

.cw-message.bot {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

/* Typing indicator animation */
.cw-typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 80%;
  margin-bottom: 12px;
  animation: messageSlideIn 0.4s ease-out;
}

.cw-typing-text {
  color: #6b7280;
  font-size: 14px;
  margin-right: 8px;
}

.cw-typing-dots {
  display: flex;
  gap: 4px;
}

.cw-typing-dot {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

.cw-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

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

/* Scrollbar styling */
.cw-chat-content::-webkit-scrollbar {
  width: 6px;
}

.cw-chat-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.cw-chat-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.cw-chat-content::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Markdown styles for bot messages */
.cw-message.bot h1,
.cw-message.bot h2,
.cw-message.bot h3,
.cw-message.bot h4,
.cw-message.bot h5,
.cw-message.bot h6 {
  margin: 4px 0 2px 0;
  font-weight: 600;
  line-height: 1.2;
  color: #1f2937;
}

.cw-message.bot h1 { font-size: 18px; }
.cw-message.bot h2 { font-size: 16px; }
.cw-message.bot h3 { font-size: 15px; }
.cw-message.bot h4 { font-size: 14px; }
.cw-message.bot h5 { font-size: 13px; }
.cw-message.bot h6 { font-size: 12px; }

.cw-message.bot p {
  margin: 2px 0;
  line-height: 1.3;
}

.cw-message.bot ul,
.cw-message.bot ol {
  margin: 2px 0;
  padding-left: 12px;
}

.cw-message.bot li {
  margin: 1px 0;
  line-height: 1.3;
}

.cw-message.bot ul li {
  list-style-type: disc;
}

.cw-message.bot ol li {
  list-style-type: decimal;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .cw-expand-chat {
    display: none;
  }

  .cw-chat-window {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    max-height: none;
    min-height: none;
  }
  
  .cw-chat-window.active {
    transform: none;
  }

  .cw-chat-header {
    padding: 16px;
    flex-shrink: 0;
  }

  .cw-chat-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
  }

  .cw-chat-footer {
    flex-shrink: 0;
    padding: 16px;
    /* Add extra padding on mobile to keep input above browser bar */
    padding-bottom: max(140px, calc(140px + env(safe-area-inset-bottom)));
  }

  .cw-message-input {
    font-size: 16px;
  }

  .cw-send-btn {
    min-width: 48px;
    height: 48px;
  }

  .cw-chat-bubble {
    bottom: 50px;
    right: 10px;
    width: 56px;
    height: 56px;
  }
}

.cw-message.bot a {
  color: #DC2626;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.cw-message.bot a:hover {
  color: #B91C1C;
}

.cw-message.bot code {
  background: #f1f5f9;
  color: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', Monaco, monospace;
  font-size: 13px;
  border: 1px solid #e2e8f0;
}

.cw-message.bot pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px;
  margin: 2px 0;
  overflow-x: auto;
  font-family: 'Courier New', Monaco, monospace;
  font-size: 13px;
  line-height: 1.3;
}

.cw-message.bot pre code {
  background: none;
  border: none;
  padding: 0;
}

.cw-message.bot strong,
.cw-message.bot b {
  font-weight: 600;
  color: #1f2937;
}

.cw-message.bot em,
.cw-message.bot i {
  font-style: italic;
}

.cw-message.bot blockquote {
  background: #f9fafb;
  border-left: 3px solid #DC2626;
  margin: 2px 0;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  color: #4b5563;
  font-style: italic;
  line-height: 1.3;
}

.cw-message.bot table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0;
  font-size: 13px;
}

.cw-message.bot th,
.cw-message.bot td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
  line-height: 1.3;
}

.cw-message.bot th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.cw-message.bot tr:nth-child(even) {
  background: #f9fafb;
}

.cw-message.bot hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 8px 0;
}

/* Remove default margins for first and last elements */
.cw-message.bot > *:first-child {
  margin-top: 0;
}

.cw-message.bot > *:last-child {
  margin-bottom: 0;
}

/* ===== GALLERY STYLES ===== */

/* Gallery container */
.cw-gallery-container {
  margin: 4px 0;
  padding: 6px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

/* Gallery thumbnails container */
.cw-gallery-thumbnails {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Webkit scrollbar for gallery */
.cw-gallery-thumbnails::-webkit-scrollbar {
  height: 4px;
}

.cw-gallery-thumbnails::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.cw-gallery-thumbnails::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}

.cw-gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Individual gallery thumbnail */
.cw-gallery-thumb {
  flex-shrink: 0;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
}

.cw-gallery-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cw-gallery-thumb img {
  display: block;
  transition: all 0.2s ease;
}

.cw-gallery-thumb:hover img {
  filter: brightness(1.1);
}

/* Gallery count text */
.cw-gallery-count {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Gallery modal overlay */
.gallery-modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.2s;
}

/* Gallery navigation buttons */
.gallery-nav-prev,
.gallery-nav-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 24px;
  padding: 12px 16px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.gallery-nav-prev {
  left: 32px;
}

.gallery-nav-next {
  right: 32px;
}

.gallery-nav-prev:hover,
.gallery-nav-next:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

/* Gallery modal content */
.gallery-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.gallery-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  background: white;
}

/* Gallery modal caption */
.gallery-modal-caption {
  color: white;
  text-align: center;
  margin-top: 16px;
  font-size: 16px;
  max-width: 500px;
  line-height: 1.4;
}

/* Gallery modal counter */
.gallery-modal-counter {
  color: #ccc;
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
}

/* Gallery modal close button */
.gallery-modal-close {
  position: absolute;
  top: 32px;
  right: 48px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.gallery-modal-close:hover {
  color: #DC2626;
  transform: scale(1.1);
}

/* Mobile responsive gallery styles */
@media (max-width: 480px) {
  .cw-gallery-thumbnails {
    gap: 4px;
  }
  
  .cw-gallery-thumb img {
    width: 50px;
    height: 50px;
  }
  
  .gallery-nav-prev,
  .gallery-nav-next {
    padding: 8px 12px;
    font-size: 20px;
  }
  
  .gallery-nav-prev {
    left: 16px;
  }
  
  .gallery-nav-next {
    right: 16px;
  }
  
  .gallery-modal-close {
    top: 16px;
    right: 24px;
    font-size: 32px;
  }
  
  .gallery-modal-caption {
    font-size: 14px;
    padding: 0 16px;
  }
}


@media (max-height: 600px) {
  .cw-chat-content {
    padding: 12px;
  }
  
  .cw-chat-footer {
    padding: 12px;
  }
}

/* ====================================
   QUICK REPLY BUTTONS
   ==================================== */

.cw-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 8px 0;
  margin: 0 16px 12px 16px;
  animation: slideInUp 0.3s ease-out;
  position: relative;
  background: linear-gradient(to bottom, rgba(248, 249, 250, 0.3), rgba(248, 249, 250, 0));
  border-radius: 0;
  border: none;
  max-width: calc(80% - 32px);
}

.cw-quick-replies-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 2px;
  margin-top: -8px;
  padding: 0 4px;
  min-height: 20px;
}

.cw-quick-replies-close {
  background: transparent;
  border: none;
  color: #adb5bd;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  transition: all 0.2s ease;
  border-radius: 4px;
  font-weight: 300;
  opacity: 0.5;
}

.cw-quick-replies-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #6c757d;
  opacity: 1;
}

.cw-quick-replies-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Fullscreen mode: кнопки в несколько колонок (только на десктопе) */
@media (min-width: 768px) {
  .cw-chat-window.cw-fullscreen .cw-quick-replies-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
  }
}

.cw-quick-reply-btn {
  /* Премиальный стиль для риелторского агентства */
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}

/* Fullscreen mode: кнопки чуть больше */
.cw-chat-window.cw-fullscreen .cw-quick-reply-btn {
  padding: 14px 20px;
  font-size: 15px;
}

.cw-quick-reply-btn:hover {
  transform: translateY(-1px);
  background: #fafafa;
  border-color: #9ca3af;
  color: #111827;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.cw-quick-reply-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.cw-quick-reply-btn.used {
  opacity: 0.5;
  pointer-events: none;
  background: #e0e0e0;
  color: #999;
}

/* Link buttons - визуально отличаются */
.cw-quick-reply-btn.cw-quick-reply-link {
  position: relative;
  padding-right: 32px;
}

.cw-quick-reply-btn.cw-quick-reply-link::after {
  content: '↗';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.cw-quick-reply-btn.cw-quick-reply-link:hover::after {
  opacity: 1;
  transform: translateY(-50%) translate(2px, -2px);
}

/* Link buttons при использовании не блокируются полностью */
.cw-quick-reply-btn.cw-quick-reply-link.used {
  opacity: 0.7;
  pointer-events: auto;
  background: #f0f0f0;
  color: #666;
}

.cw-quick-replies-footer {
  margin-top: 4px;
  padding: 4px 0 0 0;
}

.cw-load-more-btn {
  background: transparent;
  color: #adb5bd;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  opacity: 0.7;
}

.cw-load-more-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  color: #6c757d;
  opacity: 1;
}

.cw-load-more-btn svg {
  transition: transform 0.2s ease;
  width: 14px;
  height: 14px;
}

.cw-load-more-btn:hover svg {
  transform: translateY(2px);
}

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



/* ====================================
   GDPR CONSENT BANNER & MODAL
   ==================================== */

/* GDPR Banner - fixed at bottom of page */
.cw-gdpr-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to right, #ffffff, #fefefe);
  border-top: 2px solid #DC2626;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  padding: 20px;
  opacity: 0;
  transform: translateY(100%);
  animation: gdprSlideIn 0.4s ease-out forwards;
  transition: all 0.3s ease;
}

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

.cw-gdpr-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cw-gdpr-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-gdpr-title::before {
  content: '🍪';
  font-size: 24px;
}

.cw-gdpr-message {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

.cw-gdpr-privacy-link {
  color: #DC2626;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.cw-gdpr-privacy-link:hover {
  color: #B91C1C;
}

.cw-gdpr-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cw-gdpr-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.cw-gdpr-btn-primary {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  color: white;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.cw-gdpr-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.cw-gdpr-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #d1d5db;
}

.cw-gdpr-btn-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.cw-gdpr-btn-text {
  background: transparent;
  color: #6b7280;
  padding: 12px 16px;
  text-decoration: underline;
}

.cw-gdpr-btn-text:hover {
  color: #374151;
  background: rgba(0, 0, 0, 0.05);
}

/* GDPR Customization Modal */
.cw-gdpr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cw-gdpr-modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalScaleIn 0.3s ease-out;
}

@keyframes modalScaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.cw-gdpr-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #fefefe, #f9fafb);
}

.cw-gdpr-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.cw-gdpr-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.cw-gdpr-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.cw-gdpr-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.cw-gdpr-option {
  margin-bottom: 20px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.cw-gdpr-option:hover {
  border-color: #DC2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.cw-gdpr-option-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.cw-gdpr-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #DC2626;
}

.cw-gdpr-option input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.cw-gdpr-option label {
  font-size: 15px;
  color: #111827;
  cursor: pointer;
  flex: 1;
}

.cw-gdpr-option-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
  padding-left: 32px;
}

.cw-gdpr-retention {
  margin-top: 16px;
  padding: 12px;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.cw-gdpr-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f9fafb;
}

/* Mobile responsive styles for GDPR */
@media (max-width: 768px) {
  .cw-gdpr-banner {
    padding: 16px;
  }

  .cw-gdpr-title {
    font-size: 16px;
  }

  .cw-gdpr-message {
    font-size: 13px;
  }

  .cw-gdpr-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cw-gdpr-btn {
    width: 100%;
    justify-content: center;
  }

  .cw-gdpr-modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .cw-gdpr-modal-header,
  .cw-gdpr-modal-body,
  .cw-gdpr-modal-footer {
    padding: 16px;
  }
}

/* Persistent Menu Styles */
.cw-persistent-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 8px;
  min-width: 200px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 100;
}

.cw-persistent-menu.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cw-persistent-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cw-persistent-menu-items {
  padding: 8px 0;
}

.cw-persistent-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.cw-persistent-menu-item:hover {
  background: #f3f4f6;
  color: #DC2626;
}

.cw-persistent-menu-item .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.cw-persistent-menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

/* Menu toggle button in footer */
.cw-menu-toggle {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.cw-menu-toggle:hover {
  background: #f3f4f6;
  color: #374151;
}

.cw-menu-toggle.active {
  background: #DC2626;
  color: white;
}

/* Add menu button to input wrapper */
.cw-input-wrapper {
  position: relative;
}

.cw-footer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
