/* ================================================================
   CHATBUNCH — Premium Mobile-App Messenger UI
   All colors, sizes, and values come from CSS custom properties.
   Zero hardcoded brand values.
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset inside root only — fully scoped, never bleeds ── */
#chatbunch-root,
#chatbunch-root *,
#chatbunch-root *::before,
#chatbunch-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--cb-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#chatbunch-root img { max-width: 100%; display: block; }
#chatbunch-root button { cursor: pointer; user-select: none; }
#chatbunch-root textarea { font-family: inherit; }

/* ================================================================
   DESIGN TOKENS — all overridden by JS applyConfig()
   ================================================================ */
#chatbunch-root {
  /* Brand */
  --cb-primary:          #2563EB;
  --cb-primary-dk:       #1D4ED8;
  --cb-primary-lt:       rgba(37,99,235,.10);

  /* Header */
  --cb-hdr-bg:           #2563EB;
  --cb-hdr-bg2:          #1D4ED8;       /* gradient endpoint */
  --cb-hdr-text:         #FFFFFF;
  --cb-hdr-h:            70px;
  --cb-hdr-gradient:     0;             /* 0 = flat, 1 = gradient */

  /* Launcher */
  --cb-lnr-size:         58px;
  --cb-lnr-bg:           #2563EB;
  --cb-lnr-icon:         #FFFFFF;
  --cb-badge-bg:         #EF4444;

  /* Bubbles */
  --cb-agent-bubble:     #FFFFFF;
  --cb-agent-text:       #1E293B;
  --cb-visitor-bubble:   #2563EB;
  --cb-visitor-text:     #FFFFFF;
  --cb-bubble-r:         18px;

  /* Layout */
  --cb-font:             'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --cb-fs:               14px;
  --cb-win-w:            376px;
  --cb-win-h:            650px;
  --cb-win-r:            20px;

  /* Messages area */
  --cb-msgs-bg:          #F0F2F5;

  /* Input */
  --cb-input-bg:         #FFFFFF;
  --cb-input-r:          14px;
  --cb-placeholder:      'Write a reply\2026';

  /* Shadows */
  --cb-shadow-win:       0 24px 64px rgba(0,0,0,.18), 0 6px 20px rgba(0,0,0,.10);
  --cb-shadow-btn:       0 8px 24px rgba(37,99,235,.40);
}

/* ================================================================
   LAUNCHER BUTTON — scoped
   ================================================================ */
#chatbunch-root .cb-launcher {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  right: max(24px, env(safe-area-inset-right, 24px));
  z-index: 2147483646;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
#chatbunch-root .cb-launcher.pos-left { right: auto; left: max(24px, env(safe-area-inset-left, 24px)); align-items: flex-start; }

#chatbunch-root .cb-launcher-btn {
  width: var(--cb-lnr-size);
  height: var(--cb-lnr-size);
  border-radius: 50%;
  background: var(--cb-lnr-bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--cb-shadow-btn);
  position: relative;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1),
              box-shadow .2s;
  pointer-events: all;
  overflow: visible;
  flex-shrink: 0;
}
#chatbunch-root .cb-launcher-btn:hover {
  transform: scale(1.10);
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
}
#chatbunch-root .cb-launcher-btn:active { transform: scale(.91); }

/* Pulse ring */
#chatbunch-root .cb-launcher-btn::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2.5px solid var(--cb-lnr-bg);
  opacity: 0;
  animation: cb-pulse 2.8s cubic-bezier(.4,0,.6,1) infinite;
  pointer-events: none;
}
@keyframes cb-pulse {
  0%   { transform: scale(1); opacity: .55; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Chat / Close icons */
#chatbunch-root .cb-lnr-icon,
#chatbunch-root .cb-lnr-close {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cb-lnr-icon);
  transition: opacity .22s, transform .22s cubic-bezier(.34,1.2,.64,1);
}
#chatbunch-root .cb-lnr-icon  svg { width: 30px; height: 30px; }
#chatbunch-root .cb-lnr-close svg { width: 22px; height: 22px; }
#chatbunch-root .cb-lnr-close { opacity: 0; transform: rotate(-90deg) scale(.5); }
#chatbunch-root .cb-launcher.open .cb-lnr-icon  { opacity: 0; transform: rotate(90deg) scale(.5); }
#chatbunch-root .cb-launcher.open .cb-lnr-close { opacity: 1; transform: rotate(0) scale(1); }

/* Unread badge */
#chatbunch-root .cb-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 20px; height: 20px;
  background: var(--cb-badge-bg);
  color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  border: 2.5px solid #fff;
  pointer-events: none;
  animation: cb-badge-pop .26s cubic-bezier(.34,1.56,.64,1);
}
#chatbunch-root .cb-badge.hidden { display: none; }
@keyframes cb-badge-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ================================================================
   CHAT WINDOW — scoped
   ================================================================ */
