.cw-widget-wrapper, .cw-window {
  --color-blue-100: #265aa6;
  --color-blue-200: #16295b;
  --color-blue-300: #2271b1;
  --color-blue-400: #0a4b78;
  --color-blue-grad-1: #1e3a8a;
  --color-blue-grad-2: #3b82f6;
  --color-purple-grad-1: #6366f1;
  --color-purple-grad-2: #8b5cf6;
  --color-grey-010: #f8f8f8;
  --color-grey-050: #f8f9fa;
  --color-grey-100: #f0f0f0;
  --color-grey-150: #eaeaea;
  --color-grey-200: #ababab;
  --color-grey-300: #626570;
  --color-grey-400: #464646;
  --color-grey-500: #333333;
  --color-grey-600: #555555;
  --color-grey-700: #666666;
  --color-grey-800: #999999;
  --color-grey-text: #9ca3af;
  --color-grey-text-light: #a0a0a0;
  --color-grey-border: #e5e7eb;
  --color-grey-border-light: #e0e0e0;
  --color-grey-border-alt: #e1e8ed;
  --color-grey-bg: #e9ecef;
  --color-grey-scroll: #d1d5db;
  --color-grey-dot: #cbd5e1;
  --color-text-dark: #1a1a1a;
  --color-black: #000000;
  --color-white: #ffffff;
  --color-green: #4ade80;
  --color-red: #ef4444;
}

.cw-widget-wrapper {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cw-floating-btn {
  height: 50px;
  padding: 0 20px;
  background: var(--color-blue-200);
  color: var(--color-white);
  border: 1px solid var(--color-white, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.cw-floating-btn:hover {
  transform: scale(1.05);
  animation: none;
}

.cw-floating-btn svg {
  width: 24px;
  height: 24px;
  transform-origin: center bottom;
  animation: cw-robot-wiggle 4s ease-in-out infinite;
}

.cw-floating-btn:hover svg {
  animation: cw-robot-wiggle 1s ease-in-out infinite;
}

.cw-icon-close {
  display: none;
}

.cw-floating-btn.is-active .cw-icon-open {
  display: none;
}

.cw-floating-btn.is-active .cw-icon-close {
  display: block;
  animation: cw-fade-in 0.2s ease-in-out;
}

.cw-window {
  position: fixed;
  bottom: 80px;
  left: 20px;
  max-width: 420px;
  height: 700px;
  background: var(--color-white);
  border: 1px solid var(--color-blue-200);
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease, visibility 0s linear 0.3s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Roboto", sans-serif;
}

.cw-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease, visibility 0s linear 0s;
}

.cw-window.is-expanded {
  width: 90vw;
  max-width: 1000px;
  height: 85vh;
  bottom: auto;
  right: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.cw-header {
  background: linear-gradient(135deg, var(--color-blue-grad-1) 0%, var(--color-blue-grad-2) 100%);
  color: var(--color-white);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.cw-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.cw-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}

.cw-brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cw-brand-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-white);
  transition: transform 0.2s;
  display: block;
}

.cw-brand-icon svg.is-jumping {
  animation: cw-bounce 0.6s ease-in-out;
  color: var(--color-blue-200);
}

.cw-header-info {
  display: flex;
  flex-direction: column;
}

.cw-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cw-status-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cw-status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: cw-status-pulse 2s infinite;
}

.cw-status-text {
  font-size: 11px;
  opacity: 0.9;
  font-weight: 400;
}

.cw-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.cw-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--color-white);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.cw-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.cw-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
}

.cw-icon-collapse {
  display: none;
}

.cw-window.is-expanded .cw-icon-expand {
  display: none;
}

.cw-window.is-expanded .cw-icon-collapse {
  display: block;
}

