:root {
  --cbsdk-bg: #f3e4d5;
  --cbsdk-panel: rgba(255, 252, 247, 0.95);
  --cbsdk-panel-strong: #fffefb;
  --cbsdk-border: rgba(132, 93, 58, 0.16);
  --cbsdk-text: #1f1711;
  --cbsdk-muted: #736153;
  --cbsdk-brand: #b85c38;
  --cbsdk-brand-rgb: 184, 92, 56;
  --cbsdk-brand-dark: #8f4427;
  --cbsdk-brand-dark-rgb: 143, 68, 39;
  --cbsdk-brand-bright: #c56641;
  --cbsdk-brand-soft: #f5ddcf;
  --cbsdk-brand-soft-rgb: 245, 221, 207;
  --cbsdk-brand-wash: rgba(184, 92, 56, 0.12);
  --cbsdk-user: linear-gradient(135deg, #2f2722 0%, #1d1713 100%);
  --cbsdk-user-text: #fff9f2;
  --cbsdk-shadow: 0 28px 80px rgba(57, 33, 15, 0.18);
  --cbsdk-shadow-soft: 0 16px 40px rgba(57, 33, 15, 0.08);
}

.cbsdk,
.cbsdk * {
  box-sizing: border-box;
}

.cbsdk {
  position: relative;
  color: var(--cbsdk-text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.cbsdk--full {
  width: min(100%, 460px);
  height: min(700px, calc(100vh - 64px));
}

.cbsdk--popup {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(92vw, 420px);
  min-height: 88px;
  z-index: 9999;
}

.cbsdk__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--cbsdk-border);
  border-radius: 32px;
  background:
    radial-gradient(circle at top left, rgba(var(--cbsdk-brand-rgb), 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(var(--cbsdk-brand-soft-rgb), 0.42), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, var(--cbsdk-panel) 100%);
  box-shadow: var(--cbsdk-shadow);
  backdrop-filter: blur(16px);
}

.cbsdk--full .cbsdk__panel {
  height: 100%;
}

.cbsdk--popup .cbsdk__panel {
  position: absolute;
  right: 0;
  bottom: 84px;
  width: 100%;
  height: 700px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.cbsdk--popup[data-open="true"] .cbsdk__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.cbsdk__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(132, 93, 58, 0.1);
}

.cbsdk__header-copy {
  min-width: 0;
}

.cbsdk__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cbsdk-muted);
}

.cbsdk__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.cbsdk__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cbsdk__subtitle {
  margin-top: 8px;
  max-width: 32ch;
  color: var(--cbsdk-muted);
  font-size: 13px;
  line-height: 1.45;
}

.cbsdk__status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(107, 154, 90, 0.2);
  border-radius: 999px;
  background: rgba(235, 246, 230, 0.9);
  color: #47673d;
  font-size: 12px;
  font-weight: 600;
}

.cbsdk__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #5ba055;
  box-shadow: 0 0 0 4px rgba(91, 160, 85, 0.16);
}

.cbsdk__header-action,
.cbsdk__launcher,
.cbsdk__send,
.cbsdk__action,
.cbsdk__quick-reply {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.cbsdk__header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(var(--cbsdk-brand-rgb), 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--cbsdk-brand-dark);
}

.cbsdk__header-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.cbsdk__header-action-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.cbsdk__messages {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255, 249, 242, 0.35) 0%, rgba(244, 233, 219, 0.68) 100%);
}

.cbsdk__welcome {
  padding: 18px 18px 16px;
  border: 1px solid rgba(var(--cbsdk-brand-rgb), 0.12);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(var(--cbsdk-brand-rgb), 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 247, 240, 0.95) 100%);
  box-shadow: var(--cbsdk-shadow-soft);
}