#chatbunch-root .cb-window {
  position: fixed;
  bottom: calc(var(--cb-lnr-size) + max(32px, env(safe-area-inset-bottom, 32px)));
  right: max(24px, env(safe-area-inset-right, 24px));
  width: var(--cb-win-w);
  height: var(--cb-win-h);
  border-radius: var(--cb-win-r);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483645;
  box-shadow: var(--cb-shadow-win);
  transform-origin: bottom right;
  transition: transform .3s cubic-bezier(.34,1.2,.64,1), opacity .22s;
  border: 1px solid rgba(0,0,0,.06);
  pointer-events: all;
}
#chatbunch-root .cb-window.pos-left { right: auto; left: max(24px, env(safe-area-inset-left, 24px)); transform-origin: bottom left; }
#chatbunch-root .cb-window.hidden   { transform: scale(.78) translateY(32px); opacity: 0; pointer-events: none; }
#chatbunch-root .cb-window.visible  { transform: scale(1) translateY(0); opacity: 1; }

/* Tablet: windowed, slightly smaller than desktop */
@media (min-width: 521px) and (max-width: 820px) {
  #chatbunch-root .cb-launcher {
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    right:  max(20px, env(safe-area-inset-right,  20px));
  }
  #chatbunch-root .cb-launcher.pos-left {
    right: auto;
    left: max(20px, env(safe-area-inset-left, 20px));
  }
  #chatbunch-root .cb-window {
    width:  var(--cb-win-w-tablet, 340px);
    height: var(--cb-win-h-tablet, 560px);
    right:  max(20px, env(safe-area-inset-right,  20px));
    bottom: calc(var(--cb-lnr-size, 58px) + max(28px, env(safe-area-inset-bottom, 28px)));
  }
  #chatbunch-root .cb-window.pos-left {
    right: auto;
    left: max(20px, env(safe-area-inset-left, 20px));
  }
}

/* Mobile: windowed — same concept as desktop but smaller, always floating above launcher */
@media (max-width: 520px) {
  #chatbunch-root .cb-launcher {
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    right:  max(16px, env(safe-area-inset-right,  16px));
  }
  #chatbunch-root .cb-launcher.pos-left {
    right: auto;
    left: max(16px, env(safe-area-inset-left, 16px));
  }
  #chatbunch-root .cb-window {
    width:      var(--cb-win-w-mobile, 320px);
    height:     var(--cb-win-h-mobile, 480px);
    max-width:  calc(100dvw - 32px);
    max-height: calc(100dvh - 120px);
    right:  max(16px, env(safe-area-inset-right,  16px));
    bottom: calc(var(--cb-lnr-size, 58px) + max(24px, env(safe-area-inset-bottom, 24px)));
    border-radius: var(--cb-win-r, 20px);
    transform-origin: bottom right;
  }
  #chatbunch-root .cb-window.pos-left {
    right: auto;
    left: max(16px, env(safe-area-inset-left, 16px));
  }
}

/* ================================================================
   HEADER  —  70px, premium mobile-app style
   ================================================================ */
#chatbunch-root .cb-hdr {
  height: var(--cb-hdr-h);
  min-height: var(--cb-hdr-h);
  padding: 0 12px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: var(--cb-hdr-bg);
}
#chatbunch-root .cb-hdr.has-gradient {
  background: linear-gradient(135deg, var(--cb-hdr-bg) 0%, var(--cb-hdr-bg2) 100%);
}

#chatbunch-root .cb-hdr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

#chatbunch-root .cb-hdr-logo {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.30);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
#chatbunch-root .cb-hdr-logo img   { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#chatbunch-root .cb-hdr-logo-init  { font-size: 15px; font-weight: 700; color: var(--cb-hdr-text); line-height: 1; }

#chatbunch-root .cb-hdr-info { min-width: 0; }
#chatbunch-root .cb-hdr-name {
  font-size: 15px; font-weight: 600;
  color: var(--cb-hdr-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.2;
}
#chatbunch-root .cb-hdr-status {
  display: flex; align-items: center; gap: 5px;
  margin-top: 2px;
}
#chatbunch-root .cb-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 2.5px rgba(74,222,128,.28);
  flex-shrink: 0;
  animation: cb-blink 2.4s ease infinite;
}
@keyframes cb-blink {
  0%,100% { box-shadow: 0 0 0 2.5px rgba(74,222,128,.25); }
  50%      { box-shadow: 0 0 0 5px rgba(74,222,128,.08); }
}
#chatbunch-root .cb-hdr-status-txt { font-size: 12px; color: rgba(255,255,255,.82); font-weight: 400; }

#chatbunch-root .cb-hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#chatbunch-root .cb-hdr-agent {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 2px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
#chatbunch-root .cb-hdr-agent img  { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#chatbunch-root .cb-hdr-agent-init { font-size: 12px; font-weight: 700; color: var(--cb-hdr-text); }

/* Multiple agents stacked in header */
#chatbunch-root .cb-hdr-agents-stack {
  display: flex;
  align-items: center;
}
#chatbunch-root .cb-hdr-agents-stack .cb-hdr-agent {
  margin-left: -8px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.4);
}
#chatbunch-root .cb-hdr-agents-stack .cb-hdr-agent:first-child {
  margin-left: 0;
}

#chatbunch-root .cb-hdr-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--cb-hdr-text);
  transition: background .15s;
  flex-shrink: 0;
}
#chatbunch-root .cb-hdr-close:hover { background: rgba(255,255,255,.28); }
#chatbunch-root .cb-hdr-close svg   { width: 15px; height: 15px; }

