/* ==========================================================================
   buy-chat.css — "Henry" buying chat widget (v2 · 2026-09-30)
   Used on /sell-memory-ssds.php and in the homepage section. Self-contained:
   site palette (forest / green / lime), Outfit + DM Sans, light + dark theme
   (html[data-theme="dark"]). Page layout lives in sell-v3.css / home-v3.css.
   Logic: assets/js/buy-chat.js. Every animation respects reduced motion.
   ========================================================================== */

[data-buy-chat], .bc-layer {
  --bc-ink: #07130b; --bc-ink-2: #26352b; --bc-muted: #56665b; --bc-line: #e2e8df; --bc-tint: #f3f7f0;
  --bc-paper: #ffffff; --bc-log: #f6f9f4; --bc-field: #f4f7f2;
  --bc-green: #0fa24a; --bc-green-dk: #087a35; --bc-forest: #05200d; --bc-forest-2: #0a3317; --bc-lime: #b9f24a; --bc-lime-2: #86df3f;
  --bc-glow: rgba(15, 162, 74, .45);
  --bc-display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bc-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bc-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --bc-ease: cubic-bezier(.2, .8, .2, 1);
  --bc-safe-b: env(safe-area-inset-bottom, 0px);
}
html[data-theme="dark"] [data-buy-chat], html[data-theme="dark"] .bc-layer {
  --bc-ink: #eef6ef; --bc-ink-2: #cfe0d3; --bc-muted: #9fb3a5; --bc-line: rgba(255, 255, 255, .1); --bc-tint: rgba(255, 255, 255, .05);
  --bc-paper: #0b1a10; --bc-log: #07140b; --bc-field: #10241a;
}
[data-buy-chat] *, .bc-layer * { box-sizing: border-box; }
[data-buy-chat] [hidden], .bc-layer [hidden] { display: none !important; }
html.bc-lock { overflow: hidden; }
.bc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Reserve the card's height before the script mounts it (no layout shift). */
[data-buy-chat] { position: relative; min-height: 600px; font-family: var(--bc-body); color: var(--bc-ink); }
[data-buy-chat][data-ready] { min-height: 0; }

/* ── Card ──────────────────────────────────────────────────────────────── */
.bc-chat {
  position: relative; display: flex; flex-direction: column;
  background: var(--bc-paper); border-radius: 28px; overflow: hidden;
  border: 1px solid var(--bc-line);
  box-shadow: 0 40px 90px -30px rgba(5, 32, 13, .55), 0 12px 30px -14px rgba(5, 32, 13, .3);
  scroll-margin-top: 90px; font-family: var(--bc-body); color: var(--bc-ink);
  text-align: left; line-height: 1.45;
}
.bc-chat::before {
  /* slow lime edge that orbits the card */
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 4;
  background: conic-gradient(from var(--bc-angle, 0deg), transparent 0 68%, var(--bc-green) 78%, var(--bc-lime) 84%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: bcSpin 7s linear infinite; opacity: .95;
}
@property --bc-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes bcSpin { to { --bc-angle: 360deg; } }
.bc-chat button, .bc-layer button { font: inherit; cursor: pointer; }

/* header */
.bc-chat-head {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 16px; color: #fff;
  background: radial-gradient(120% 160% at 0% 0%, #0f4a22 0%, var(--bc-forest) 60%), var(--bc-forest);
}
.bc-chat-head::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185, 242, 74, .5), transparent);
}
.bc-avatar {
  position: relative; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff, #e7f6e3); box-shadow: 0 0 0 3px rgba(185, 242, 74, .55), 0 8px 18px -6px rgba(0, 0, 0, .5);
  animation: bcBob 4.5s ease-in-out infinite;
}
.bc-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.bc-avatar::after {
  content: ''; position: absolute; right: -1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bc-lime); border: 2.5px solid var(--bc-forest); animation: bcLive 2.2s infinite;
}
@keyframes bcBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-3deg); } }
@keyframes bcLive { 0% { box-shadow: 0 0 0 0 rgba(185, 242, 74, .7); } 70% { box-shadow: 0 0 0 9px rgba(185, 242, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(185, 242, 74, 0); } }
.bc-head-txt { min-width: 0; flex: 1; }
.bc-head-title { font: 800 19px/1.1 var(--bc-display); letter-spacing: -.02em; }
.bc-head-sub { margin-top: 3px; font-size: 12.5px; font-weight: 600; color: #d8f7b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-on { display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--bc-lime); vertical-align: middle; }
.bc-head-sub .bc-pill { margin-left: 4px; }
.bc-head-btn {
  position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 40px; padding: 0 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #fff;
  font-size: 13px; font-weight: 700; transition: background .2s;
}
.bc-head-btn:hover { background: rgba(185, 242, 74, .18); }
.bc-head-btn svg { width: 17px; height: 17px; }
.bc-count {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--bc-lime); color: var(--bc-forest); font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.bc-count.alert { background: #ffc53d; animation: bcPop .5s ease; }
.bc-min, .bc-head-lbl { display: none; }

/* policy strip */
.bc-policy {
  display: flex; gap: 6px; padding: 9px 12px; overflow-x: auto; scrollbar-width: none;
  background: var(--bc-tint); border-bottom: 1px solid var(--bc-line);
}
.bc-policy::-webkit-scrollbar { display: none; }
.bc-policy span {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; background: var(--bc-paper); border: 1px solid var(--bc-line);
  font-size: 12px; font-weight: 600; color: var(--bc-muted); white-space: nowrap;
}
.bc-policy b { color: var(--bc-green-dk); font: 800 12.5px/1 var(--bc-display); letter-spacing: .01em; }
html[data-theme="dark"] .bc-policy b { color: var(--bc-lime); }

/* progress */
.bc-progress { position: relative; height: 4px; background: var(--bc-line); overflow: hidden; }
.bc-progress i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, var(--bc-green), var(--bc-lime));
  transition: width .6s var(--bc-ease);
}
.bc-progress i::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  background-size: 50% 100%; background-repeat: no-repeat; animation: bcBar 1.8s linear infinite;
}
@keyframes bcBar { from { background-position: -60% 0; } to { background-position: 160% 0; } }