.cw-content-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.cw-content {
  flex: 1;
  padding: 10px 15px;
  overflow-y: auto;
  background-image: radial-gradient(var(--color-grey-dot) 1px, transparent 1px);
  background-size: 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.cw-date-divider {
  text-align: center;
  font-size: 11px;
  color: var(--color-grey-text);
  background: rgba(0, 0, 0, 0.03);
  align-self: center;
  padding: 2px 10px;
  font-weight: 500;
}

.cw-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.cw-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
  align-items: flex-end;
  animation: cw-msg-slide-up 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  opacity: 0;
  transform: translateY(10px);
  border-radius: 10px;
}

.cw-msg:nth-child(2) {
  animation-delay: 0.1s;
}

.cw-msg:nth-child(3) {
  animation-delay: 0.2s;
}

.cw-avatar {
  width: 32px;
  height: 32px;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--color-grey-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  animation: cw-ai-thinking 3s ease-in-out infinite;
  z-index: 1;
  color: var(--color-blue-100);
  border-radius: 50%;
  pointer-events: none;
}

.cw-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  padding: 5px;
  border-radius: 50%;
}

.cw-text {
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  gap: 2px;
  min-width: 60px;
  border-radius: 15px;
}

.cw-warning {
  width: fit-content;
  white-space: initial;
  word-wrap: normal;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
}

.cw-msg-bot .cw-text {
  background: var(--color-white);
  border: 1px solid var(--color-grey-border);
  color: var(--color-grey-400);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cw-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.cw-msg-user .cw-text {
  background: var(--color-blue-100);
  color: var(--color-white);
  box-shadow: 0 2px 5px rgba(38, 90, 166, 0.2);
}

.cw-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10px;
  margin-top: 6px;
  opacity: 0.7;
  font-weight: 500;
  line-height: 1;
}

.cw-checks {
  display: flex;
  color: var(--color-green);
}

.cw-typing-wrapper {
  animation-delay: 0.4s;
}

.cw-typing {
  background: var(--color-white);
  border: 1px solid var(--color-grey-border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  border-radius: 15px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  width: fit-content;
  min-height: 38px;
}

.cw-typing-text {
  font-size: 13px;
  color: var(--color-grey-text-light);
  font-style: italic;
  font-weight: 500;
  animation: fadeText 0.3s ease-in-out;
}

.cw-dot {
  width: 6px;
  height: 6px;
  background: var(--color-blue-100);
  border-radius: 50%;
  animation: cw-typing-bounce 1.4s infinite ease-in-out both;
}

.cw-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.cw-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.cw-suggestions {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 10px 15px;
  background: var(--color-white);
  border-top: 1px solid var(--color-grey-100);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: var(--color-grey-scroll) transparent;
  z-index: 5;
  -webkit-overflow-scrolling: touch;
}

.cw-suggestions::-webkit-scrollbar {
  height: 6px;
}

.cw-suggestions::-webkit-scrollbar-track {
  background: transparent;
}

.cw-suggestions::-webkit-scrollbar-thumb {
  background-color: var(--color-grey-scroll);
}

.cw-suggestions.is-dragging {
  cursor: grabbing;
}

.cw-chip {
  flex: 0 0 auto;
  background: var(--color-white);
  border: 1px solid var(--color-grey-border);
  color: var(--color-blue-100);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  user-select: none;
}

.cw-chip:hover {
  background: var(--color-blue-100);
  color: var(--color-white);
  border-color: var(--color-blue-100);
  transform: translateY(-1px);
}

.cw-footer {
  padding: 12px 15px;
  background: var(--color-white);
  border-top: 1px solid var(--color-grey-150);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.cw-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
}

.cw-input-group {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-white);
  border: 1px solid var(--color-grey-border-light);
  transition: all 0.2s ease;
}

.cw-input-group:focus-within {
  border-color: var(--color-blue-100);
  box-shadow: 0 0 0 3px rgba(38, 90, 166, 0.1);
}

.cw-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 44px 10px 14px;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;
  font-size: 14px;
  outline: none;
  color: var(--color-black);
  font-family: inherit;
  line-height: 1.4;
}

.cw-input::placeholder {
  color: var(--color-grey-800);
  font-weight: 400;
  font-size: 12px;
}