/* ================================================================
   WELCOME SCREEN
   ================================================================ */
#chatbunch-root .cb-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

#chatbunch-root .cb-wlc-hero {
  background: var(--cb-hdr-bg);
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#chatbunch-root .cb-wlc-hero.has-gradient {
  background: linear-gradient(135deg, var(--cb-hdr-bg) 0%, var(--cb-hdr-bg2) 100%);
}

#chatbunch-root .cb-wlc-logo {
  width: 82px; height: 82px;
  border-radius: 22px;
  background: rgba(255,255,255,.20);
  border: 2.5px solid rgba(255,255,255,.32);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
}
#chatbunch-root .cb-wlc-logo img  { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
#chatbunch-root .cb-wlc-logo-icon { font-size: 40px; line-height: 1; }
#chatbunch-root .cb-wlc-logo-init { font-size: 32px; font-weight: 700; color: #fff; }

/* ── Online agents stacked avatars (welcome body, above title) ── */
#chatbunch-root .cb-agents-stack {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
#chatbunch-root .cb-ag-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--cb-primary, #2563EB);
  /* No overflow:hidden here — image clips itself; this lets the online dot sit outside the circle edge */
  background: #E2E8F0;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
  margin-left: -12px;
  flex-shrink: 0;
}
#chatbunch-root .cb-ag-wrap:first-child { margin-left: 0; }
#chatbunch-root .cb-ag-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 50%; /* clips avatar image to circle */
}
#chatbunch-root .cb-ag-init {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 18px; font-weight: 700;
  color: var(--cb-primary, #2563EB);
  background: #F1F5F9;
  border-radius: 50%; /* clips init letter to circle */
}
/* Small green online dot — bottom-right corner, partially outside avatar edge */
#chatbunch-root .cb-ag-wrap.cb-ag-online::after {
  content: '';
  position: absolute;
  bottom: -2px; right: -2px;
  width: 13px; height: 13px;
  background: #22C55E;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  pointer-events: none;
}

/* ================================================================
   RESPONSIVE HEADER & WELCOME HERO
   These rules must live AFTER the base .cb-hdr / .cb-wlc-hero rules
   so they win the cascade without needing !important.
   ================================================================ */

/* Tablet: slightly compact header and hero */
@media (min-width: 521px) and (max-width: 820px) {
  #chatbunch-root .cb-hdr {
    height: 62px;
    min-height: 62px;
    padding: 0 10px 0 12px;
  }
  #chatbunch-root .cb-hdr-logo        { width: 34px; height: 34px; }
  #chatbunch-root .cb-hdr-name        { font-size: 14px; }
  #chatbunch-root .cb-wlc-hero        { min-height: 155px; }
  #chatbunch-root .cb-wlc-logo        { width: 72px; height: 72px; border-radius: 18px; }
  #chatbunch-root .cb-wlc-logo-init   { font-size: 28px; }
  #chatbunch-root .cb-wlc-logo-icon   { font-size: 36px; }
}

/* Mobile: compact header and hero to fit 320×480 window */
@media (max-width: 520px) {
  #chatbunch-root .cb-hdr {
    height: 56px;
    min-height: 56px;
    padding: 0 10px 0 12px;
  }
  #chatbunch-root .cb-hdr-logo        { width: 30px; height: 30px; }
  #chatbunch-root .cb-hdr-logo-init   { font-size: 13px; }
  #chatbunch-root .cb-hdr-name        { font-size: 13.5px; }
  #chatbunch-root .cb-hdr-status-txt  { font-size: 11px; }
  #chatbunch-root .cb-hdr-close       { width: 26px; height: 26px; }
  #chatbunch-root .cb-hdr-close svg   { width: 13px; height: 13px; }
  #chatbunch-root .cb-hdr-agent       { width: 26px; height: 26px; }
  #chatbunch-root .cb-hdr-agent-init  { font-size: 10px; }
  #chatbunch-root .cb-wlc-hero        { min-height: 110px; }
  #chatbunch-root .cb-wlc-logo        { width: 60px; height: 60px; border-radius: 14px; }
  #chatbunch-root .cb-wlc-logo-init   { font-size: 24px; }
  #chatbunch-root .cb-wlc-logo-icon   { font-size: 32px; }
}

/* ── Agents online status label ── */
#chatbunch-root .cb-agents-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #64748B;
  font-weight: 500;
  margin-top: -4px;
  margin-bottom: 4px;
}
#chatbunch-root .cb-agents-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34,197,94,.22);
  animation: cb-blink 2.4s ease infinite;
}

#chatbunch-root .cb-wlc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 26px 32px;
  gap: 10px;
}
#chatbunch-root .cb-wlc-title {
  font-size: 24px; font-weight: 700;
  color: #0F172A;
  line-height: 1.25;
  letter-spacing: -.25px;
}
#chatbunch-root .cb-wlc-desc {
  font-size: 14.5px; color: #64748B;
  line-height: 1.65;
  max-width: 300px;
}
#chatbunch-root .cb-wlc-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 13px 22px;
  background: var(--cb-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14.5px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none;
}
#chatbunch-root .cb-wlc-cta:hover  { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(0,0,0,.22); }
#chatbunch-root .cb-wlc-cta:active { transform: none; }
#chatbunch-root .cb-wlc-cta svg   { width: 16px; height: 16px; flex-shrink: 0; }