/* log */
.bc-log {
  position: relative; flex: 1 1 auto; height: clamp(260px, 40dvh, 440px);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 16px 14px 8px; scroll-behavior: smooth; outline: none;
  background-color: var(--bc-log);
  background-image: radial-gradient(rgba(15, 162, 74, .09) 1px, transparent 1.4px);
  background-size: 18px 18px;
}
html[data-theme="dark"] .bc-log { background-image: radial-gradient(rgba(185, 242, 74, .06) 1px, transparent 1.4px); }

.bc-row { display: flex; gap: 9px; margin: 0 0 12px; align-items: flex-end; animation: bcIn .4s cubic-bezier(.2, .9, .3, 1.2) both; }
.bc-row.me { justify-content: flex-end; }
.bc-row.sys { justify-content: center; }
@keyframes bcIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.bc-mini {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #fff, #e7f6e3); box-shadow: 0 0 0 2px rgba(15, 162, 74, .35);
}
.bc-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-mini.team { display: grid; place-items: center; background: var(--bc-forest); color: var(--bc-lime); box-shadow: 0 0 0 2px rgba(185, 242, 74, .4); }
.bc-mini.team svg { width: 17px; height: 17px; }
.bc-bubble {
  max-width: min(84%, 540px); padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.bc-row.ai .bc-bubble { background: var(--bc-paper); color: var(--bc-ink); border: 1px solid var(--bc-line); border-bottom-left-radius: 6px; box-shadow: 0 4px 14px -8px rgba(5, 32, 13, .25); }
.bc-row.me .bc-bubble { background: var(--bc-green-dk); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 8px 18px -10px rgba(8, 122, 53, .8); }
.bc-row.team .bc-bubble { background: var(--bc-forest); color: #eafff1; border-bottom-left-radius: 6px; }
.bc-row.sys .bc-bubble { background: transparent; color: var(--bc-muted); font-size: 12.5px; padding: 2px 8px; text-align: center; }
.bc-bubble p { margin: 0 0 8px; }
.bc-bubble p:last-child { margin: 0; }
.bc-bubble ul { margin: 4px 0 8px; padding-left: 18px; }
.bc-bubble li { margin: 2px 0; }
.bc-bubble a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.bc-row.ai .bc-bubble a { color: var(--bc-green-dk); }
html[data-theme="dark"] .bc-row.ai .bc-bubble a { color: var(--bc-lime); }
.bc-bubble strong { font-weight: 800; }
.bc-tag { display: block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 4px; }
.bc-row.team .bc-tag { color: var(--bc-lime); }
.bc-row.me .bc-tag { color: #dcfce7; }
.bc-time { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; }
.bc-cap { padding: 6px 6px 2px; }

/* typing */
.bc-typing .bc-bubble { display: inline-flex; align-items: center; gap: 9px; }
.bc-dots { display: inline-flex; gap: 4px; }
.bc-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--bc-green); animation: bcDot 1.1s infinite ease-in-out; }
.bc-dots i:nth-child(2) { animation-delay: .15s; }
.bc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bcDot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-5px); opacity: 1; } }
.bc-typing-lbl { font-size: 13px; color: var(--bc-muted); }

