/* Buddy chat. Light by default; dark follows html[data-theme="dark"].
   Phones: the chat list and a conversation are two screens; the conversation slides over the list
   (swipe from the left edge to go back). Wide screens: both side by side. */
.bc-root, .bc-pick-wrap, .bc-banner {
  --c-bg: #ffffff; --c-bg-2: #f4f4f6; --c-bg-3: #e9e9ec; --c-text: #0b0b0c; --c-text-2: #54545a; --c-text-3: #8e8e93;
  --c-line: #e6e6ea; --c-me: var(--aria-bubble, #0a6cf0); --c-on-me: #ffffff; --c-them: #e9e9eb; --c-on-them: #0b0b0c;
  --c-ok: #16a34a; --c-bad: #dc2626; --c-dot: #22c55e; --c-accent: #0b0b0c; --c-on-accent: #ffffff;
  --c-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 2px 10px rgba(0, 0, 0, 0.06);
  --c-ease: cubic-bezier(0.32, 0.72, 0, 1); --c-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  font-family: var(--ag-font, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif);
  color: var(--c-text); -webkit-font-smoothing: antialiased;
}
html[data-theme="dark"] .bc-root, html[data-theme="dark"] .bc-pick-wrap, html[data-theme="dark"] .bc-banner {
  --c-bg: #0f0f11; --c-bg-2: #1a1a1d; --c-bg-3: #26262a; --c-text: #f5f5f7; --c-text-2: #b5b5bb; --c-text-3: #7d7d84;
  --c-line: #26262a; --c-them: #26252a; --c-on-them: #f5f5f7; --c-ok: #4ade80; --c-bad: #f87171; --c-accent: #ffffff; --c-on-accent: #0b0b0c;
  --c-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.bc-root *, .bc-pick-wrap *, .bc-banner * { box-sizing: border-box; }
.bc-root button, .bc-pick-wrap button, .bc-banner button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bc-root [hidden], .bc-pick-wrap [hidden] { display: none !important; }

/* ---------- shell ---------- */
.bc-scrim { position: fixed; inset: 0; z-index: 1250; background: rgba(0, 0, 0, 0.34); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.bc-root.is-open .bc-scrim { opacity: 1; pointer-events: auto; }
.bc-panel {
  position: fixed; z-index: 1260; top: 12px; right: 12px; bottom: 12px; width: min(880px, calc(100vw - 24px));
  display: flex; overflow: hidden; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 26px; box-shadow: var(--c-shadow);
  opacity: 0; transform: translateY(14px) scale(0.985); visibility: hidden; pointer-events: none;
  transition: opacity 0.26s ease, transform 0.42s var(--c-ease), visibility 0s linear 0.42s;
}
.bc-root.is-open .bc-panel { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 0.26s ease, transform 0.42s var(--c-ease), visibility 0s; }

.bc-pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--c-bg); }
.bc-list-pane { width: 320px; flex-shrink: 0; border-right: 1px solid var(--c-line); }
.bc-thread-pane { flex: 1; }

.bc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 10px 8px 20px; }
.bc-head h2 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.025em; }
.bc-head-actions { display: flex; gap: 2px; }
.bc-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--c-text-2) !important; transition: background-color 0.15s ease, transform 0.15s ease; }
.bc-icon:hover { background: var(--c-bg-2); color: var(--c-text) !important; }
.bc-icon:active { transform: scale(0.92); }
.bc-icon svg { width: 20px; height: 20px; }
.bc-icon.is-on { color: var(--c-text) !important; background: var(--c-bg-2); }

.bc-search { margin: 4px 14px 8px; position: relative; }
.bc-search input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 12px; border: 0 !important; outline: none !important; box-shadow: none !important; background: var(--c-bg-2) !important; color: var(--c-text) !important; font: 15px inherit; font-family: inherit; }
.bc-search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--c-text-3); pointer-events: none; }

