:root {
  --bc-chat-accent: #22c55e;
  --bc-chat-bg: #ffffff;
  --bc-chat-border: rgba(15, 23, 42, 0.12);
  --bc-chat-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
}

.bc-chat-root {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 2100;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.bc-chat-root.bc-chat--lifted {
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.bc-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--bc-chat-border);
  background: var(--bc-chat-bg);
  color: #0f172a;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  font-weight: 700;
  cursor: pointer;
}

.bc-chat-badge {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--bc-chat-accent);
}

.bc-chat-nudge {
  position: absolute;
  right: 0;
  bottom: 54px;
  max-width: 260px;
  background: #0f172a;
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  box-shadow: var(--bc-chat-shadow);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.bc-chat-nudge.bc-chat-nudge--show {
  opacity: 1;
  transform: translateY(0);
}

.bc-chat-panel {
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 140px));
  border-radius: 18px;
  border: 1px solid var(--bc-chat-border);
  background: var(--bc-chat-bg);
  box-shadow: var(--bc-chat-shadow);
  overflow: hidden;
  display: none;
}

.bc-chat-panel.bc-chat-panel--open {
  display: flex;
  flex-direction: column;
}

.bc-chat-head {
  background: var(--bc-chat-accent);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bc-chat-head-title {
  font-weight: 800;
  line-height: 1.1;
}

.bc-chat-head-sub {
  font-size: 12px;
  opacity: 0.9;
}

.bc-chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bc-chat-icon-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
}

.bc-chat-body {
  background: #e7f7ee;
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bc-chat-msg {
  max-width: 85%;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.05);
  white-space: pre-wrap;
  word-break: break-word;
}

.bc-chat-msg--user {
  align-self: flex-end;
  background: #dcfce7;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.bc-chat-msg--admin {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.bc-chat-foot {
  padding: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #fff;
}

.bc-chat-input {
  flex: 1;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  resize: none;
  font-size: 14px;
  outline: none;
}

.bc-chat-send {
  border: 0;
  border-radius: 14px;
  background: var(--bc-chat-accent);
  color: #fff;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
}

.bc-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bc-chat-mini {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 576px) {
  .bc-chat-root {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .bc-chat-root.bc-chat--lifted {
    bottom: calc(98px + env(safe-area-inset-bottom, 0px));
  }
}