/* photos */
.bc-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 2px; min-width: 190px; }
.bc-row.me .bc-bubble.has-photos { background: #e3f5e5; color: var(--bc-ink); padding: 6px; }
html[data-theme="dark"] .bc-row.me .bc-bubble.has-photos { background: #12321d; color: #eef6ef; }
.bc-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #d6e4d9; border: 0; padding: 0; }
.bc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-ring { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4, 18, 10, .45); transition: opacity .3s; }
.bc-thumb.done .bc-ring { opacity: 0; pointer-events: none; }
.bc-ring svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.bc-ring circle { fill: none; stroke-width: 4; }
.bc-ring .bg { stroke: rgba(255, 255, 255, .25); }
.bc-ring .fg { stroke: var(--bc-lime); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .25s; }
.bc-thumb.scanning::after {
  /* Henry "reading the labels" scanline */
  content: ''; position: absolute; left: 0; right: 0; height: 36%; top: -36%;
  background: linear-gradient(180deg, transparent, rgba(185, 242, 74, .5) 85%, #e8ffc2);
  border-bottom: 2px solid var(--bc-lime); box-shadow: 0 6px 16px rgba(185, 242, 74, .6);
  animation: bcScan 1.5s ease-in-out infinite;
}
.bc-thumb.scanning::before {
  content: ''; position: absolute; inset: 6px; border-radius: 6px; z-index: 1;
  background:
    linear-gradient(var(--bc-lime), var(--bc-lime)) left top / 12px 2px no-repeat, linear-gradient(var(--bc-lime), var(--bc-lime)) left top / 2px 12px no-repeat,
    linear-gradient(var(--bc-lime), var(--bc-lime)) right top / 12px 2px no-repeat, linear-gradient(var(--bc-lime), var(--bc-lime)) right top / 2px 12px no-repeat,
    linear-gradient(var(--bc-lime), var(--bc-lime)) left bottom / 12px 2px no-repeat, linear-gradient(var(--bc-lime), var(--bc-lime)) left bottom / 2px 12px no-repeat,
    linear-gradient(var(--bc-lime), var(--bc-lime)) right bottom / 12px 2px no-repeat, linear-gradient(var(--bc-lime), var(--bc-lime)) right bottom / 2px 12px no-repeat;
  animation: bcCorners 1.5s ease-in-out infinite;
}
@keyframes bcScan { 0% { top: -36%; } 100% { top: 100%; } }
@keyframes bcCorners { 0%, 100% { inset: 6px; opacity: 1; } 50% { inset: 10px; opacity: .6; } }
.bc-ok {
  position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--bc-lime); color: var(--bc-forest);
  display: grid; place-items: center; transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.bc-thumb.done .bc-ok { transform: scale(1); }
.bc-ok svg { width: 13px; height: 13px; }
.bc-detected { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.bc-detected span { font-size: 11.5px; font-weight: 700; color: #0b5a2a; background: #dcfce7; border-radius: 7px; padding: 3px 7px; animation: bcPop .4s ease both; }

/* quick replies */
.bc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px 43px; }
.bc-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 9px 15px; border-radius: 999px;
  border: 1.5px solid rgba(15, 162, 74, .35); background: var(--bc-paper); color: var(--bc-green-dk);
  font-weight: 700; font-size: 14.5px; line-height: 1.2;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .2s;
  animation: bcPop .4s cubic-bezier(.3, 1.5, .5, 1) both;
}
html[data-theme="dark"] .bc-chip { color: var(--bc-lime); border-color: rgba(185, 242, 74, .35); }
.bc-chip:nth-child(2) { animation-delay: .06s; } .bc-chip:nth-child(3) { animation-delay: .12s; }
.bc-chip:nth-child(4) { animation-delay: .18s; } .bc-chip:nth-child(5) { animation-delay: .24s; }
.bc-chip:hover { background: #effbe9; border-color: var(--bc-green); box-shadow: 0 6px 14px -8px var(--bc-glow); transform: translateY(-1px); }
html[data-theme="dark"] .bc-chip:hover { background: rgba(185, 242, 74, .1); }
.bc-chip:active { transform: scale(.96); }
.bc-chip.primary { background: var(--bc-lime); border-color: transparent; color: var(--bc-forest); }
.bc-chip svg { width: 17px; height: 17px; flex: 0 0 auto; }
@keyframes bcPop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* action cards */
.bc-card {
  margin: 0 0 12px 43px; max-width: 520px; padding: 12px; border-radius: 18px;
  background: var(--bc-paper); border: 1px solid var(--bc-line); box-shadow: 0 10px 24px -16px rgba(5, 32, 13, .4);
  animation: bcIn .4s ease both;
}
.bc-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bc-card-row { margin-top: 10px; }
.bc-card-q { margin: 0 0 6px; font-weight: 700; color: var(--bc-ink); }
.bc-note { margin: 8px 0 0; font-size: 12px; color: var(--bc-muted); }
.bc-card.photo-tip { display: inline-block; padding: 8px; }
.bc-card.photo-tip .bc-card-actions { flex-wrap: nowrap; }
.bc-card.photo-tip .bc-btn { min-height: 44px; padding: 8px 15px; }
.bc-inline-form { display: flex; gap: 8px; margin-top: 8px; }
.bc-inline-form input { flex: 1; min-width: 0; }

/* buttons */
.bc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 17px; border-radius: 999px; border: 1.5px solid var(--bc-line);
  background: var(--bc-paper); color: var(--bc-ink); font: 700 14.5px/1.15 var(--bc-body); text-decoration: none;
  transition: transform .15s var(--bc-ease), background .15s, border-color .15s, box-shadow .2s;
}
.bc-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.bc-btn:hover { transform: translateY(-1px); }
.bc-btn:active { transform: scale(.97); }
.bc-btn.go { background: var(--bc-green-dk); border-color: var(--bc-green-dk); color: #fff; box-shadow: 0 10px 22px -12px rgba(8, 122, 53, .9); }
.bc-btn.go:hover { background: #066a2d; }
.bc-btn.lime { background: var(--bc-lime); border-color: var(--bc-lime); color: var(--bc-forest); }
.bc-btn.ghost:hover { border-color: var(--bc-green); background: var(--bc-tint); }
.bc-btn[disabled] { opacity: .55; pointer-events: none; }
.bc-btn.block { width: 100%; }

/* quotes list */
.bc-quotes { display: grid; gap: 8px; }
.bc-q {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; width: 100%; text-align: left;
  padding: 11px 13px; border-radius: 14px; border: 1px solid var(--bc-line); background: var(--bc-paper); color: var(--bc-ink);
  transition: border-color .15s, box-shadow .2s, transform .12s;
}
.bc-q:hover { border-color: var(--bc-green); box-shadow: 0 8px 18px -12px var(--bc-glow); }
.bc-q-num { font-family: var(--bc-mono); font-size: 12.5px; font-weight: 700; color: var(--bc-green-dk); }
html[data-theme="dark"] .bc-q-num { color: var(--bc-lime); }
.bc-q-head { grid-column: 1; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-q-meta { grid-column: 1; font-size: 12px; color: var(--bc-muted); }
.bc-q-side { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bc-pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #eef2ef; color: #3f4d45; white-space: nowrap; }
.bc-pill.received, .bc-pill.done { background: #dcfce7; color: #166534; }
.bc-pill.review { background: #e0f2fe; color: #075985; }
.bc-pill.discussion { background: #fef3c7; color: #92400e; }
.bc-pill.draft { background: #f1f5f2; color: #52605a; }
.bc-pill.closed { background: #f3f4f6; color: #6b7280; }
.bc-new-dot { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }

/* captured items strip */
.bc-items { display: none; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; background: var(--bc-paper); }
.bc-items::-webkit-scrollbar { display: none; }
.bc-items.show { display: flex; }
.bc-items-lbl { flex: 0 0 auto; align-self: center; font-size: 11px; font-weight: 800; color: var(--bc-muted); text-transform: uppercase; letter-spacing: .05em; }
.bc-item {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px;
  font-size: 12.5px; font-weight: 700; color: #0b5a2a; background: #effbe9; border: 1px solid #c9eebb; animation: bcPop .35s ease both;
}
html[data-theme="dark"] .bc-item { color: #d8f7b0; background: rgba(185, 242, 74, .08); border-color: rgba(185, 242, 74, .25); }
.bc-item svg { width: 15px; height: 15px; }
.bc-item i { font-style: normal; font-size: 11px; color: var(--bc-forest); background: var(--bc-lime); border-radius: 6px; padding: 1px 6px; }

/* ready-to-send bar */
.bc-ready {
  display: none; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 10px 10px 10px 12px; border-radius: 16px;
  background: linear-gradient(135deg, var(--bc-forest), var(--bc-forest-2)); color: #e8ffd0;
  box-shadow: 0 12px 26px -14px rgba(5, 32, 13, .9); animation: bcIn .45s ease both;
}
.bc-ready.show { display: flex; }
.bc-ready-txt { flex: 1; font-size: 14px; font-weight: 700; line-height: 1.3; }
.bc-ready-txt small { display: block; font-weight: 500; color: #b6d8a6; font-size: 12px; }
.bc-ready .bc-btn { min-height: 42px; padding: 8px 15px; white-space: nowrap; background: var(--bc-lime); border-color: var(--bc-lime); color: var(--bc-forest); box-shadow: none; }
.bc-check-anim { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--bc-lime); display: grid; place-items: center; color: var(--bc-forest); animation: bcPop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.bc-check-anim svg { width: 17px; height: 17px; }

/* photo tray — shots collect here (snap several, add from the gallery), then go out together */
.bc-tray {
  margin: 8px 12px 0; padding: 10px 10px 10px 12px; border-radius: 18px;
  background: var(--bc-tint); border: 1.5px dashed rgba(15, 162, 74, .45); animation: bcIn .35s ease both;
}
html[data-theme="dark"] .bc-tray { border-color: rgba(185, 242, 74, .35); }
.bc-tray-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.bc-tray-lbl { font: 800 14px/1.2 var(--bc-display); color: var(--bc-ink); }
.bc-tray-clear { border: 0; background: none; padding: 4px 2px; color: var(--bc-muted); font-size: 12.5px; font-weight: 700; text-decoration: underline; }
.bc-tray-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 8px; scrollbar-width: thin; scroll-behavior: smooth; }
.bc-tray-thumb { position: relative; flex: 0 0 68px; width: 68px; height: 68px; border-radius: 13px; overflow: visible; animation: bcPop .35s cubic-bezier(.3, 1.5, .5, 1) both; }
.bc-tray-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; display: block; box-shadow: 0 6px 14px -8px rgba(5, 32, 13, .6); }
.bc-tray-x {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--bc-paper);
  background: var(--bc-forest); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.bc-tray-x svg { width: 11px; height: 11px; }
.bc-tray-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bc-tray-actions .bc-btn { min-height: 44px; padding: 8px 14px; font-size: 14px; }
.bc-tray-actions .bc-tray-send { margin-left: auto; }
.bc-tray-send b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bc-lime); color: var(--bc-forest); font-size: 12px; }
.bc-chat.has-tray .bc-cam::before, .bc-chat.has-tray .bc-cam::after { animation: none; }
.bc-form-photos { margin: -4px 0 0; font-weight: 700; color: var(--bc-green-dk); }
html[data-theme="dark"] .bc-form-photos { color: var(--bc-lime); }
@media (max-width: 420px) {
  .bc-tray-actions .bc-btn { flex: 1 1 auto; padding: 8px 10px; }
  .bc-tray-actions .bc-tray-send { flex-basis: 100%; margin-left: 0; }
}

/* composer */
.bc-compose {
  position: relative; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 10px calc(10px + var(--bc-safe-b)); background: var(--bc-paper); border-top: 1px solid var(--bc-line);
}
.bc-cam {
  position: relative; flex: 0 0 50px; width: 50px; height: 50px; border-radius: 16px; border: 0;
  background: var(--bc-lime); color: var(--bc-forest); display: grid; place-items: center;
  box-shadow: 0 10px 20px -10px rgba(134, 223, 63, .9);
}
.bc-cam svg { width: 24px; height: 24px; }
.bc-cam::before, .bc-cam::after {
  content: ''; position: absolute; inset: -4px; border-radius: 19px; border: 2px solid var(--bc-lime); opacity: 0;
  animation: bcRing 2.4s ease-out infinite;
}
.bc-cam::after { animation-delay: 1.2s; }
.bc-cam.calm::before, .bc-cam.calm::after { animation: none; }
.bc-cam.nudge { animation: bcWiggle .9s ease 2; }
@keyframes bcRing { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes bcWiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg) scale(1.05); } 40% { transform: rotate(8deg) scale(1.05); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
.bc-attach {
  flex: 0 0 44px; width: 44px; height: 50px; border-radius: 14px; border: 1.5px solid var(--bc-line); background: var(--bc-paper); color: var(--bc-muted);
  display: grid; place-items: center; transition: color .15s, border-color .15s;
}
.bc-attach svg { width: 20px; height: 20px; }
.bc-attach:hover { color: var(--bc-green-dk); border-color: var(--bc-green); }
.bc-field { position: relative; flex: 1; min-width: 0; }
.bc-input {
  display: block; width: 100%; min-height: 50px; max-height: 140px; resize: none; padding: 13px 15px; border-radius: 16px;
  border: 1.5px solid var(--bc-line); background: var(--bc-field); color: var(--bc-ink);
  font: 400 16px/1.35 var(--bc-body); outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.bc-input::placeholder { color: var(--bc-muted); opacity: .9; }
.bc-input:focus { border-color: var(--bc-green); background: var(--bc-paper); box-shadow: 0 0 0 4px rgba(15, 162, 74, .16); }
.bc-send {
  flex: 0 0 50px; width: 50px; height: 50px; border-radius: 16px; border: 0; background: var(--bc-forest); color: var(--bc-lime);
  display: grid; place-items: center; transition: transform .12s, background .15s;
}
.bc-send svg { width: 21px; height: 21px; }
.bc-send:disabled { background: #d3ddd5; color: #fff; }
html[data-theme="dark"] .bc-send { background: var(--bc-lime); color: var(--bc-forest); }
html[data-theme="dark"] .bc-send:disabled { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .5); }
.bc-send:not(:disabled):hover { transform: translateY(-1px); }
.bc-send:not(:disabled):active { transform: scale(.94); }
.bc-foot-links { display: flex; justify-content: space-between; gap: 10px; padding: 0 14px 11px; background: var(--bc-paper); font-size: 12.5px; }
.bc-foot-links button, .bc-foot-links a { background: none; border: 0; padding: 0; color: var(--bc-muted) !important; text-decoration: underline; font-size: 12.5px; }
.bc-foot-links button:hover, .bc-foot-links a:hover { color: var(--bc-green-dk) !important; }
/* the assistant is offline: point at "Prefer a quick form?" (it never opens by itself) */
.bc-foot-links button.bc-attn { color: var(--bc-green-dk) !important; font-weight: 800; text-decoration-thickness: 2px; animation: bcAttn 1.1s ease 3; }
html[data-theme="dark"] .bc-foot-links button.bc-attn { color: var(--bc-lime) !important; }
@keyframes bcAttn { 0%, 100% { transform: none; } 30% { transform: translateY(-2px) scale(1.08); } 60% { transform: none; } }
.bc-chat :focus-visible, .bc-layer :focus-visible { outline: 3px solid var(--bc-green); outline-offset: 2px; }

/* drag & drop */
.bc-drop {
  position: absolute; inset: 0; z-index: 6; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
  background: rgba(5, 32, 13, .84); color: #fff; font: 800 19px/1.2 var(--bc-display); border-radius: inherit;
  border: 3px dashed var(--bc-lime); backdrop-filter: blur(3px);
}
.bc-drop svg { width: 46px; height: 46px; color: var(--bc-lime); animation: bcBob 2s ease-in-out infinite; }
.bc-chat.dragging .bc-drop { display: flex; }

/* ── Floating bar (sell page, phones, chat off screen) ─────────────────── */
.bc-fab {
  position: fixed; left: 12px; right: 12px; bottom: calc(82px + var(--bc-safe-b)); z-index: 120;
  display: flex; gap: 8px; padding: 8px; border-radius: 22px;
  background: rgba(5, 32, 13, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .55); border: 1px solid rgba(185, 242, 74, .28);
  transform: translateY(calc(100% + 120px)); opacity: 0; visibility: hidden;
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.1), opacity .3s, visibility 0s .4s;
}
/* pages without the site quick-action bar: sit on the bottom edge */
body[data-no-quickbar] .bc-fab { bottom: calc(12px + var(--bc-safe-b)); }
.bc-fab.show { transform: none; opacity: 1; visibility: visible; transition: transform .4s cubic-bezier(.2, .9, .3, 1.1), opacity .3s; }
.bc-fab .bc-btn { flex: 1; min-height: 50px; }
.bc-fab .bc-btn.go { background: var(--bc-lime); border-color: var(--bc-lime); color: var(--bc-forest); }
.bc-fab .bc-btn.ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .2); }

/* ── Sheets ─────────────────────────────────────────────────────────────── */
.bc-sheet { position: fixed; inset: 0; z-index: 1300; display: none; font-family: var(--bc-body); color: var(--bc-ink); }
.bc-sheet.open { display: block; }
.bc-sheet-bg { position: absolute; inset: 0; background: rgba(3, 15, 7, .62); backdrop-filter: blur(4px); animation: bcFade .25s ease both; }
@keyframes bcFade { from { opacity: 0; } }
.bc-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bc-paper); border-radius: 26px 26px 0 0; padding: 8px 18px calc(20px + var(--bc-safe-b));
  animation: bcUp .4s cubic-bezier(.2, .9, .3, 1.05) both; line-height: 1.45;
}
@keyframes bcUp { from { transform: translateY(100%); } }
.bc-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--bc-line); margin: 4px auto 14px; }
.bc-sheet h3 { margin: 0 0 4px; padding-right: 44px; font: 800 22px/1.15 var(--bc-display); letter-spacing: -.02em; color: var(--bc-ink); }
.bc-sheet .sub { margin: 0 0 14px; color: var(--bc-muted); font-size: 14.5px; }
.bc-sheet-foot { margin-top: 14px; }
.bc-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--bc-tint); color: var(--bc-muted); display: grid; place-items: center; }
.bc-x svg { width: 18px; height: 18px; }
.bc-sum { margin: 0 0 14px; border: 1px solid var(--bc-line); border-radius: 16px; overflow: hidden; }
.bc-sum-row { display: grid; grid-template-columns: 100px 1fr; gap: 8px; padding: 11px 13px; font-size: 14.5px; border-top: 1px solid var(--bc-line); }
.bc-sum-row:first-child { border-top: 0; }
.bc-sum-row dt { padding-top: 1px; color: var(--bc-muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.bc-sum-row dd { margin: 0; font-weight: 600; }
.bc-sum-row dd ul { margin: 0; padding-left: 16px; }
.bc-consent { margin: 10px 0 14px; font-size: 12.5px; color: var(--bc-muted); }
.bc-consent a { color: var(--bc-green-dk); }
html[data-theme="dark"] .bc-consent a { color: var(--bc-lime); }
.bc-check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 11px 13px; border-radius: 13px; background: var(--bc-tint); font-size: 13.5px; cursor: pointer; }
.bc-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--bc-green-dk); flex: 0 0 auto; }
.bc-check small { color: var(--bc-muted); }

