/* Basketeer Chatbot Widget v6 — Lottie emoji + order cards + tracking + tool dock */

/* Brand theming via CSS custom properties */
.bk-chat-widget { --bk-primary: #C4A265; --bk-primary-light: #d4b87a; --bk-primary-dark: #a88a4f; }
body[data-brand="charlotte"] .bk-chat-widget { --bk-primary: #545E86; --bk-primary-light: #6b75a0; --bk-primary-dark: #3f4766; }
body[data-brand="flowers"] .bk-chat-widget { --bk-primary: #6A7B6A; --bk-primary-light: #7f917f; --bk-primary-dark: #566856; }
/* [v12.6] Chat Live green identity — deliberately brand-independent (same green regardless of
   basketeer/charlotte/flowers theme) since it represents "a human has joined", not a brand. */
.bk-chat-widget {
  --bk-live: #3E9E6E;
  --bk-live-light: #4CA97C;
  --bk-live-dark: #2F8A5E;
  --bk-live-soft: #E4F1EA;
  --bk-live-deep: #256b49;
}

/* Floating bubble button with Lottie face */
.bk-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--bk-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: bk-chat-pulse 2s ease-in-out 3;
  overflow: visible;
}
.bk-chat-bubble:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(0,0,0,0.35); }

/* Lottie container — larger than bubble, overflows edges to show Basil figure */
.bk-chat-lottie {
  width: 122px;
  height: 158px;
  margin-top: -28px;
  pointer-events: none;
  flex-shrink: 0;
}

@keyframes bk-chat-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0,0,0,0.25); }
  50% { box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 0 0 10px rgba(196,162,101,0.15); }
}