.bc-threads { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 8px 10px; }
.bc-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 16px; background: transparent; text-align: left; transition: background-color 0.15s ease, transform 0.15s ease; }
.bc-row:hover { background: var(--c-bg-2); }
.bc-row:active { transform: scale(0.985); }
.bc-row.is-active { background: var(--c-bg-2); }
.bc-row-main { flex: 1; min-width: 0; }
.bc-row-top { display: flex; align-items: baseline; gap: 8px; }
.bc-row-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15.5px; font-weight: 650; }
.bc-row-time { flex-shrink: 0; font-size: 12.5px; color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.bc-row-sub { display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.bc-row-last { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; color: var(--c-text-3); }
.bc-row.is-unread .bc-row-last { color: var(--c-text); font-weight: 600; }
.bc-row.is-unread .bc-row-time { color: var(--c-me); font-weight: 600; }
.bc-badge { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--c-me); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; animation: bc-bump 0.45s var(--c-spring); }
.bc-streak { flex-shrink: 0; font-size: 12px; font-weight: 700; color: #c2410c; }
html[data-theme="dark"] .bc-streak { color: #fdba74; }
@keyframes bc-bump { 0% { transform: scale(0.4); } 60% { transform: scale(1.15); } }

.bc-av { position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--c-bg-3), var(--c-bg-2)); font-size: 16px; font-weight: 700; color: var(--c-text-2); }
.bc-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bc-av.sm { width: 36px; height: 36px; font-size: 13px; }
.bc-av.xs { width: 28px; height: 28px; font-size: 11px; }
.bc-dot { position: absolute; right: 0; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; background: var(--c-dot); border: 2.5px solid var(--c-bg); transform: scale(0); transition: transform 0.35s var(--c-spring); }
.bc-av.sm .bc-dot { width: 11px; height: 11px; }
.is-online .bc-dot { transform: scale(1); }

.bc-foot { margin: 0; padding: 10px 18px 14px; font-size: 12px; line-height: 1.45; color: var(--c-text-3); border-top: 1px solid var(--c-line); }
.bc-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 22px; text-align: center; color: var(--c-text-2); }
.bc-empty-art { font-size: 44px; line-height: 1; animation: bc-float 3s ease-in-out infinite; }
.bc-empty b { font-size: 17px; color: var(--c-text); }
.bc-empty p { margin: 0; font-size: 14px; line-height: 1.5; max-width: 30ch; }
@keyframes bc-float { 50% { transform: translateY(-6px); } }
.bc-btn { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-bg); font-size: 14px; font-weight: 650; transition: transform 0.15s ease, background-color 0.15s ease; }
.bc-btn:hover { background: var(--c-bg-2); }
.bc-btn:active { transform: scale(0.96); }
.bc-btn.is-primary { background: var(--c-accent); color: var(--c-on-accent) !important; border-color: var(--c-accent); }
.bc-btn.is-blue { background: var(--c-me); color: #fff !important; border-color: var(--c-me); }
.bc-btn.sm { height: 32px; padding: 0 13px; font-size: 13px; }

/* ---------- conversation ---------- */
.bc-thead { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 10px 10px 8px; border-bottom: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); z-index: 2; }
.bc-back { display: none; }
.bc-thead-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bc-thead-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; font-weight: 700; }
.bc-thead-status { font-size: 12.5px; color: var(--c-text-3); transition: color 0.2s ease; }
.bc-thead-status.is-live { color: var(--c-ok); }
.bc-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px 8px; scroll-behavior: auto; }
.bc-msgs { display: flex; flex-direction: column; }
.bc-more-old { align-self: center; margin: 4px 0 10px; }
.bc-day { position: sticky; top: 0; z-index: 1; align-self: center; margin: 12px 0 8px; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c-bg) 82%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 12px; font-weight: 600; color: var(--c-text-3); }