.cw-input-action-btn {
  position: absolute;
  right: 6px;
  bottom: 4px;
  background: none;
  border: none;
  color: var(--color-grey-text);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.cw-input-action-btn:hover {
  color: var(--color-blue-100);
  background: rgba(38, 90, 166, 0.05);
}

.cw-input-action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(239, 68, 68, 0.15);
  z-index: -1;
  border-radius: 50%;
  transform: scale(var(--mic-scale, 0));
  transition: transform 0.05s linear;
  opacity: 0;
}

.cw-input-action-btn.is-recording {
  color: var(--color-red);
  background: transparent;
}

.cw-input-action-btn.is-recording::before {
  opacity: 1;
}

.cw-input-action-btn svg {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 2;
}

.cw-send-btn {
  background: var(--color-blue-100);
  color: var(--color-white);
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cw-send-btn:hover {
  background: var(--color-blue-200);
  transform: translateY(-1px);
}

.cw-send-btn:active {
  transform: translateY(1px);
}

.cw-send-btn svg {
  width: 18px;
  height: 18px;
  margin-left: -2px;
  margin-top: 2px;
}

.cw-stop-btn {
  background: var(--color-grey-150);
  color: var(--color-grey-600);
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cw-stop-btn:hover {
  background: var(--color-red);
  color: var(--color-white);
}

.cw-char-counter {
  font-size: 11px;
  color: var(--color-grey-text-light);
  text-align: right;
  margin-top: -6px;
}

.cw-ai-loading-text {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--color-purple-grad-1) 0%, var(--color-purple-grad-2) 100%);
  color: var(--color-white);
  font-size: 0.85em;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  opacity: 0;
  transform: translateY(5px);
  animation: cwFadeIn 0.4s ease-out forwards, cwPulse 2s infinite ease-in-out;
}

.cw-typing-text {
  animation: fadeText 0.3s ease-in-out;
}

.cw-copy-btn {
  position: absolute;
  top: 0;
  right: -25px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-grey-text-light);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cw-msg-bot:hover .cw-copy-btn,
.cw-msg-bot .cw-copy-btn:focus {
  opacity: 1;
}

.cw-copy-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-blue-100);
}

.cw-disclaimer {
  width: 100%;
  font-size: 11px;
  color: var(--color-grey-text-light);
  text-align: center;
  margin-top: 2px;
  line-height: 1.4;
  pointer-events: none;
}

.cw-input:disabled {
  background: var(--color-grey-050);
  cursor: not-allowed;
  opacity: 0.7;
}

.cw-send-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.5;
}

.cw-formatted-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-grey-500);
  word-wrap: break-word;
}

.cw-formatted-text strong {
  color: var(--color-text-dark);
  font-weight: 600;
}

.cw-label {
  font-weight: 600;
  color: var(--color-text-dark);
  margin-right: 5px;
  font-size: 13px;
  display: inline-block;
  margin-bottom: 4px;
}

.cw-list {
  margin: 14px 0;
  padding-left: 0;
  list-style: none !important;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cw-list-item {
  position: relative;
  line-height: 1.6;
}

.cw-spacer {
  height: 8px;
  width: 100%;
}

.cw-sources-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--color-grey-border-alt);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-grey-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cw-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-blue-300);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  word-break: break-word;
}

.cw-link:hover {
  color: var(--color-blue-400);
  text-decoration: underline;
}

.cw-link-icon {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.cw-mode-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.cw-mode-label {
  font-size: 13px;
  color: var(--color-grey-700);
  font-weight: 500;
  flex-shrink: 0;
}

.cw-toggle {
  display: flex;
  position: relative;
  padding: 4px;
  width: 100%;
  border: 1px solid var(--color-grey-border-light);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cw-toggle input {
  display: none;
}

.cw-toggle label {
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-grey-600);
  transition: color 0.25s ease-in-out;
  user-select: none;
}

.cw-toggle input:checked + label {
  color: var(--color-white);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.cw-toggle-bg {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--color-blue-100);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  box-shadow: 0 2px 5px rgba(38, 90, 166, 0.3);
}

.cw-toggle input[value="docs"]:checked ~ .cw-toggle-bg {
  transform: translateX(100%);
}

.cw-docs-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 85%;
  background: var(--color-grey-050);
  border-top: 1px solid var(--color-grey-border-light);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.cw-docs-panel.is-open {
  transform: translateY(0);
}

.cw-docs-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--color-grey-border-light);
  background: var(--color-white);
}