/* ================================================================
   MESSAGES AREA
   ================================================================ */
#chatbunch-root .cb-msgs {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 8px;
  gap: 4px;
  background: var(--cb-msgs-bg);
  scroll-behavior: smooth;
}
#chatbunch-root .cb-msgs::-webkit-scrollbar { width: 3px; }
#chatbunch-root .cb-msgs::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 3px; }

#chatbunch-root .cb-sep {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #94A3B8; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 6px 0;
}
#chatbunch-root .cb-sep::before, #chatbunch-root .cb-sep::after { content:''; flex:1; height:1px; background:#DDE3ED; }

#chatbunch-root .cb-sys-wrap { display:flex; justify-content:center; margin:4px 0; }
#chatbunch-root .cb-sys-bbl  {
  background: rgba(255,255,255,.85);
  color: #64748B; font-size: 12px; font-style: italic;
  padding: 4px 14px; border-radius: 999px;
  border: 1px solid #E2E8F0;
}

#chatbunch-root .cb-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 100%;
}
#chatbunch-root .cb-msg-row.visitor { flex-direction: row-reverse; }

#chatbunch-root .cb-msg-row + .cb-msg-row.agent   { margin-top: 2px; }
#chatbunch-root .cb-msg-row + .cb-msg-row.visitor { margin-top: 2px; }
#chatbunch-root .cb-msg-row.agent   + .cb-msg-row.visitor,
#chatbunch-root .cb-msg-row.visitor + .cb-msg-row.agent { margin-top: 10px; }

#chatbunch-root .cb-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--cb-primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  overflow: hidden;
}
#chatbunch-root .cb-av img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
#chatbunch-root .cb-av.ghost { visibility: hidden; }

#chatbunch-root .cb-msg-grp { display:flex; flex-direction:column; gap:3px; max-width:75%; }
#chatbunch-root .cb-msg-row.visitor .cb-msg-grp { align-items:flex-end; }
#chatbunch-root .cb-msg-sender { font-size: 11px; color: #94A3B8; font-weight:500; margin-left:2px; margin-bottom:1px; }

#chatbunch-root .cb-bbl {
  display: inline-block;
  padding: 10px 14px;
  font-size: var(--cb-fs);
  line-height: 1.55;
  word-break: break-word;
  animation: cb-pop-in .18s cubic-bezier(.34,1.18,.64,1) both;
  border-radius: var(--cb-bubble-r);
}
@keyframes cb-pop-in {
  from { transform: translateY(10px) scale(.92); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

#chatbunch-root .cb-msg-row.agent .cb-bbl {
  background: var(--cb-agent-bubble);
  color: var(--cb-agent-text);
  border: 1px solid rgba(0,0,0,.08);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

#chatbunch-root .cb-msg-row.visitor .cb-bbl {
  background: var(--cb-visitor-bubble);
  color: var(--cb-visitor-text);
  border: none;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

#chatbunch-root .cb-msg-meta {
  display: flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: #94A3B8;
  padding: 0 2px;
}
#chatbunch-root .cb-msg-row.visitor .cb-msg-meta { flex-direction: row-reverse; }
#chatbunch-root .cb-tick { display:inline-flex; color: #CBD5E1; }
#chatbunch-root .cb-tick.read { color: #3B82F6; }
#chatbunch-root .cb-tick svg { width:13px; height:13px; }

#chatbunch-root .cb-bbl-img { padding: 3px; background:transparent; border:none; box-shadow:none; }
#chatbunch-root .cb-bbl-img img { max-width: 200px; border-radius: 13px; cursor:pointer; }
#chatbunch-root .cb-bbl-img img:hover { opacity:.88; }
#chatbunch-root .cb-bbl-vid { padding:3px; background:transparent; border:none; box-shadow:none; }
#chatbunch-root .cb-bbl-vid video { max-width:200px; border-radius:13px; }
#chatbunch-root .cb-bbl-file { display:flex; align-items:center; gap:10px; }
#chatbunch-root .cb-file-ic  { font-size:22px; flex-shrink:0; }
#chatbunch-root .cb-file-nm  { font-size:13px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:160px; }
#chatbunch-root .cb-file-sz  { font-size:11px; color:#94A3B8; }
#chatbunch-root .cb-file-dl  { font-size:11px; color:var(--cb-primary); text-decoration:none; }
#chatbunch-root .cb-msg-row.visitor .cb-file-sz { color:rgba(255,255,255,.7); }
#chatbunch-root .cb-msg-row.visitor .cb-file-dl { color:rgba(255,255,255,.85); }

#chatbunch-root .cb-bbl-form {
  padding: 14px 16px;
  min-width: 230px;
  background: var(--cb-agent-bubble);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--cb-bubble-r);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
