/* XB panel overlay — half-screen glass chat (design mode, no webhook required) */
.xb-cmw-panel {
  position: fixed;
  z-index: 999999;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease, visibility 280ms ease;
  font-family: "Manrope", system-ui, sans-serif;
}

.xb-cmw-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.xb-cmw-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 8, 0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.xb-cmw-panel__sheet {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: min(50vw, 720px);
  min-width: min(100vw, 360px);
  height: 100%;
  flex-direction: column;
  border-left: 1px solid rgba(242, 215, 149, 0.28);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 166, 90, 0.14), transparent 42%),
    rgba(9, 12, 13, 0.82);
  backdrop-filter: blur(28px) saturate(125%);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.35);
  transform: translateX(104%);
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.xb-cmw-panel.is-open .xb-cmw-panel__sheet {
  transform: translateX(0);
}

.xb-cmw-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(242, 215, 149, 0.16);
}

.xb-cmw-panel__head h2 {
  margin: 0;
  color: #f2d795;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.xb-cmw-panel__close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(242, 215, 149, 0.22);
  border-radius: 12px;
  color: #f2d795;
  background: rgba(255, 255, 255, 0.04);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.xb-cmw-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.xb-cmw-panel .cmw-widget-host,
.xb-cmw-panel .cmw-widget {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  --cmw-primary: #c9a65a !important;
  --cmw-header-bg: transparent !important;
  --cmw-header-text: #f8f4e9 !important;
  --cmw-widget-bg: transparent !important;
  --cmw-card-bg: transparent !important;
  --cmw-user-bubble-bg: rgba(201, 166, 90, 0.22) !important;
  --cmw-user-bubble-text: #f8f4e9 !important;
  --cmw-operator-bubble-bg: rgba(255, 255, 255, 0.07) !important;
  --cmw-operator-bubble-text: #f8f4e9 !important;
  --cmw-assistant-bubble-bg: rgba(255, 255, 255, 0.07) !important;
  --cmw-assistant-bubble-text: #f8f4e9 !important;
  --cmw-link-chip-bg: rgba(201, 166, 90, 0.14) !important;
  --cmw-link-chip-text: #f8f4e9 !important;
  --cmw-link-chip-border: rgba(242, 215, 149, 0.4) !important;
  --cmw-radius: 0 !important;
}

.xb-cmw-panel .cmw-widget__card {
  height: 100% !important;
  max-height: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.xb-cmw-panel .cmw-widget__header {
  display: none !important;
}

.xb-cmw-panel .cmw-widget__messages {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)), rgba(4, 8, 16, 0.35) !important;
  border: 0 !important;
}

.xb-cmw-panel .cmw-widget__composer {
  border-top: 1px solid rgba(242, 215, 149, 0.16) !important;
  background: rgba(8, 12, 13, 0.55) !important;
}

.xb-cmw-panel .cmw-widget__composer input,
.xb-cmw-panel .cmw-widget__composer textarea {
  color: #f8f4e9 !important;
  font-family: "Manrope", sans-serif !important;
}

.xb-cmw-panel .cmw-widget__composer button {
  background: linear-gradient(110deg, #8c6b2f, #f2d795 52%, #c9a65a) !important;
  color: #111414 !important;
  font-weight: 800 !important;
}

@media (max-width: 760px) {
  .xb-cmw-panel__sheet {
    width: 100vw;
    min-width: 0;
  }
}