.bc-form { display: grid; gap: 13px; }
.bc-form > label:not(.bc-check), .bc-form-2 > label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--bc-ink-2); }
.bc-form label small { font-weight: 500; color: var(--bc-muted); }
.bc-inp, .bc-form textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--bc-line); background: var(--bc-field);
  font: 400 16px/1.35 var(--bc-body); color: var(--bc-ink); outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.bc-inp:focus, .bc-form textarea:focus { border-color: var(--bc-green); background: var(--bc-paper); box-shadow: 0 0 0 4px rgba(15, 162, 74, .16); }
.bc-form textarea { min-height: 96px; resize: vertical; }
.bc-form-2 { display: grid; gap: 13px; }
.bc-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.bc-seg legend { margin-bottom: 7px; padding: 0; font-size: 13.5px; font-weight: 700; color: var(--bc-ink-2); }
.bc-seg label { position: relative; cursor: pointer; }
.bc-seg input { position: absolute; opacity: 0; pointer-events: none; }
.bc-seg span {
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; min-height: 58px; padding: 9px 12px;
  border-radius: 14px; border: 1.5px solid var(--bc-line); background: var(--bc-paper); font-weight: 800; font-size: 14px; color: var(--bc-ink);
  transition: border-color .15s, background .15s, box-shadow .2s;
}
.bc-seg span svg { grid-row: 1 / span 2; width: 22px; height: 22px; color: var(--bc-green-dk); }
.bc-seg span small { grid-column: 2; font-weight: 600; font-size: 12px; color: var(--bc-muted); }
.bc-seg input:checked + span { border-color: var(--bc-green); background: #effbe9; box-shadow: 0 0 0 3px rgba(15, 162, 74, .14); }
html[data-theme="dark"] .bc-seg input:checked + span { background: rgba(185, 242, 74, .08); }
.bc-seg input:focus-visible + span { outline: 3px solid var(--bc-green); outline-offset: 2px; }
.bc-err { display: none; padding: 11px 13px; border-radius: 13px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 13.5px; font-weight: 600; }
.bc-err.show { display: block; }

.bc-light { position: fixed; inset: 0; z-index: 1400; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .9); }
.bc-light.open { display: flex; animation: bcFade .2s ease both; }
.bc-light img { max-width: 100%; max-height: 88dvh; border-radius: 12px; }
.bc-light .bc-x { background: rgba(255, 255, 255, .15); color: #fff; }

/* success */
.bc-burst { position: fixed; inset: 0; z-index: 1450; pointer-events: none; overflow: hidden; }
.bc-burst i { position: absolute; top: 45%; left: 50%; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: bcConf 1.4s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes bcConf { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); } }
.bc-success { text-align: center; padding: 6px 4px 2px; }
.bc-success-ic { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; background: var(--bc-lime); color: var(--bc-forest); display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(185, 242, 74, .2); animation: bcPop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.bc-success-ic svg { width: 34px; height: 34px; }
.bc-success-ic path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: bcDraw .5s .25s ease forwards; }
@keyframes bcDraw { to { stroke-dashoffset: 0; } }
.bc-success .num { display: inline-block; margin: 4px 0 8px; padding: 4px 10px; border-radius: 9px; font: 800 16px/1.3 var(--bc-mono); color: #0b5a2a; background: #dcfce7; }

.bc-toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--bc-safe-b)); z-index: 1500; max-width: calc(100% - 32px);
  padding: 11px 17px; border-radius: 14px; background: var(--bc-forest); color: #fff; font: 600 14px/1.35 var(--bc-body);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); pointer-events: none;
  opacity: 0; transform: translateX(-50%) translateY(20px); transition: opacity .25s, transform .25s;
}
.bc-toast.show { opacity: 1; transform: translateX(-50%); }