#chatbunch-root .cb-form-hd  { font-size:14px; font-weight:600; margin-bottom:12px; color:#0F172A; }
#chatbunch-root .cb-form-fld { margin-bottom:10px; }
#chatbunch-root .cb-form-fld label { display:block; font-size:11.5px; font-weight:500; color:#475569; margin-bottom:4px; }
#chatbunch-root .cb-form-inp {
  width:100%; padding:8px 10px;
  border:1.5px solid #CBD5E1; border-radius:8px;
  font-size:13px; color:#1E293B; background:#fff; outline:none;
  transition:border-color .15s;
  font-family: var(--cb-font);
}
#chatbunch-root .cb-form-inp:focus { border-color:var(--cb-primary); box-shadow:0 0 0 3px var(--cb-primary-lt); }
#chatbunch-root .cb-form-submit {
  width:100%; padding:10px; margin-top:10px;
  background:var(--cb-primary); color:#fff;
  border:none; border-radius:8px;
  font-size:13px; font-weight:600;
  transition:background .15s;
  font-family: var(--cb-font);
}
#chatbunch-root .cb-form-submit:hover { background:var(--cb-primary-dk); }
#chatbunch-root .cb-form-ok { text-align:center; padding:12px; color:#10B981; font-weight:500; font-size:14px; }

#chatbunch-root .cb-typing-row { display:flex; align-items:flex-end; gap:6px; margin-top:10px; }
#chatbunch-root .cb-typing-bbl {
  display:inline-flex; align-items:center; gap:4px;
  padding:10px 14px;
  background:var(--cb-agent-bubble); color:var(--cb-agent-text);
  border:1px solid rgba(0,0,0,.08);
  border-radius:var(--cb-bubble-r); border-bottom-left-radius:4px;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}
#chatbunch-root .cb-tdot {
  width:6px; height:6px;
  background:#CBD5E1; border-radius:50%;
  animation:cb-typing 1.4s ease infinite;
}
#chatbunch-root .cb-tdot:nth-child(2) { animation-delay:.22s; }
#chatbunch-root .cb-tdot:nth-child(3) { animation-delay:.44s; }
@keyframes cb-typing {
  0%,60%,100% { transform:none; background:#CBD5E1; }
  30%          { transform:translateY(-7px); background:var(--cb-primary); }
}

/* ================================================================
   INPUT AREA — scoped
   ================================================================ */
#chatbunch-root .cb-input-wrap {
  flex-shrink: 0;
  padding: 8px 12px 10px;
  /* On desktop/tablet the window doesn't eat the inset, so handle it here */
  padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  background: var(--cb-input-bg);
  border-top: 1px solid rgba(0,0,0,.07);
}
/* Mobile: cb-window already applies padding-bottom:env(safe-area-inset-bottom)
   so DO NOT apply it again here — that was doubling the gap on Android */
@media (max-width: 520px) {
  #chatbunch-root .cb-input-wrap {
    padding: 8px 12px 10px;
  }
}
/* Tablet: same fix — windowed mode, keep safe-area but don't double-count */
@media (min-width: 521px) and (max-width: 820px) {
    #chatbunch-root .cb-input-wrap {
      padding: 8px 12px 10px;
    }
  }
  /* Desktop: windowed widget — compact input so the bottom section doesn't look oversized */
  @media (min-width: 821px) {
    #chatbunch-root .cb-input-wrap {
      padding: 6px 10px 6px;
      padding-bottom: 6px;
    }
    #chatbunch-root .cb-input-row {
      padding: 7px 8px 7px 12px;
    }
    #chatbunch-root .cb-powered {
      margin-top: 4px;
      font-size: 10.5px;
    }
  }

#chatbunch-root .cb-upload-prg {
  display:flex; align-items:center; gap:8px;
  background:#EFF6FF; border-radius:8px; padding:7px 12px;
  margin-bottom:8px; font-size:12px; color:var(--cb-primary);
}
#chatbunch-root .cb-upload-bar { flex:1; height:4px; background:#BFDBFE; border-radius:4px; overflow:hidden; }
#chatbunch-root .cb-upload-fill { height:100%; background:var(--cb-primary); border-radius:4px; transition:width .3s; width:55%; }

#chatbunch-root .cb-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F4F6F9;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--cb-input-r);
  padding: 10px 8px 10px 14px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
#chatbunch-root .cb-input-row:focus-within {
  border-color: var(--cb-primary);
  background: #fff;
  box-shadow: 0 0 0 3.5px var(--cb-primary-lt);
}

#chatbunch-root .cb-ta {
  flex: 1;
  border: none; background: transparent;
  font-size: var(--cb-fs);
  color: #1E293B;
  resize: none;
  outline: none;
  line-height: 1.5;
  /* Vertical padding gives text breathing room — prevents it touching borders */
  padding: 4px 0 4px;
  min-height: 24px;
  max-height: 110px;
  overflow-y: auto;
  font-family: var(--cb-font);
  /* Vertically align text correctly within the flex row */
  align-self: center;
}
#chatbunch-root .cb-ta::placeholder { color: #94A3B8; }
#chatbunch-root .cb-ta::-webkit-scrollbar { width:3px; }
#chatbunch-root .cb-ta::-webkit-scrollbar-thumb { background:#CBD5E1; border-radius:3px; }