.bc-msg { position: relative; display: flex; flex-direction: column; max-width: min(78%, 480px); margin-top: 2px; }
.bc-msg.me { align-self: flex-end; align-items: flex-end; }
.bc-msg.them { align-self: flex-start; align-items: flex-start; }
.bc-msg.is-first { margin-top: 10px; }
.bc-msg.is-new { animation: bc-in 0.42s var(--c-spring) both; }
.bc-msg.me.is-new { transform-origin: 100% 100%; }
.bc-msg.them.is-new { transform-origin: 0 100%; }
@keyframes bc-in { from { opacity: 0; transform: translateY(12px) scale(0.92); } }
.bc-bubble { position: relative; padding: 8px 13px; border-radius: 20px; font-size: 15.5px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; -webkit-touch-callout: none; transition: transform 0.2s var(--c-ease), opacity 0.2s ease, filter 0.2s ease; }
.me .bc-bubble { background: var(--c-me); color: var(--c-on-me); }
.them .bc-bubble { background: var(--c-them); color: var(--c-on-them); }
/* Joined corners for a run of messages from the same person. */
.me:not(.is-last) .bc-bubble { border-bottom-right-radius: 6px; }
.me:not(.is-first) .bc-bubble { border-top-right-radius: 6px; }
.them:not(.is-last) .bc-bubble { border-bottom-left-radius: 6px; }
.them:not(.is-first) .bc-bubble { border-top-left-radius: 6px; }
.bc-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bc-bubble.is-emoji { padding: 0 2px; background: none !important; font-size: 44px; line-height: 1.15; }
.bc-msg.is-pending .bc-bubble { opacity: 0.6; }
.bc-msg.is-failed .bc-bubble { background: var(--c-bad); }
.bc-fail { margin-top: 3px; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--c-bad) !important; }
.bc-bubble.is-unsent { background: none !important; border: 1px dashed var(--c-line); color: var(--c-text-3) !important; font-style: italic; font-size: 14px; }
.bc-msg.is-held .bc-bubble { transform: scale(0.97); filter: brightness(0.94); }
.bc-time { margin: 3px 6px 0; font-size: 11.5px; color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.bc-seen { margin: 3px 6px 0; font-size: 11.5px; font-weight: 600; color: var(--c-text-3); animation: bc-fade 0.3s ease both; }
@keyframes bc-fade { from { opacity: 0; transform: translateY(-3px); } }

.bc-reacts { display: flex; gap: 1px; margin-top: -8px; padding: 2px 6px; border-radius: 99px; background: var(--c-bg); border: 1.5px solid var(--c-bg); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14); font-size: 13px; z-index: 1; animation: bc-pop 0.35s var(--c-spring) both; }
.me .bc-reacts { margin-right: 8px; }
.them .bc-reacts { margin-left: 8px; }
.bc-reacts small { margin-left: 2px; font-size: 11px; font-weight: 700; color: var(--c-text-2); }
@keyframes bc-pop { from { transform: scale(0.3); opacity: 0; } }
.bc-heart { position: absolute; left: 50%; top: 50%; font-size: 54px; pointer-events: none; transform: translate(-50%, -50%) scale(0); animation: bc-heart 0.8s var(--c-spring) forwards; z-index: 3; }
@keyframes bc-heart { 40% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -70%) scale(0.9); opacity: 0; } }

.bc-system { align-self: center; margin: 10px 0 4px; padding: 6px 12px; border-radius: 99px; background: var(--c-bg-2); font-size: 13px; color: var(--c-text-2); text-align: center; animation: bc-in 0.4s var(--c-spring) both; }
.bc-system b { color: var(--c-text); }

/* Typing */
.bc-typing { align-self: flex-start; display: inline-flex; gap: 4px; margin: 8px 0 2px; padding: 12px 14px; border-radius: 20px; background: var(--c-them); animation: bc-in 0.35s var(--c-spring) both; }
.bc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-text-3); animation: bc-dots 1.2s infinite ease-in-out; }
.bc-typing i:nth-child(2) { animation-delay: 0.15s; }
.bc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bc-dots { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }

.bc-newpill { position: absolute; left: 50%; bottom: 84px; z-index: 3; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 7px 14px; border: 0; border-radius: 99px; background: var(--c-accent); color: var(--c-on-accent) !important; font-size: 13px; font-weight: 650; box-shadow: var(--c-shadow); transition: transform 0.3s var(--c-spring), opacity 0.2s ease; }
.bc-newpill.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }

/* Composer */
.bc-composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--c-line); background: var(--c-bg); }
.bc-field { flex: 1; min-width: 0; display: flex; align-items: flex-end; min-height: 40px; padding: 0 4px 0 14px; border-radius: 22px; border: 1px solid var(--c-line); background: var(--c-bg); transition: border-color 0.2s ease; }
.bc-field:focus-within { border-color: var(--c-text-3); }
.bc-field textarea { flex: 1; min-width: 0; max-height: 128px; padding: 9px 0; border: 0 !important; outline: none !important; box-shadow: none !important; resize: none; background: transparent !important; color: var(--c-text) !important; font: 15.5px/1.35 inherit; font-family: inherit; }
.bc-send { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; margin: 4px 0; border: 0; border-radius: 50%; background: var(--c-me); color: #fff !important; transform: scale(0.6); opacity: 0; pointer-events: none; transition: transform 0.3s var(--c-spring), opacity 0.2s ease; }
.bc-send.is-ready { transform: scale(1); opacity: 1; pointer-events: auto; }
.bc-send svg { width: 17px; height: 17px; }
.bc-send.is-flying svg { animation: bc-fly 0.35s var(--c-ease); }
@keyframes bc-fly { 50% { transform: translateY(-8px); opacity: 0; } 51% { transform: translateY(8px); } }
.bc-plus { margin-bottom: 1px; }
.bc-closed { padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--c-line); font-size: 14px; color: var(--c-text-2); text-align: center; }

.bc-nothread { flex: 1; display: grid; place-items: center; }

/* ---------- shared things ---------- */
.bc-card { width: min(300px, 70vw); overflow: hidden; border-radius: 20px; border: 1px solid var(--c-line); background: var(--c-bg); color: var(--c-text); text-align: left; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); }
.bc-card-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-3); }
.bc-card-top img { width: 18px; height: 18px; }
.bc-card-title { margin: 4px 14px 0; font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.bc-card-text { margin: 4px 14px 0; font-size: 13.5px; line-height: 1.45; color: var(--c-text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bc-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 14px 0; }
.bc-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--c-bg-2); font-size: 12.5px; font-weight: 650; color: var(--c-text-2); }
.bc-chip.is-win { background: rgba(22, 163, 74, 0.13); color: var(--c-ok); }
.bc-card-foot { display: flex; gap: 6px; padding: 12px 14px 14px; }
.bc-card-foot .bc-btn { flex: 1; }
.bc-card.is-quiz { background: linear-gradient(160deg, rgba(10, 108, 240, 0.1), rgba(139, 92, 246, 0.1)) , var(--c-bg); }
.bc-card.is-cards { background: linear-gradient(160deg, rgba(251, 146, 60, 0.12), rgba(236, 72, 153, 0.08)), var(--c-bg); }
.bc-card-note { margin: 6px 4px 0; font-size: 13px; color: var(--c-text-2); }