.cbsdk__welcome-label {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(var(--cbsdk-brand-rgb), 0.1);
  color: var(--cbsdk-brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.cbsdk__welcome-title {
  margin-top: 14px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cbsdk__welcome-copy {
  margin-top: 8px;
  color: var(--cbsdk-muted);
  font-size: 14px;
  line-height: 1.55;
}

.cbsdk__welcome-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.cbsdk__welcome-highlights span {
  padding: 8px 11px;
  border: 1px solid rgba(132, 93, 58, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  color: var(--cbsdk-muted);
}

.cbsdk__message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.cbsdk__message-row--user {
  justify-content: flex-end;
}

.cbsdk__message-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cbsdk__message-row--user .cbsdk__message-content {
  align-items: flex-end;
}

.cbsdk__message-meta {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cbsdk__message-meta--user {
  color: rgba(31, 23, 17, 0.56);
}

.cbsdk__message-meta--bot,
.cbsdk__message-meta--system {
  color: var(--cbsdk-muted);
}

.cbsdk__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.cbsdk__avatar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.cbsdk__avatar-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.cbsdk__avatar--bot {
  background: linear-gradient(135deg, var(--cbsdk-brand-bright) 0%, var(--cbsdk-brand-dark) 100%);
  color: #fff7f1;
  box-shadow: 0 12px 24px rgba(var(--cbsdk-brand-dark-rgb), 0.24);
}

.cbsdk__avatar--system {
  background: rgba(115, 97, 83, 0.12);
  color: var(--cbsdk-muted);
}

.cbsdk__bubble {
  max-width: min(100%, 320px);
  padding: 13px 15px;
  border-radius: 20px;
  line-height: 1.5;
  white-space: pre-wrap;
  font-size: 14px;
}

.cbsdk__bubble--user {
  /* background: var(--cbsdk-user);
  color: var(--cbsdk-user-text); */
  border-bottom-right-radius: 7px;
  box-shadow: 0 18px 32px rgba(31, 23, 17, 0.16);
}

.cbsdk__bubble--bot {
  background: linear-gradient(135deg, var(--cbsdk-brand-bright) 0%, var(--cbsdk-brand-dark) 100%);
  color: #fff8f2;
  border: 1px solid rgba(var(--cbsdk-brand-dark-rgb), 0.18);
  border-bottom-left-radius: 7px;
  box-shadow: 0 16px 28px rgba(var(--cbsdk-brand-dark-rgb), 0.16);
}

.cbsdk__bubble--typing,
.cbsdk__bubble--system {
  background: rgba(255, 255, 255, 0.92);
  color: var(--cbsdk-text);
  border: 1px solid rgba(132, 93, 58, 0.12);
  border-bottom-left-radius: 7px;
  box-shadow: var(--cbsdk-shadow-soft);
}

.cbsdk__bubble--typing {
  color: var(--cbsdk-muted);
  font-style: italic;
}

.cbsdk__cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(248px, 268px);
  gap: 14px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.cbsdk__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(132, 93, 58, 0.14);
  border-radius: 26px;
  background: var(--cbsdk-panel-strong);
  box-shadow: var(--cbsdk-shadow-soft);
  scroll-snap-align: start;
  min-height: 430px;
}

.cbsdk__card-image {
  display: block;
  width: 100%;
  height: 172px;
  object-fit: cover;
  cursor: pointer;
}

.cbsdk__card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 172px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(var(--cbsdk-brand-rgb), 0.18), transparent 28%),
    linear-gradient(135deg, rgba(248, 231, 216, 0.92) 0%, rgba(244, 220, 199, 0.96) 100%);
  color: var(--cbsdk-brand-dark);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cbsdk__card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.cbsdk__card-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--cbsdk-brand-wash);
  color: var(--cbsdk-brand-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cbsdk__card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 44px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cbsdk__card-subtitle {
  min-height: 40px;
  color: var(--cbsdk-muted);
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cbsdk__card-price-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 20px;
}

.cbsdk__card-price-meta[data-empty="true"] {
  opacity: 0;
}

.cbsdk__card-price-label {
  color: var(--cbsdk-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.cbsdk__card-price-value {
  color: var(--cbsdk-brand-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: right;
}

.cbsdk__card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: auto;
  min-height: 39px;
}

.cbsdk__action,
.cbsdk__quick-reply,
.cbsdk__send,
.cbsdk__launcher,
.cbsdk__header-action {
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.cbsdk__action {
  padding: 8px 11px;
  border: 1px solid rgba(var(--cbsdk-brand-rgb), 0.14);
  border-radius: 12px;
  background: rgba(255, 250, 245, 0.96);
  color: var(--cbsdk-brand-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 8px 18px rgba(57, 33, 15, 0.06);
  width: 100%;
}

.cbsdk__quick-reply {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid rgba(var(--cbsdk-brand-rgb), 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--cbsdk-brand-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(57, 33, 15, 0.05);
}

.cbsdk__action:first-child {
  border-color: rgba(var(--cbsdk-brand-dark-rgb), 0.28);
  background: linear-gradient(135deg, var(--cbsdk-brand-bright) 0%, var(--cbsdk-brand-dark) 100%);
  color: #fff8f2;
  box-shadow: 0 12px 24px rgba(var(--cbsdk-brand-dark-rgb), 0.18);
}

.cbsdk__action:hover,
.cbsdk__quick-reply:hover,
.cbsdk__send:hover,
.cbsdk__launcher:hover,
.cbsdk__header-action:hover {
  transform: translateY(-1px);
}

.cbsdk__action:hover,
.cbsdk__quick-reply:hover,
.cbsdk__header-action:hover {
  box-shadow: 0 12px 22px rgba(57, 33, 15, 0.1);
  border-color: rgba(var(--cbsdk-brand-rgb), 0.24);
}

.cbsdk__footer {
  flex: 0 0 auto;
  padding: 0 18px 18px;
  border-top: 1px solid rgba(132, 93, 58, 0.1);
  background: linear-gradient(180deg, rgba(255, 249, 242, 0.35) 0%, rgba(255, 253, 249, 0.88) 100%);
}

.cbsdk__quick-replies {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 2px 12px;
}

.cbsdk__quick-replies[data-visible="false"] {
  display: none;
}

.cbsdk__quick-replies-label {
  color: var(--cbsdk-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cbsdk__quick-replies-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.cbsdk__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 0;
}

.cbsdk__input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid rgba(132, 93, 58, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  color: inherit;
  font: inherit;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.cbsdk__input:focus {
  border-color: var(--cbsdk-brand);
  box-shadow:
    0 0 0 4px rgba(var(--cbsdk-brand-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.cbsdk__send,
.cbsdk__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--cbsdk-brand-bright) 0%, var(--cbsdk-brand-dark) 100%);
  color: #fff8f2;
  box-shadow: 0 16px 32px rgba(var(--cbsdk-brand-dark-rgb), 0.24);
}

.cbsdk__send {
  min-width: 76px;
  min-height: 48px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
}

.cbsdk__launcher {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 999px;
  box-shadow:
    0 18px 32px rgba(var(--cbsdk-brand-dark-rgb), 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.cbsdk__launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.cbsdk__launcher-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.cbsdk__messages::-webkit-scrollbar,
.cbsdk__cards::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.cbsdk__messages::-webkit-scrollbar-thumb,
.cbsdk__cards::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(132, 93, 58, 0.22);
  background-clip: content-box;
}

.cbsdk__messages::-webkit-scrollbar-track,
.cbsdk__cards::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 640px) {
  .cbsdk--full {
    width: 100%;
    height: min(100vh - 32px, 760px);
  }

  .cbsdk--full .cbsdk__panel {
    height: 100%;
    border-radius: 28px;
  }

  .cbsdk--popup .cbsdk__panel {
    right: 0;
    width: 100%;
    height: min(78vh, 700px);
  }

  .cbsdk--popup {
    right: 12px;
    bottom: 12px;
    width: min(calc(100vw - 24px), 420px);
  }

  .cbsdk__header {
    padding: 20px 18px 16px;
  }

  .cbsdk__messages {
    padding: 18px 14px;
  }

  .cbsdk__footer {
    padding: 0 14px 14px;
  }

  .cbsdk__composer {
    grid-template-columns: 1fr;
  }

  .cbsdk__send {
    width: 100%;
  }

  .cbsdk__bubble {
    max-width: min(100%, 290px);
  }
}