#chatbunch-root .cb-inp-btns { display:flex; align-items:center; gap:2px; flex-shrink:0; }
#chatbunch-root .cb-icn-btn {
  width:30px; height:30px;
  border-radius:8px;
  border:none; background:transparent;
  display:flex; align-items:center; justify-content:center;
  color:#94A3B8;
  transition:background .13s, color .13s;
  flex-shrink:0;
}
#chatbunch-root .cb-icn-btn:hover { background:#E8EBF0; color:#475569; }
#chatbunch-root .cb-icn-btn svg   { width:17px; height:17px; }

#chatbunch-root .cb-send-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--cb-primary);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background .14s, transform .1s;
  flex-shrink: 0;
}
#chatbunch-root .cb-send-btn:hover  { background: var(--cb-primary-dk); }
#chatbunch-root .cb-send-btn:active { transform: scale(.88); }
#chatbunch-root .cb-send-btn svg    { width: 16px; height: 16px; }

#chatbunch-root .cb-powered {
  font-size: 11px;
  color: #94A3B8;
  text-align: center;
  margin-top: 7px;
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
#chatbunch-root .cb-powered-brand {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #1E293B;
}
#chatbunch-root .cb-powered-brand strong {
  font-weight: 700;
  letter-spacing: 0;
}
#chatbunch-root .cb-powered-ico {
  width: 14px;
  height: 14px;
  color: var(--cb-primary);
  flex-shrink: 0;
}
#chatbunch-root.cb-dark-mode .cb-powered-brand { color: #FFFFFF; }

/* ================================================================
   EMOJI PICKER — scoped
   ================================================================ */
#chatbunch-root .cb-emoji-tray {
  position: absolute;
  bottom: 75px; right: 12px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 32px);
  gap: 3px;
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
}
#chatbunch-root .cb-emoji-tray.hidden { display: none; }
#chatbunch-root .hidden { display: none !important; }
#chatbunch-root .cb-e-btn {
  width:32px; height:32px;
  border:none; background:transparent;
  font-size:17px;
  border-radius:7px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:background .12s;
}
#chatbunch-root .cb-e-btn:hover { background:#F1F5F9; }

/* ================================================================
   NOTIFICATION TOAST — scoped
   ================================================================ */
#chatbunch-root .cb-toast {
  position: fixed;
  bottom: calc(var(--cb-lnr-size) + 52px);
  right: 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
  padding: 12px 14px 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  z-index: 2147483644;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,.06);
  animation: cb-toast-in .28s cubic-bezier(.34,1.2,.64,1);
}
#chatbunch-root .cb-toast.pos-left { right: auto; left: 24px; }
@keyframes cb-toast-in {
  from { transform: translateY(16px) scale(.92); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
#chatbunch-root .cb-toast-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cb-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
#chatbunch-root .cb-toast-av img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
#chatbunch-root .cb-toast-body { flex: 1; min-width: 0; }
#chatbunch-root .cb-toast-name { font-size: 12px; font-weight: 600; color: #1E293B; }
#chatbunch-root .cb-toast-msg  { font-size: 12.5px; color: #64748B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
#chatbunch-root .cb-toast-x {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none; background: #F1F5F9;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #94A3B8; line-height: 1;
  flex-shrink: 0;
  transition: background .13s;
}
#chatbunch-root .cb-toast-x:hover { background: #E2E8F0; }

/* ================================================================
   DARK MODE — toggled via .cb-dark-mode on #chatbunch-root
   ================================================================ */
#chatbunch-root.cb-dark-mode .cb-window {
  background: #0F172A;
  color: #E2E8F0;
}
#chatbunch-root.cb-dark-mode .cb-msgs {
  background: #0F172A;
}
#chatbunch-root.cb-dark-mode .cb-msg-bubble {
  background: #1E293B;
  color: #E2E8F0;
}
#chatbunch-root.cb-dark-mode .cb-msg-agent .cb-msg-bubble {
  background: var(--cb-agent-bubble, #1E293B);
  color: var(--cb-agent-text, #E2E8F0);
}
#chatbunch-root.cb-dark-mode .cb-msg-visitor .cb-msg-bubble {
  background: var(--cb-visitor-bubble, var(--cb-primary));
  color: var(--cb-visitor-text, #fff);
}
#chatbunch-root.cb-dark-mode .cb-msg-meta {
  color: #64748B;
}
#chatbunch-root.cb-dark-mode .cb-input-wrap {
  background: #0F172A;
  border-top: 1px solid #1E293B;
}
/* Input row — the bordered container around textarea + buttons */
#chatbunch-root.cb-dark-mode .cb-input-row {
  background: #1E293B;
  border-color: #334155;
}
#chatbunch-root.cb-dark-mode .cb-input-row:focus-within {
  background: #1E293B;
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.22);
}
#chatbunch-root.cb-dark-mode .cb-ta {
  background: transparent;
  color: #F1F5F9;
}
#chatbunch-root.cb-dark-mode .cb-ta::placeholder {
  color: #475569;
}
/* Emoji + attach icons — white so they're visible on dark background */
#chatbunch-root.cb-dark-mode .cb-icn-btn {
  color: #CBD5E1;
}
#chatbunch-root.cb-dark-mode .cb-icn-btn:hover {
  background: #334155;
  color: #F1F5F9;
}
#chatbunch-root.cb-dark-mode .cb-welcome {
  background: #0F172A;
}
#chatbunch-root.cb-dark-mode .cb-wlc-body {
  background: #0F172A;
}
#chatbunch-root.cb-dark-mode .cb-wlc-title {
  color: #F1F5F9;
}
#chatbunch-root.cb-dark-mode .cb-wlc-desc {
  color: #94A3B8;
}
#chatbunch-root.cb-dark-mode .cb-emoji-tray {
  background: #1E293B;
  border-color: #334155;
}
#chatbunch-root.cb-dark-mode .cb-e-btn:hover {
  background: #334155;
}
#chatbunch-root.cb-dark-mode .cb-powered {
  color: #475569;
}
#chatbunch-root.cb-dark-mode .cb-upload-prg {
  background: #1E293B;
  color: #94A3B8;
}
#chatbunch-root.cb-dark-mode .cb-upload-bar {
  background: #334155;
}