/* ── Phones: the chat becomes a full-screen messenger while in use ─────── */
@media (max-width: 759px) {
  [data-buy-chat] { min-height: 560px; }
  body.bc-focus .bc-chat {
    position: fixed; left: 0; right: 0; top: var(--bc-vt, 0px); height: var(--bc-vh, 100dvh); z-index: 1200;
    border-radius: 0; border: 0; box-shadow: none; animation: bcFocusIn .3s cubic-bezier(.2, .9, .3, 1) both;
  }
  body.bc-focus .bc-chat::before { display: none; }
  body.bc-focus .bc-log { height: auto; flex: 1 1 auto; }
  body.bc-focus .bc-min { display: inline-flex; }
  body.bc-focus .bc-fab { display: none; }
  body.bc-focus .bc-chat-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  @keyframes bcFocusIn { from { opacity: .6; transform: translateY(24px); } }
  .bc-chips, .bc-card { margin-left: 0; }
  .bc-chat { border-radius: 24px; }
  .bc-log { height: clamp(250px, 46dvh, 400px); padding: 14px 10px 6px; }
}
@media (max-width: 420px) {
  .bc-compose { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .bc-cam, .bc-send { flex-basis: 48px; width: 48px; height: 48px; }
  .bc-attach { flex-basis: 40px; width: 40px; height: 48px; }
  .bc-input { min-height: 48px; padding: 12px; }
  .bc-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bc-chat-head { gap: 10px; padding-left: 12px; }
  .bc-head-btn { padding: 0 10px; }
}

/* ── Tablet / desktop ───────────────────────────────────────────────────── */
@media (min-width: 560px) {
  .bc-form-2 { grid-template-columns: 1fr 1fr; }
  .bc-seg { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 760px) {
  .bc-head-lbl { display: inline; }
  .bc-log { height: 440px; padding: 18px 18px 8px; }
  .bc-sheet-panel {
    left: 50%; right: auto; bottom: auto; top: 50%; width: min(600px, calc(100% - 40px)); max-height: 88vh;
    border-radius: 26px; transform: translate(-50%, -50%); animation: bcZoom .3s cubic-bezier(.2, .9, .3, 1.1) both;
  }
  @keyframes bcZoom { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
  .bc-grab, .bc-fab { display: none; }
}
@media (min-width: 1100px) { .bc-log { height: 470px; } }

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-buy-chat] *, [data-buy-chat] *::before, [data-buy-chat] *::after,
  .bc-layer *, .bc-layer *::before, .bc-layer *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .bc-chat::before { display: none; }
}