/* ---------- sheets inside the chat (share, quiz, cards, reader) ---------- */
.bc-sheet-wrap { position: absolute; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.3); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.bc-sheet-wrap.is-on { opacity: 1; pointer-events: auto; }
.bc-sheet { width: 100%; max-height: 88%; display: flex; flex-direction: column; border-radius: 24px 24px 0 0; background: var(--c-bg); box-shadow: var(--c-shadow); transform: translateY(100%); transition: transform 0.42s var(--c-ease); }
.bc-sheet-wrap.is-on .bc-sheet { transform: none; }
.bc-grab { width: 38px; height: 5px; margin: 8px auto 2px; border-radius: 99px; background: var(--c-bg-3); }
.bc-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 6px 18px; }
.bc-sheet-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.bc-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
.bc-pickrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 14px; background: transparent; text-align: left; transition: background-color 0.15s ease; }
.bc-pickrow:hover { background: var(--c-bg-2); }
.bc-pickrow b { display: block; font-size: 15px; font-weight: 600; }
.bc-pickrow small { display: block; font-size: 13px; color: var(--c-text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bc-pickrow > span:last-child { min-width: 0; }
.bc-pickicon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--c-bg-2); font-size: 20px; }
.bc-hint { margin: 10px 2px 0; font-size: 13px; line-height: 1.5; color: var(--c-text-3); }

.bc-reader { font-size: 15px; line-height: 1.6; color: var(--c-text); overflow-wrap: anywhere; }
.bc-reader h1, .bc-reader h2, .bc-reader h3 { font-size: 16px; margin: 14px 0 6px; }
.bc-reader table { display: block; overflow-x: auto; border-collapse: collapse; }
.bc-reader th, .bc-reader td { padding: 6px 10px; border: 1px solid var(--c-line); }
.bc-reader-actions { display: flex; gap: 8px; margin-top: 14px; }

/* Quiz */
.bc-q-bar { height: 5px; border-radius: 99px; background: var(--c-bg-2); overflow: hidden; margin-bottom: 14px; }
.bc-q-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c-me); transition: width 0.5s var(--c-ease); }
.bc-q-num { font-size: 12.5px; font-weight: 650; color: var(--c-text-3); }
.bc-q-text { margin: 4px 0 14px; font-size: 18px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; animation: bc-fade 0.3s ease both; }
.bc-q-opts { display: flex; flex-direction: column; gap: 8px; }
.bc-q-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--c-line); border-radius: 16px; background: var(--c-bg); text-align: left; font-size: 15px; transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease; animation: bc-in 0.35s var(--c-spring) both; }
.bc-q-opt:nth-child(2) { animation-delay: 0.04s; } .bc-q-opt:nth-child(3) { animation-delay: 0.08s; } .bc-q-opt:nth-child(4) { animation-delay: 0.12s; }
.bc-q-opt:active { transform: scale(0.98); }
.bc-q-opt b { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c-bg-2); font-size: 13px; }
.bc-q-opt.is-right { border-color: var(--c-ok); background: rgba(22, 163, 74, 0.1); }
.bc-q-opt.is-right b { background: var(--c-ok); color: #fff; }
.bc-q-opt.is-wrong { border-color: var(--c-bad); background: rgba(220, 38, 38, 0.08); animation: bc-shake 0.4s ease; }
.bc-q-opt.is-wrong b { background: var(--c-bad); color: #fff; }
.bc-q-opt:disabled { cursor: default; }
@keyframes bc-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.bc-q-why { margin: 12px 2px 0; font-size: 14px; line-height: 1.5; color: var(--c-text-2); animation: bc-fade 0.3s ease both; }
.bc-q-next { width: 100%; margin-top: 14px; height: 46px; }
.bc-q-done { text-align: center; padding: 10px 0; }
.bc-q-big { font-size: 56px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; animation: bc-pop 0.5s var(--c-spring) both; }
.bc-q-big small { font-size: 22px; color: var(--c-text-3); font-weight: 700; }
.bc-q-vs { display: flex; justify-content: center; gap: 10px; margin: 14px 0 4px; }

/* Flashcards */
.bc-flip { position: relative; height: 240px; perspective: 1200px; cursor: pointer; }
.bc-flip-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.6s var(--c-ease); }
.bc-flip.is-turned .bc-flip-in { transform: rotateY(180deg); }
.bc-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 22px; border-radius: 22px; border: 1px solid var(--c-line); background: var(--c-bg); backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); text-align: center; font-size: 17px; font-weight: 650; line-height: 1.4; overflow-y: auto; }
.bc-face small { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-3); }
.bc-face.back { transform: rotateY(180deg); background: linear-gradient(160deg, rgba(10, 108, 240, 0.08), transparent), var(--c-bg); font-weight: 500; font-size: 16px; }
.bc-face em { font-style: normal; font-size: 13.5px; color: var(--c-bad); }
.bc-flip-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.bc-flip-nav span { font-size: 13px; font-weight: 650; color: var(--c-text-3); font-variant-numeric: tabular-nums; }