/* ================================================================
   CONVERSATION CLOSED BANNER — scoped
   ================================================================ */
#chatbunch-root .cb-conv-closed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 14px 8px 8px;
  padding: 10px 16px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 10px;
  font-size: 13px;
  color: #166534;
  font-weight: 500;
  text-align: center;
}
#chatbunch-root .cb-conv-closed-icon {
  font-size: 15px;
  color: #22C55E;
  flex-shrink: 0;
}
#chatbunch-root.cb-dark-mode .cb-conv-closed {
  background: #052e16;
  border-color: #166534;
  color: #86efac;
}

/* ================================================================
   CSAT RATING UI — scoped
   ================================================================ */
#chatbunch-root .cb-rating-wrap {
  margin: 14px 8px 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: cb-pop-in .2s cubic-bezier(.34,1.18,.64,1) both;
}
#chatbunch-root .cb-rating-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1E293B;
  text-align: center;
}
#chatbunch-root .cb-rating-stars {
  display: flex;
  gap: 6px;
}
#chatbunch-root .cb-star-btn {
  font-size: 28px;
  background: transparent;
  border: none;
  color: #CBD5E1;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color .14s, transform .1s;
}
#chatbunch-root .cb-star-btn:hover,
#chatbunch-root .cb-star-btn.cb-star-hover { color: #FBBF24; transform: scale(1.18); }
#chatbunch-root .cb-star-btn.cb-star-sel   { color: #F59E0B; }
#chatbunch-root .cb-rating-fb {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-size: 13px;
  color: #1E293B;
  resize: none;
  outline: none;
  font-family: var(--cb-font);
  transition: border-color .15s;
}
#chatbunch-root .cb-rating-fb:focus { border-color: var(--cb-primary); box-shadow: 0 0 0 3px var(--cb-primary-lt); }
#chatbunch-root .cb-rating-submit {
  width: 100%;
  padding: 10px;
  background: var(--cb-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--cb-font);
  cursor: pointer;
  transition: background .14s;
}
#chatbunch-root .cb-rating-submit:hover { background: var(--cb-primary-dk); }
#chatbunch-root .cb-rating-thanks {
  font-size: 14px;
  font-weight: 500;
  color: #10B981;
  text-align: center;
  padding: 4px 0;
}
#chatbunch-root.cb-dark-mode .cb-rating-wrap {
  background: #1E293B;
  border-color: #334155;
}
#chatbunch-root.cb-dark-mode .cb-rating-title { color: #F1F5F9; }
#chatbunch-root.cb-dark-mode .cb-rating-fb {
  background: #0F172A;
  border-color: #334155;
  color: #F1F5F9;
}
#chatbunch-root.cb-dark-mode .cb-rating-fb::placeholder { color: #475569; }

/* ================================================================
   FEATURE: "OTHER OPTIONS" COLLAPSIBLE SECTION (welcome screen)
   ================================================================ */
#chatbunch-root .cb-more-wrap {
  width: 100%;
  margin-top: 10px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  background: #F8FAFC;
}
#chatbunch-root .cb-more-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  font-family: var(--cb-font);
  cursor: pointer;
  gap: 8px;
  transition: color .15s;
}
#chatbunch-root .cb-more-toggle:hover { color: var(--cb-primary); }
#chatbunch-root .cb-more-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform .22s ease;
}
#chatbunch-root .cb-more-wrap.cb-more-open .cb-more-chevron {
  transform: rotate(180deg);
}
#chatbunch-root .cb-more-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
  padding: 0 12px;
}
#chatbunch-root .cb-more-wrap.cb-more-open .cb-more-body {
  padding: 0 12px 12px;
}

/* ================================================================
   FEATURE: OFFLINE STATUS DOT
   ================================================================ */
#chatbunch-root .cb-status-dot.cb-offline-dot {
  background: #94A3B8;
  box-shadow: none;
  animation: none;
}

/* ================================================================
   FEATURE: OFFLINE BANNER (welcome screen)
   ================================================================ */
#chatbunch-root .cb-offline-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #92400E;
  line-height: 1.4;
  margin-top: 6px;
}
#chatbunch-root .cb-offline-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: #D97706;
}

/* ================================================================
   FEATURE: DEPARTMENT SELECTOR (welcome screen)
   ================================================================ */