/* Chat panel */
.bk-chat-panel {
  position: fixed;
  bottom: 104px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: 680px;
  max-height: calc(100vh - 140px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  background: #fff;
  display: none;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: contain;
}
.bk-chat-panel.open { display: flex; }

/* Body scroll lock handled by JS (position:fixed pattern for iOS) */

/* Header */
.bk-chat-header {
  background: var(--bk-primary);
  color: white;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}
.bk-chat-header-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bk-chat-header-status {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 400;
  /* [v12.6] Guarantee a single line regardless of locale/width — this is what actually fixes
     the old "Basketeer — here to help" wrap (the JS change also shortened the text itself). */
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bk-chat-header-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* [v12.6] Chat Live header state — green identity, Lottie avatar unchanged/untouched */
.bk-chat-header.bk-live {
  background: linear-gradient(155deg, var(--bk-live-light), var(--bk-live-dark));
}
.bk-chat-header.bk-live .bk-chat-status-dot {
  background: #EAFBF1;
  box-shadow: 0 0 0 2px rgba(234, 251, 241, 0.4);
}
.bk-chat-panel.bk-live .bk-chat-send { background: var(--bk-live); }
.bk-chat-panel.bk-live .bk-chat-input:focus { border-color: var(--bk-live); }

/* [v12.8] Full green consistency in Chat Live — extend the green identity to every remaining
   Basketeer-GOLD accent inside the open panel, so nothing reads gold while the header + send
   button are green. Scoped under the .is-live root class (added by enterChatLive) so normal mode
   is 100% unchanged. IMPORTANT: channel BRAND colors (LINE green #06C755, IG gradient, Call blue,
   WhatsApp) live on .bk-chat-chip-icon / .bk-cta-icon and are deliberately NOT touched here —
   only the gold --bk-primary accents flip. */
.bk-chat-widget.is-live .bk-chat-action {
  border-color: var(--bk-live);
  color: var(--bk-live);
}
.bk-chat-widget.is-live .bk-chat-action:hover {
  background: var(--bk-live);
  color: #fff;
}
.bk-chat-widget.is-live .bk-chat-link { color: var(--bk-live); }
.bk-chat-widget.is-live .bk-chat-esc-email:hover { color: var(--bk-live); }
/* Customer's own sent bubbles turn green in live mode too (retroactive — recolors existing bubbles,
   not just new ones). Its background is set inline to var(--bk-primary)/getAccentColor, so !important
   is needed to win over the inline style. Reverts to gold automatically when .is-live is removed. */
.bk-chat-widget.is-live .bk-chat-msg.user { background: var(--bk-live) !important; }
/* Camera / attach button — its color is set inline to var(--bk-primary), so override needs the
   same specificity boost. Idle state only (a staged-photo attach keeps its own inline styling). */
.bk-chat-widget.is-live .bk-chat-attach { color: var(--bk-live) !important; }
/* Greeting tiles (if the greeting is still on screen) — gold icon badge + gold hover border go green.
   The dedicated .bk-tile-live green tile already matches, so this only recolors the neutral tiles. */
.bk-chat-widget.is-live .bk-tile-icon { background: var(--bk-live-soft); color: var(--bk-live-dark); }
.bk-chat-widget.is-live .bk-tile:hover { border-color: var(--bk-live); }
.bk-chat-widget.is-live .bk-tile.bk-tile-photo .bk-tile-icon { background: var(--bk-live-soft); color: var(--bk-live-dark); }

.bk-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.bk-chat-close:hover { opacity: 1; }

/* Messages area */
.bk-chat-messages {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f9f8f6;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

/* Message bubbles */
.bk-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.bk-chat-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #333;
  border: 1px solid #e8e4df;
  border-bottom-left-radius: 4px;
}
.bk-chat-msg.user {
  align-self: flex-end;
  background: var(--bk-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

/* ===== ORDER CARD ===== */
.bk-chat-order {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e8e4df;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  overflow: hidden;
  max-width: 92%;
  font-size: 13px;
}
.bk-chat-order-header {
  background: var(--bk-primary);
  color: white;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bk-chat-order-number {
  font-weight: 700;
  font-size: 14px;
}
.bk-chat-order-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  font-weight: 500;
  text-transform: capitalize;
}
.bk-chat-order-body {
  padding: 12px 14px;
}
.bk-chat-order-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #f0ebe3;
}
.bk-chat-order-row:last-child { border-bottom: none; }
.bk-chat-order-label {
  color: #888;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  min-width: 80px;
}
.bk-chat-order-value {
  color: #333;
  font-weight: 500;
  text-align: right;
}
.bk-chat-order-items {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0ebe3;
}
.bk-chat-order-item {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
}
.bk-chat-order-item-name { color: #333; flex: 1; }
.bk-chat-order-item-price { color: var(--bk-primary); font-weight: 600; margin-left: 8px; white-space: nowrap; }
.bk-chat-order-total {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0;
  margin-top: 4px;
  border-top: 2px solid #f0ebe3;
  font-weight: 700;
  font-size: 14px;
}
.bk-chat-order-total .bk-chat-order-value { color: var(--bk-primary); }
.bk-chat-order-footer {
  padding: 8px 14px 10px;
  border-top: 1px solid #f0ebe3;
  text-align: center;
}
.bk-chat-order-track {
  display: inline-block;
  padding: 6px 20px;
  background: var(--bk-primary);
  color: white;
  border-radius: 20px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.bk-chat-order-track:hover { opacity: 0.85; }

/* Tracking card uses pure inline styles — no CSS classes needed */

/* Clear chat button */
.bk-chat-clear {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
}
.bk-chat-clear:hover { opacity: 1; }

/* Bot message wrapper (holds message + feedback) */
.bk-chat-msg-wrap {
  align-self: flex-start;
  max-width: 85%;
  display: flex;
  flex-direction: column;
}
.bk-chat-msg-wrap .bk-chat-msg.bot {
  max-width: 100%;
}

/* Feedback buttons */
.bk-chat-feedback {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  padding-left: 6px;
}
.bk-chat-fb-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  opacity: 0.35;
  transition: opacity 0.2s, transform 0.15s;
  border-radius: 4px;
}
.bk-chat-fb-btn:hover { opacity: 0.8; transform: scale(1.2); }
.bk-chat-fb-btn.active { opacity: 1; transform: scale(1.2); }
.bk-chat-fb-btn:disabled { cursor: default; }
.bk-chat-fb-btn:disabled:not(.active) { opacity: 0.15; }

/* Typing indicator */
.bk-chat-typing {
  align-self: flex-start;
  padding: 10px 16px;
  margin: 0 16px;
  background: #fff;
  border: 1px solid #e8e4df;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: none;
  flex-direction: column;
  gap: 4px;
}
.bk-chat-typing.active { display: flex; }
.bk-chat-typing-dots { display: flex !important; gap: 5px; align-items: center; min-height: 9px; }
.bk-chat-typing-dot {
  display: inline-block !important;
  width: 9px !important;
  height: 9px !important;
  flex: 0 0 auto !important;
  border-radius: 50% !important;
  background: var(--bk-primary, #C4A265) !important;
  opacity: 1 !important;
  visibility: visible !important;
  animation: bk-typing 1.2s infinite !important;
}
.bk-chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bk-chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bk-typing {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-5px); opacity: 1; }
}
.bk-chat-typing-text {
  font-size: 11px;
  color: #999;
  font-style: italic;
}

/* Quick actions */
.bk-chat-actions {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* Declare horizontal panning as the intended gesture so the browser routes the touch to this
     row's own scroller (paired with the JS scroll-guard allow-entry that stops the panel-level
     touchmove handler from preventDefault-ing the swipe). */
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  gap: 6px;
  padding: 0 16px 8px;
  background: #f9f8f6;
}
.bk-chat-actions::-webkit-scrollbar { display: none; }
.bk-chat-action {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--bk-primary);
  background: white;
  color: var(--bk-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.bk-chat-action:hover {
  background: var(--bk-primary);
  color: white;
}

/* ===== TOOL DOCK (vertical strip on left side of chat) ===== */
.bk-chat-panel-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: visible;
  position: relative;
  border-radius: 0 0 16px 16px;
}
.bk-chat-panel-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.bk-chat-panel-main .bk-chat-input-area {
  border-radius: 0 0 16px 16px;
}

/* Input area */
.bk-chat-input-area {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #e8e4df;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0 0 16px 16px;
}
.bk-chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  max-height: 80px;
  resize: none;
}
.bk-chat-input:focus { border-color: var(--bk-primary); }
.bk-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bk-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.bk-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Clickable links in bot messages */
.bk-chat-link {
  color: var(--bk-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  font-weight: 500;
}
.bk-chat-link:hover { opacity: 0.8; }

/* Product cards rendered in iframe — styles are self-contained in chat-products.html */

/* ===== CALLOUT BUBBLE ===== */
.bk-chat-callout {
  position: fixed;
  bottom: 96px;
  right: 24px;
  background: #fff;
  border: 1px solid #e8e4df;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  padding: 10px 32px 10px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  color: #333;
  z-index: 99997;
  cursor: pointer;
  max-width: 240px;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.bk-chat-callout.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.bk-chat-callout:hover { border-color: var(--bk-primary); }
.bk-chat-callout-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
.bk-chat-callout-close:hover { color: #666; }
.bk-chat-callout-text {}

/* Subtle tail pointing to bubble */
.bk-chat-callout::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #e8e4df;
  border-bottom: 1px solid #e8e4df;
  transform: rotate(45deg);
}

/* ===== MOBILE ===== */
/* ===== MOBILE — Bottom sheet ===== */
@media (max-width: 480px) {
  .bk-chat-panel {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 85vh !important;
    height: 85dvh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 20px 20px 0 0 !important;
    z-index: 99999;
    overflow: hidden;
  }
  .bk-chat-bubble { bottom: 16px; right: 16px; width: 56px; height: 56px; }
  .bk-chat-lottie { width: 100px; height: 130px; margin-top: -22px; }
  .bk-chat-callout { bottom: 78px; right: 16px; max-width: 200px; font-size: 12px; }
  .bk-chat-header {
    padding: 12px 16px;
    border-radius: 20px 20px 0 0;
    position: relative;
  }
  .bk-chat-header::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
  }
  .bk-chat-header-title { font-size: 15px; }
  .bk-chat-close {
    font-size: 28px; padding: 4px 12px; opacity: 1;
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
  }
  .bk-chat-messages {
    flex: 1;
    min-height: 0;
    padding: 12px; gap: 8px;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }
  .bk-chat-msg { max-width: 90%; font-size: 14px; }
  .bk-chat-input { font-size: 16px; }
  .bk-chat-input-area {
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
  }
  .bk-chat-panel-body {
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .bk-chat-panel-main {
    flex: 1;
    min-height: 0;
  }
  .bk-chat-panel-main .bk-chat-input-area { border-radius: 0; }
  .bk-chat-tracking-map { height: 120px; }
}

/* ===== HEADER AVATAR CIRCLE ===== */
.bk-chat-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}
.bk-chat-header-avatar-fallback {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 64px;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: bkHeaderBob 2.2s ease-in-out infinite;
}
.bk-chat-header-avatar-fallback svg {
  width: 46px;
  height: 56px;
}
@keyframes bkHeaderBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}
.bk-chat-header-avatar-lottie {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 72px;
  pointer-events: none;
}

/* ===== GREETING SCREEN ===== */
.bk-chat-greeting-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 8px;
  align-self: stretch;
}
.bk-chat-greeting-header {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.4;
}
.bk-chat-greeting-sub {
  font-size: 12px;
  font-weight: 400;
  color: #999;
}
.bk-chat-greeting-section {
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ===== CTA GRID (contact buttons — white card + colored icon box) ===== */
.bk-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bk-cta-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.bk-cta-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.bk-cta-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.11); }
.bk-cta-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bk-cta-icon svg { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.bk-cta-title { font-size: 13px; font-weight: 700; color: #2c2519; line-height: 1.2; }
.bk-cta-desc  { font-size: 11px; color: #8a7a65; line-height: 1.4; }
.bk-cta-card.bk-line  { border-color: rgba(6,199,85,.3); }
.bk-cta-card.bk-line .bk-cta-icon  { background: #06C755; }
.bk-cta-card.bk-line:hover  { border-color: #06C755; }
.bk-cta-card.bk-wa   { border-color: rgba(37,211,102,.3); }
.bk-cta-card.bk-wa .bk-cta-icon   { background: #25D366; }
.bk-cta-card.bk-wa:hover   { border-color: #25D366; }
.bk-cta-card.bk-ig   { border-color: rgba(220,39,67,.2); }
.bk-cta-card.bk-ig .bk-cta-icon   { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }
.bk-cta-card.bk-ig:hover   { border-color: #dc2743; }
.bk-cta-card.bk-call { border-color: rgba(33,150,243,.3); }
.bk-cta-card.bk-call .bk-cta-icon { background: #2196F3; }
.bk-cta-card.bk-call:hover { border-color: #2196F3; }
.bk-cta-card.bk-action { border-color: #e0d4be; }
.bk-cta-card.bk-action .bk-cta-icon { background: #f5f0e8; color: #a88a4f; }
.bk-cta-card.bk-action .bk-cta-title { color: #a88a4f; }
.bk-cta-card.bk-action:hover { border-color: #C4A265; background: #fffdf8; }
.bk-cta-grid.three .bk-cta-card { padding: 11px 9px; }
.bk-cta-grid.three .bk-cta-icon { width: 30px; height: 30px; border-radius: 7px; }
.bk-cta-grid.three .bk-cta-title { font-size: 11px; }
.bk-cta-grid.three .bk-cta-desc { display: none; }

/* ===== ESCALATION CARD (inline — no box) ===== */
.bk-chat-esc-inline {
  width: 92%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-self: flex-start;
}

/* ===== EMAIL LINK ===== */
.bk-chat-esc-email {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #888;
  text-decoration: none;
  padding: 4px 2px;
  transition: color 0.15s;
}
.bk-chat-esc-email:hover { color: var(--bk-primary); }
.bk-chat-esc-email svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== HEADER STATUS DOT ===== */
.bk-chat-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(74,222,128,0.3);
}

/* ===== HEADER CONTACT BUTTON ===== */
.bk-chat-contact-btn {
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: inherit;
  margin-right: 2px;
}
.bk-chat-contact-btn:hover { background: rgba(255,255,255,0.35); }

/* ===== BURGER MENU BUTTON ===== */
.bk-chat-burger-btn {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.4);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
  flex-shrink: 0;
}
.bk-chat-burger-btn:hover { background: rgba(255,255,255,0.3); }
.bk-chat-burger-lines {
  display: block;
  position: relative;
  width: 14px;
  height: 2px;
  background: white;
  border-radius: 2px;
}
.bk-chat-burger-lines::before,
.bk-chat-burger-lines::after {
  content: '';
  display: block;
  position: absolute;
  width: 14px;
  height: 2px;
  background: white;
  border-radius: 2px;
  left: 0;
}
.bk-chat-burger-lines::before { top: -5px; }
.bk-chat-burger-lines::after  { top: 5px; }

/* ===== BURGER OVERLAY MENU ===== */
.bk-chat-burger-menu {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: rgba(44,37,25,0.5);
  display: none;
  align-items: flex-start;
  border-radius: 16px;
  overflow: hidden;
}
.bk-chat-burger-panel {
  width: 230px;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  animation: bkBurgerSlide .22s ease;
}
@keyframes bkBurgerSlide { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.bk-chat-burger-hd { background: var(--bk-primary, #C4A265); color: #fff; padding: 16px; flex-shrink: 0; }
.bk-chat-burger-hd-title { font-size: 14px; font-weight: 700; }
.bk-chat-burger-hd-sub { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.bk-chat-burger-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.bk-chat-burger-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s;
}
.bk-chat-burger-item:hover { background: #f5f0e8; background: color-mix(in srgb, var(--bk-primary, #C4A265) 10%, #fff); }
.bk-chat-burger-icon {
  width: 34px; height: 34px;
  background: #f5f0e8;
  background: color-mix(in srgb, var(--bk-primary, #C4A265) 14%, #fff);
  border: 1.5px solid #e0d4be;
  border: 1.5px solid color-mix(in srgb, var(--bk-primary, #C4A265) 35%, #fff);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--bk-primary-dark, #a88a4f);
}
.bk-chat-burger-icon svg { width: 16px; height: 16px; display: block; }
.bk-chat-burger-label { font-size: 13px; font-weight: 600; color: #2c2519; }
.bk-chat-burger-hint { font-size: 10px; color: #8a7a65; margin-top: 1px; }
.bk-chat-burger-div { height: 1px; background: #e0d4be; background: color-mix(in srgb, var(--bk-primary, #C4A265) 35%, #fff); margin: 4px 14px; }

/* ===== [v12.6] GREETING SCREEN REDESIGN — compact contact chips + quick-action tiles ===== */
/* Greeting-screen-only compact icon-chip row for CONTACT_CHANNELS (LINE/WhatsApp/Instagram/Call).
   Distinct from .bk-cta-grid/.bk-cta-card above, which stays as-is for addEscalationCard(). */
.bk-chat-chip-row {
  display: flex;
  gap: 8px;
}
.bk-chat-chip {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--bk-primary, #C4A265) 18%, #fff);
  border-radius: 14px;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.bk-chat-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.bk-chat-chip-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bk-chat-chip-icon svg { width: 16px; height: 16px; display: block; }
.bk-chat-chip-label { font-size: 10.5px; font-weight: 650; color: #2c2519; line-height: 1.15; text-align: center; }
.bk-chat-chip.bk-line .bk-chat-chip-icon { background: #06C755; }
.bk-chat-chip.bk-line:hover { border-color: #06C755; }
.bk-chat-chip.bk-wa .bk-chat-chip-icon { background: #25D366; }
.bk-chat-chip.bk-wa:hover { border-color: #25D366; }
.bk-chat-chip.bk-ig .bk-chat-chip-icon { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }
.bk-chat-chip.bk-ig:hover { border-color: #dc2743; }
.bk-chat-chip.bk-call .bk-chat-chip-icon { background: #2196F3; }
.bk-chat-chip.bk-call:hover { border-color: #2196F3; }

/* Quick-action tile grid (2x2) — Track order / Custom cake / Find by photo / Chat live */
.bk-tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.bk-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--bk-primary, #C4A265) 14%, #fff);
  border-radius: 14px;
  padding: 11px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.bk-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: var(--bk-primary); }
.bk-tile-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bk-primary, #C4A265) 15%, #fff);
  color: var(--bk-primary-dark, #a88a4f);
}
.bk-tile-icon svg { width: 18px; height: 18px; display: block; }
.bk-tile-title { font-weight: 700; font-size: 12.5px; color: #2c2519; line-height: 1.2; }
.bk-tile-desc { font-size: 10px; color: #8a7a65; margin-top: 1px; line-height: 1.2; }
.bk-tile.bk-tile-photo .bk-tile-icon { background: #efe7fa; color: #7a52c4; }
.bk-tile.bk-tile-live { background: var(--bk-live-soft, #E4F1EA); border-color: #CDE8D9; }
.bk-tile.bk-tile-live .bk-tile-icon { background: var(--bk-live, #3E9E6E); color: #fff; }
.bk-tile.bk-tile-live .bk-tile-title { color: var(--bk-live-deep, #256b49); }

/* ===== [v12.6] CHAT LIVE — welcome banner + staff message bubble ===== */
.bk-chat-live-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bk-live-soft, #E4F1EA);
  border: 1px solid #CDE8D9;
  border-radius: 13px;
  padding: 9px 11px;
  align-self: flex-start;
  max-width: 92%;
}
.bk-chat-live-banner-icon {
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--bk-live, #3E9E6E);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bk-chat-live-banner-icon svg { width: 15px; height: 15px; display: block; }
.bk-chat-live-banner-text { font-size: 12px; color: #4a5b52; line-height: 1.4; }
.bk-chat-live-banner-text b { color: var(--bk-live-deep, #256b49); }

/* Staff bubble — distinct green tint + sender name label, so a human reply is never mistaken
   for Basil. Reuses the existing .bk-chat-msg / .bk-chat-msg-wrap layout (max-width, spacing,
   feedback-button slot) — only the `.staff` modifier below changes colors. */
.bk-chat-msg.bot.staff {
  background: #EAF4EE;
  border-color: #CDE8D9;
  color: #234b3a;
}
.bk-chat-staff-sender {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--bk-live, #3E9E6E);
  letter-spacing: 0.2px;
  margin: 0 0 3px 4px;
}

@media (max-width: 480px) {
  .bk-tile { padding: 10px; gap: 8px; }
  .bk-tile-icon { width: 30px; height: 30px; }
  .bk-chat-chip { padding: 8px 3px 7px; }
}