/* Long-press menu with reactions */
.bc-menu-wrap { position: absolute; inset: 0; z-index: 12; background: rgba(0, 0, 0, 0.18); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: bc-fade-in 0.2s ease both; }
@keyframes bc-fade-in { from { opacity: 0; } }
.bc-menu { position: absolute; display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.bc-rbar { display: flex; gap: 2px; padding: 5px; border-radius: 99px; background: var(--c-bg); box-shadow: var(--c-shadow); transform-origin: 50% 100%; animation: bc-pop 0.35s var(--c-spring) both; }
.bc-rbar button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; font-size: 25px; line-height: 1; transition: transform 0.2s var(--c-spring), background-color 0.15s ease; animation: bc-pop 0.4s var(--c-spring) both; }
.bc-rbar button:hover { transform: scale(1.25) translateY(-3px); }
.bc-rbar button.is-mine { background: var(--c-bg-3); }
.bc-actions { overflow: hidden; border-radius: 16px; background: var(--c-bg); box-shadow: var(--c-shadow); animation: bc-in 0.3s var(--c-ease) both; }
.bc-actions button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 16px; border: 0; background: transparent; font-size: 15px; text-align: left; }
.bc-actions button + button { border-top: 1px solid var(--c-line); }
.bc-actions button:hover { background: var(--c-bg-2); }
.bc-actions .is-bad { color: var(--c-bad) !important; }