#chatbunch-root .cb-dept-sel-wrap {
  position: relative;
  width: 100%;
  margin-top: 12px;
}
#chatbunch-root .cb-dept-sel-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: #64748B;
  pointer-events: none;
}
#chatbunch-root .cb-dept-sel {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  background: #F8FAFC;
  font-size: 13.5px;
  color: #1E293B;
  font-family: var(--cb-font);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
#chatbunch-root .cb-dept-sel:focus {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px var(--cb-primary-lt);
}

/* ================================================================
   FEATURE: TICKET BUTTON (welcome screen)
   ================================================================ */
#chatbunch-root .cb-wlc-ticket-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 11px 16px;
  background: transparent;
  border: 1.5px solid var(--cb-primary);
  border-radius: 12px;
  color: var(--cb-primary);
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--cb-font);
  cursor: pointer;
  transition: background .15s, color .15s;
}
#chatbunch-root .cb-wlc-ticket-btn:hover {
  background: var(--cb-primary-lt);
}
#chatbunch-root .cb-wlc-ticket-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
#chatbunch-root .cb-ticket-arrow {
  margin-left: auto;
  opacity: .6;
}
#chatbunch-root .cb-ticket-arrow svg {
  width: 14px;
  height: 14px;
}

/* ================================================================
   FEATURE: TICKET SCREEN
   ================================================================ */
#chatbunch-root .cb-ticket-screen {
  flex-direction: column;
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 2;
  border-radius: inherit;
  overflow: hidden;
}
#chatbunch-root .cb-ticket-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #E2E8F0;
  font-size: 14px;
  font-weight: 600;
  color: #1E293B;
  flex-shrink: 0;
}
#chatbunch-root .cb-ticket-back {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--cb-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--cb-font);
  cursor: pointer;
  padding: 4px 0;
}
#chatbunch-root .cb-ticket-back:hover { opacity: .8; }
#chatbunch-root .cb-ticket-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
#chatbunch-root .cb-ticket-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#chatbunch-root .cb-tk-fg {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#chatbunch-root .cb-tk-lbl {
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
}
#chatbunch-root .cb-tk-req { color: #EF4444; }
#chatbunch-root .cb-tk-inp {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid #CBD5E1;
  border-radius: 9px;
  font-size: 13.5px;
  color: #1E293B;
  background: #F8FAFC;
  font-family: var(--cb-font);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#chatbunch-root .cb-tk-inp:focus {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px var(--cb-primary-lt);
  background: #fff;
}
#chatbunch-root .cb-tk-ta { resize: vertical; min-height: 80px; }
#chatbunch-root .cb-tk-err {
  font-size: 12.5px;
  color: #DC2626;
  padding: 6px 10px;
  background: #FEF2F2;
  border-radius: 7px;
}
#chatbunch-root .cb-tk-submit {
  width: 100%;
  padding: 11px;
  background: var(--cb-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--cb-font);
  cursor: pointer;
  transition: background .14s, opacity .14s;
}
#chatbunch-root .cb-tk-submit:hover    { background: var(--cb-primary-dk); }
#chatbunch-root .cb-tk-submit:disabled { opacity: .65; cursor: default; }

/* Ticket success state */
#chatbunch-root .cb-ticket-ok {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 32px 16px;
  min-height: 200px;
}
#chatbunch-root .cb-ticket-ok-icon {
  font-size: 40px;
  line-height: 1;
  color: #10B981;
}
#chatbunch-root .cb-ticket-ok-title {
  font-size: 16px;
  font-weight: 700;
  color: #1E293B;
}
#chatbunch-root .cb-ticket-ok-sub {
  font-size: 13px;
  color: #64748B;
  line-height: 1.5;
}
#chatbunch-root .cb-ticket-ok-back {
  margin-top: 6px;
  padding: 9px 20px;
  background: var(--cb-primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--cb-font);
  cursor: pointer;
  transition: background .14s;
}
#chatbunch-root .cb-ticket-ok-back:hover { background: var(--cb-primary-dk); }

/* Dark mode overrides */
#chatbunch-root.cb-dark-mode .cb-offline-banner {
  background: #1E293B;
  border-color: #334155;
  color: #CBD5E1;
}
#chatbunch-root.cb-dark-mode .cb-dept-sel {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}
#chatbunch-root.cb-dark-mode .cb-ticket-screen { background: #0F172A; }
#chatbunch-root.cb-dark-mode .cb-ticket-hdr {
  background: #0F172A;
  border-color: #1E293B;
  color: #F1F5F9;
}
#chatbunch-root.cb-dark-mode .cb-tk-inp {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}
#chatbunch-root.cb-dark-mode .cb-tk-inp:focus { background: #1E293B; }
#chatbunch-root.cb-dark-mode .cb-tk-lbl { color: #94A3B8; }
#chatbunch-root.cb-dark-mode .cb-wlc-ticket-btn { border-color: var(--cb-primary); }
#chatbunch-root.cb-dark-mode .cb-ticket-ok-title { color: #F1F5F9; }
#chatbunch-root.cb-dark-mode .cb-ticket-ok-sub  { color: #94A3B8; }
