:root {
  --cw-brand: #b40e19;
  --cw-fab-bg: #b40e19;
  --cw-fab-fg: #ffffff;
  --cw-panel-bg: #ffffff;
  --cw-panel-fg: #101828;
  --cw-border: rgba(16, 24, 40, 0.08);
  --cw-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  --cw-radius: 16px;
  --cw-z: 2147483000;
}

/* Floating Action Button */
.cw-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: var(--cw-z);
  height: 56px;
  width: 56px;
  border: none;
  border-radius: 50%;
  background: var(--cw-fab-bg);
  color: var(--cw-fab-fg);
  box-shadow: var(--cw-shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
  outline: none;
}

button.cw-fab:focus {
  outline: 2px solid var(--cw-brand) !important;
}

.cw-fab:hover {
  transform: translateY(-2px) scale(1.02);
}

.cw-fab:active {
  transform: translateY(0) scale(0.98);
}

/* Panel */
.cw-panel {
  position: fixed;
  bottom: 92px;
  right: 20px;
  z-index: var(--cw-z);
  width: min(420px, 92vw);
  height: min(700px, 86vh);
  background: var(--cw-panel-bg);
  color: #fff;
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.cw-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.cw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px;
  background: #b40e19;
}

.cw-title {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.2px;
}

.cw-close {
  color: white;
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
}

.cw-close:hover {
  background: rgba(16, 24, 40, 0.06);
}

.cw-close:focus {
  outline: 2px solid white !important;
  outline-offset: 2px;
}

.cw-close:focus-visible {
  outline: 2px solid var(--cw-brand);
  outline-offset: 2px;
}

/* Iframe container */
.cw-body {
  position: relative;
  background: var(--cw-panel-bg);
}

.cw-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0b0f15;
}

/* Mobile */
@media (max-width: 480px) {
  .cw-panel {
    inset: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    bottom: 0;
    right: 0;
    resize: none;
  }

	.chat-header {
    border-radius: unset;
	}
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

  .cw-overlay,
  .cw-panel {
    transition: none !important;
  }

  .cw-fab {
    transition: none !important;
  }
}