/* Buddy picker for "Send to a buddy" (outside the chat panel) and the in-app message banner */
.bc-pick-wrap { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.36); animation: bc-fade-in 0.2s ease both; }
.bc-pick-wrap .bc-sheet { max-width: 460px; max-height: 80vh; transform: none; animation: bc-rise 0.42s var(--c-ease) both; }
@media (min-width: 768px) { .bc-pick-wrap { align-items: center; } .bc-pick-wrap .bc-sheet { border-radius: 24px; } }
@keyframes bc-rise { from { transform: translateY(40px); opacity: 0; } }
.bc-banner { position: fixed; z-index: 1350; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; width: min(420px, calc(100vw - 20px)); display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 20px; border: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-bg) 97%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px); box-shadow: var(--c-shadow); cursor: pointer; transform: translate(-50%, -140%); transition: transform 0.5s var(--c-spring); }
.bc-banner.is-on { transform: translate(-50%, 0); }
.bc-banner-text { flex: 1; min-width: 0; }
.bc-banner b { display: block; font-size: 14.5px; }
.bc-banner span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; color: var(--c-text-2); }
.bc-toast { position: fixed; z-index: 1400; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 16px; border-radius: 999px; background: #0b0b0c; color: #fff; font: 600 14px var(--ag-font, system-ui, sans-serif); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); animation: bc-rise 0.35s var(--c-ease, ease) both; }
html[data-theme="dark"] .bc-toast { background: #f5f5f7; color: #0b0b0c; }
.bc-toast button { height: 30px; padding: 0 12px; border: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.16); color: inherit; font: inherit; cursor: pointer; }
html[data-theme="dark"] .bc-toast button { background: rgba(0, 0, 0, 0.08); }
.bc-toast:not(:has(button)) { padding-right: 16px; }

/* ---------- phones: two screens that slide ---------- */
@media (max-width: 879px) {
  .bc-panel { top: 0; right: 0; bottom: 0; left: 0; width: 100%; border-radius: 0; border: 0; transform: translateY(30px); }
  .bc-list-pane, .bc-thread-pane { position: absolute; inset: 0; width: 100%; border: 0; transition: transform 0.46s var(--c-ease), filter 0.46s var(--c-ease); }
  .bc-list-pane { padding-top: env(safe-area-inset-top, 0px); }
  .bc-thread-pane { transform: translateX(100%); box-shadow: -12px 0 30px rgba(0, 0, 0, 0.12); padding-top: env(safe-area-inset-top, 0px); }
  .bc-root[data-view="thread"] .bc-thread-pane { transform: none; }
  .bc-root[data-view="thread"] .bc-list-pane { transform: translateX(-26%); filter: brightness(0.9); }
  .bc-root.is-dragging .bc-list-pane, .bc-root.is-dragging .bc-thread-pane { transition: none; }
  .bc-back { display: grid; }
  .bc-nothread { display: none; }
  .bc-msg { max-width: 80%; }
}
@media (prefers-reduced-motion: reduce) {
  .bc-root *, .bc-pick-wrap *, .bc-banner { animation: none !important; transition-duration: 0.01s !important; }
}
html.bc-lock, html.bc-lock body { overflow: hidden; }
/* The app's own input styles are very specific; the ids keep these fields looking right in both themes. */
html #bc-input { background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--c-text) !important; padding: 9px 0 !important; font-size: 15.5px !important; }
html #bc-search-input { background: var(--c-bg-2) !important; border: 0 !important; box-shadow: none !important; color: var(--c-text) !important; padding: 0 12px 0 36px !important; font-size: 15px !important; }
html #bc-input:focus, html #bc-input:focus-visible, html #bc-search-input:focus, html #bc-search-input:focus-visible { outline: none !important; box-shadow: none !important; }
.bc-reader ul { margin: 6px 0; padding-left: 20px; list-style: disc; }
.bc-reader li { margin: 3px 0; }
.bc-reader p { margin: 6px 0; }
.bc-reader table { margin: 10px 0; font-size: 14px; }
.bc-reader th { background: var(--c-bg-2); text-align: left; }

/* ---------- On the Buddies page: the chat is part of the page, not a panel over it ---------- */
.bc-root.is-inline { position: relative; height: 100%; --c-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 60px -28px rgba(15, 23, 42, 0.28); }
html[data-theme="dark"] .bc-root.is-inline { --c-card-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -28px rgba(0, 0, 0, 0.8); }
.bc-root.is-inline .bc-scrim { display: none; }
.bc-root.is-inline .bc-panel { position: relative; top: auto; right: auto; bottom: auto; left: auto; width: 100%; height: 100%; opacity: 1; transform: none; visibility: visible; pointer-events: auto; border-radius: 28px; box-shadow: var(--c-card-shadow); transition: none; }
.bc-root.is-inline [data-c="close"] { display: none; }
.bc-root.is-inline .bc-list-pane { width: 340px; background: color-mix(in srgb, var(--c-bg-2) 45%, var(--c-bg)); }
.bc-root.is-inline .bc-head { padding: 20px 12px 10px 22px; }
.bc-root.is-inline .bc-head h2 { font-size: 22px; }
.bc-root.is-inline .bc-row { padding: 11px 12px; }
.bc-root.is-inline .bc-scroll { padding: 18px 26px 10px; }
.bc-root.is-inline .bc-composer { padding: 12px 16px 16px; }
@media (max-width: 879px) {
  .bc-root.is-inline .bc-panel { border-radius: 0; border: 0; box-shadow: none; }
  .bc-root.is-inline .bc-list-pane { width: 100%; background: var(--c-bg); }
  .bc-root.is-inline .bc-scroll { padding: 12px 14px 8px; }
  .bc-root.is-inline .bc-composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
}
