.caw-widget {
  --caw-navy: #251F4F;
  --caw-navy-light: #342A6B;
  --caw-amber: #F3920D;
  --caw-cream: #FAF8F3;
  --caw-text: #1C1B2E;
  --caw-white: #FFFFFF;
  --caw-shadow: 0 12px 40px rgba(37,31,79,0.18);
  font-family: "Open Sans", sans-serif;
  line-height: 1.4;
}

.caw-widget *,
.caw-widget *::before,
.caw-widget *::after {
  box-sizing: border-box;
}

.caw-launcher {
  align-items: center;
  background: var(--caw-amber);
  border: 2px solid var(--caw-navy);
  border-radius: 50%;
  bottom: 24px;
  color: var(--caw-white);
  cursor: pointer;
  display: flex;
  height: 56px;
  justify-content: center;
  padding: 0;
  position: fixed;
  right: 24px;
  transition: transform 0.2s ease, background 0.2s ease;
  width: 56px;
  z-index: 1001;
}

.caw-launcher:hover {
  transform: scale(1.08);
}

.caw-launcher:focus-visible,
.caw-close:focus-visible,
.caw-send:focus-visible,
.caw-input:focus-visible,
.caw-source:focus-visible {
  outline: 3px solid var(--caw-amber);
  outline-offset: 2px;
}

.caw-launcher svg {
  height: 28px;
  width: 28px;
}

.caw-panel {
  background: var(--caw-cream);
  border-radius: 12px;
  bottom: 24px;
  box-shadow: var(--caw-shadow);
  display: flex;
  flex-direction: column;
  height: 520px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  right: 24px;
  transform: translateY(16px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  visibility: hidden;
  width: 380px;
  z-index: 1000;
}

.caw-panel--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.caw-header {
  align-items: flex-start;
  background: var(--caw-navy);
  color: var(--caw-white);
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  min-height: 82px;
  padding: 18px 16px;
}

.caw-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.caw-subtitle {
  color: var(--caw-amber);
  font-family: "Open Sans", sans-serif;
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 4px 0 0;
}

.caw-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--caw-white);
  cursor: pointer;
  display: flex;
  height: 32px;
  justify-content: center;
  margin: -4px -4px 0 12px;
  padding: 0;
  width: 32px;
}

.caw-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.caw-close svg {
  height: 21px;
  width: 21px;
}

.caw-messages {
  background: var(--caw-cream);
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
}

.caw-message {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.caw-message--user {
  align-self: flex-end;
  align-items: flex-end;
}

.caw-message--bot {
  align-self: flex-start;
  align-items: flex-start;
}

.caw-bubble {
  border-radius: 20px;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 10px 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.caw-message--user .caw-bubble {
  background: var(--caw-amber);
  color: var(--caw-navy);
  font-family: "Montserrat", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
}

.caw-message--bot .caw-bubble {
  background: var(--caw-white);
  color: var(--caw-navy);
  font-family: "Open Sans", sans-serif;
}

.caw-loading {
  align-items: center;
  display: flex;
  gap: 4px;
  min-height: 38px;
}

.caw-loading span {
  animation: caw-bounce 1.2s infinite ease-in-out;
  background: var(--caw-navy);
  border-radius: 50%;
  display: block;
  height: 6px;
  width: 6px;
}

.caw-loading span:nth-child(2) {
  animation-delay: 0.15s;
}

.caw-loading span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes caw-bounce {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.caw-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.caw-source {
  border: 1px solid var(--caw-amber);
  border-radius: 6px;
  color: var(--caw-navy);
  font-family: "Open Sans", sans-serif;
  font-size: 0.6875rem;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 7px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caw-source:hover {
  background: var(--caw-amber);
}

.caw-input-area {
  align-items: center;
  background: var(--caw-white);
  border-top: 1px solid rgba(37, 31, 79, 0.2);
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding: 12px;
}

.caw-input {
  background: var(--caw-white);
  border: 1px solid rgba(37, 31, 79, 0.25);
  border-radius: 6px;
  color: var(--caw-text);
  flex: 1;
  font-family: "Open Sans", sans-serif;
  font-size: 0.875rem;
  min-width: 0;
  padding: 10px 11px;
}

.caw-input::placeholder {
  color: rgba(28, 27, 46, 0.55);
}

.caw-input:focus {
  border-color: var(--caw-navy-light);
  outline: none;
}

.caw-send {
  background: var(--caw-amber);
  border: 0;
  border-radius: 6px;
  color: var(--caw-navy);
  cursor: pointer;
  flex-shrink: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 11px 14px;
  transition: background 0.2s ease;
}

.caw-send:hover {
  background: #D97D08;
}

.caw-sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 479px) {
  .caw-launcher {
    bottom: 16px;
    right: 16px;
  }

  .caw-panel {
    border-radius: 0;
    bottom: 0;
    height: 100dvh;
    right: 0;
    transform: translateY(16px);
    width: 100%;
  }

  .caw-panel--open {
    transform: translateY(0);
  }
}