.cw-docs-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text-dark);
}

.cw-docs-header .cw-action-btn {
  color: var(--color-grey-600);
}

.cw-docs-header .cw-action-btn:hover {
  background: var(--color-grey-100);
  color: var(--color-black);
}

.cw-docs-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cw-doc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-white);
  border: 1px solid var(--color-grey-border);
  text-decoration: none;
  color: var(--color-text-dark);
  transition: all 0.2s ease;
}

.cw-doc-item:hover {
  border-color: var(--color-blue-100);
  box-shadow: 0 4px 12px rgba(38, 90, 166, 0.08);
  transform: translateY(-2px);
}

.cw-doc-icon {
  width: 36px;
  height: 36px;
  background: var(--color-blue-100);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cw-doc-info {
  flex: 1;
  min-width: 0;
}

.cw-doc-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.cw-doc-size {
  font-size: 12px;
  color: var(--color-grey-text);
}

.cw-docs-loading, .cw-docs-empty {
  text-align: center;
  padding: 40px;
  color: var(--color-grey-600);
  font-size: 14px;
}

@keyframes cw-pulse {
  0% { box-shadow: 0 0 0 0 rgba(38, 90, 166, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(38, 90, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(38, 90, 166, 0); }
}

@keyframes cw-robot-wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  5% { transform: rotate(-15deg) scale(1.1); }
  10% { transform: rotate(15deg) scale(1.1); }
  15% { transform: rotate(-10deg) scale(1.1); }
  20% { transform: rotate(5deg) scale(1.1); }
  25% { transform: rotate(0deg) scale(1); }
}

@keyframes cw-ai-thinking {
  0% { transform: scale(1); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); }
  50% { transform: scale(1.05); box-shadow: 0 4px 12px rgba(38, 90, 166, 0.15); }
  100% { transform: scale(1); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); }
}

@keyframes cw-status-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@keyframes cw-msg-slide-up {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cw-typing-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes cw-fade-in {
  from { opacity: 0; transform: rotate(-90deg); }
  to { opacity: 1; transform: rotate(0); }
}

@keyframes cwFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cwPulse {
  0% { box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); }
  50% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5); }
  100% { box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); }
}

@keyframes fadeText {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cw-bounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-10px) scale(0.9, 1.1); }
  50% { transform: translateY(0) scale(1.1, 0.9); }
  75% { transform: translateY(-3px) scale(0.95, 1.05); }
}

@media (max-width: 768px) {
  .cw-copy-btn { opacity: 0.7; }
}

@media (max-width: 600px) {
  .cw-widget-wrapper {
    bottom: max(15px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    align-items: flex-start;
  }

  .cw-floating-btn {
    width: 46px;
    height: 46px;
    padding: 0;
  }

  .cw-btn-text {
    display: none;
  }

  .cw-window,
  .cw-window.is-expanded {
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    height: calc(var(--cw-vh, 1vh) * 100) !important;
    max-width: none;
    max-height: none;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: none;
    transform: translateY(100%);
  }

  .cw-window.is-open {
    transform: translateY(0) !important;
  }

  .js-expand-cw {
    display: none !important;
  }

  .cw-header {
    padding-top: max(24px, env(safe-area-inset-top));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .cw-header::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
  }

  .cw-footer {
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
  }

  .cw-docs-header {
    position: relative;
    padding-top: 24px;
  }

  .cw-docs-header::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
  }

  .cw-input { font-size: 16px; }
}

.cw-corner-ribbon {
    position: absolute;
    top: 30px;
    right: -35px;
    background-color: #28a745;
    color: #ffffff;
    padding: 4px 40px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    transform: rotate(45deg);
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    letter-spacing: 1px;
}