/* Bandeja (rediseño Claude Design) — clases .qb-*. Usa los design tokens de styles.css.
   Solo estilos de CONTENIDO de la página; el chrome (sidebar/topbar) lo pone el SPA. */
/* Nota: el selector global (*) y body se omiten a propósito para no pisar el resto del SPA. */
/* ===== Page + tabs ===== */
.qb-page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 18px 18px; gap: 12px; }
.qb-toolbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.qb-tabs { display: flex; gap: 3px; background: var(--bg-card); border: 1px solid var(--border); padding: 3px; border-radius: 10px; }
.qb-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 7px; border: none;
  background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 600; transition: all .12s;
}
.qb-tab:hover { color: var(--text); }
.qb-tab.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
.qb-tab.active svg { color: var(--accent); }

/* ===== Inbox: 3 columnas en una card ===== */
.qb-inbox {
  flex: 1; min-height: 0; display: flex; border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bg-card); box-shadow: var(--shadow);
}

/* ---------- Columna lista ---------- */
.qb-list { width: clamp(300px, 22vw, 440px); flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); min-width: 0; background: var(--bg-card); }
.qb-list-search { display: flex; gap: 6px; align-items: center; padding: 10px 11px; border-bottom: 1px solid var(--border-light); }
.qb-search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; height: 34px; color: var(--text-muted); transition: border-color .12s, box-shadow .12s; }
.qb-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.qb-search input { flex: 1; border: none; background: none; outline: none; color: var(--text); font-size: 13px; min-width: 0; }
.qb-search input::placeholder { color: var(--text-muted); }

.qb-chips { display: flex; gap: 5px; padding: 9px 11px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border-light); }
.qb-chips::-webkit-scrollbar { display: none; }
.qb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 12px; font-weight: 600; white-space: nowrap; transition: all .12s; }
.qb-chip:hover { border-color: var(--border-strong); color: var(--text); }
.qb-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.qb-chip-n { font-size: 11px; opacity: .85; font-weight: 700; }
.qb-chip.active .qb-chip-n { opacity: 1; }

.qb-list-filters { display: flex; gap: 6px; padding: 9px 11px; border-bottom: 1px solid var(--border-light); }
.qb-mini-select { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; height: 30px; color: var(--text-muted); min-width: 0; }
.qb-mini-select select { flex: 1; border: none; background: none; outline: none; color: var(--text); font-size: 12.5px; font-weight: 500; min-width: 0; appearance: none; cursor: pointer; }

.qb-convos { flex: 1; overflow-y: auto; outline: none; }
.qb-conv {
  position: relative; display: flex; gap: 10px; width: 100%; text-align: left; padding: 9px 13px;
  border: none; border-bottom: 1px solid var(--border-light); background: transparent; color: var(--text);
  cursor: pointer; transition: background .1s;
}
.qb-conv.comodo { padding: 13px 14px; }
.qb-conv:hover { background: var(--bg-card-hover); }
.qb-conv.active { background: color-mix(in srgb, var(--accent) 9%, var(--bg-card)); }
.qb-conv-prio-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-red); }
.qb-conv.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.qb-conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qb-conv-r1 { display: flex; align-items: baseline; gap: 8px; }
.qb-conv-name { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-conv.unread .qb-conv-name { font-weight: 800; }
.qb-conv-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.qb-conv-r2 { display: flex; align-items: center; gap: 6px; }
.qb-conv-prev { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-conv.unread .qb-conv-prev { color: var(--text-secondary); }
.qb-conv-you { color: var(--text-muted); }
.qb-conv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.qb-conv-r3 { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.qb-conv-spacer { flex: 1; }
.qb-conv-espera { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--accent-yellow); font-weight: 600; }
.qb-conv-unassigned { color: var(--text-muted); font-weight: 800; }

.qb-list-empty { padding: 48px 20px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qb-list-empty p { margin: 6px 0 0; font-weight: 600; color: var(--text-secondary); }
.qb-list-empty span { font-size: 12.5px; }

/* ---------- Avatar + canal ---------- */
.qb-av-wrap { position: relative; flex-shrink: 0; display: inline-block; }
.qb-av { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; }
/* QUA-242: placeholder (persona) e imagen de perfil se apilan dentro del wrap. El placeholder queda
   detrás; si hay foto, la <img> lo tapa; si la foto falla (onerror → display:none) reaparece. */
.qb-av-wrap .qb-av { position: absolute; inset: 0; }
.qb-av-img { object-fit: cover; }
.qb-av-ph { background: color-mix(in srgb, var(--plum-deep) 20%, var(--bg-card, #fff)); color: var(--plum-dim); }
.qb-av-ph svg { display: block; }
.qb-av-chan { position: absolute; right: -3px; bottom: -3px; }
.qb-chan { border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; }

/* ---------- Badges ---------- */
.qb-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--st); padding: 1px 8px 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--st) 13%, transparent); white-space: nowrap; }
.qb-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--st); }
.qb-prio { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; }
.qb-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-secondary); background: var(--bg-card-hover); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; }
.qb-label--add { color: var(--text-muted); cursor: pointer; padding: 3px 6px; }
.qb-label--add:hover { color: var(--accent); border-color: var(--accent); }
.qb-jsig { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 1px 6px 1px 5px; border-radius: 5px; }
.qb-jsig--ok { color: var(--accent); background: var(--accent-soft); }
.qb-jsig--deriva { color: var(--accent-purple); background: color-mix(in srgb, var(--accent-purple) 15%, transparent); }
/* Temperatura del lead (captación) — mismo patrón que qb-status, color por --tc */
.qb-temp { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--tc); padding: 1px 7px 1px 5px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 14%, transparent); white-space: nowrap; }
.qb-temp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tc); }

/* ---------- Columna chat ---------- */
/* --chat-gutter: el hilo ocupa todo el ancho disponible, pero el contenido
   (header, acciones, mensajes y composer) se centra en una columna legible
   de hasta 1040px. En ultrawide el resto del ancho lo aprovechan las columnas. */
.qb-thread { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); --chat-gutter: max(16px, calc((100% - 1040px) / 2)); }
.qb-thread-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px var(--chat-gutter); border-bottom: 1px solid var(--border); background: var(--bg-card); }
.qb-thread-h-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.qb-thread-h-tx { display: flex; flex-direction: column; min-width: 0; }
.qb-thread-h-tx strong { font-size: 14.5px; font-weight: 700; }
.qb-thread-h-tx span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-thread-chan { font-weight: 600; }
.qb-thread-h-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.qb-viewing { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); font-style: italic; }
.qb-viewing svg { color: var(--accent-cyan); }

.qb-actions { display: flex; align-items: center; gap: 6px; padding: 8px var(--chat-gutter); border-bottom: 1px solid var(--border-light); background: var(--bg-card); flex-wrap: wrap; }
.qb-actions-sp { flex: 1; }
.qb-act { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text-secondary); font-size: 12px; font-weight: 600; transition: all .12s; }
.qb-act:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-card-hover); }
.qb-act svg:last-child { color: var(--text-muted); margin-left: -2px; }
.qb-act--solid { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.qb-act--solid svg { color: var(--accent) !important; margin: 0 !important; }
.qb-act--solid:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
/* QUA-393 — quick actions Vendido/Perdido: mismo color-mix que .qb-status, ícono + color (nunca solo color) */
.qb-act--vendido { color: var(--accent-green); border-color: color-mix(in srgb, var(--accent-green) 40%, var(--border)); }
.qb-act--vendido:hover { background: color-mix(in srgb, var(--accent-green) 16%, transparent); }
.qb-act--perdido { color: var(--accent-red); border-color: color-mix(in srgb, var(--accent-red) 40%, var(--border)); }
.qb-act--perdido:hover { background: color-mix(in srgb, var(--accent-red) 14%, transparent); }
/* QUA-393 — popover accesible (confirmación perdida, chips de seguimiento, crear tarea) */
.qb-pop { position: fixed; z-index: 60; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg, 0 8px 28px rgba(0,0,0,.28)); padding: 12px; min-width: 220px; max-width: 300px; }
.qb-pop-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.qb-pop-chip { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 13px; margin-bottom: 6px; cursor: pointer; }
.qb-pop-chip:last-child { margin-bottom: 0; }
.qb-pop-chip:hover, .qb-pop-chip:focus-visible { border-color: var(--accent); background: var(--bg-card-hover); }
.qb-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* QUA-393 — trigger "⋯ Acciones" (sólo mobile, ver @media abajo) + bottom sheet de acciones */
.qb-actions-trigger { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; }
.qb-actsheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); }
.qb-actsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--bg-card); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 28px rgba(0,0,0,.3); padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); max-height: 70vh; overflow-y: auto; }
.qb-actsheet-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 6px auto 10px; }
.qb-actsheet-body { display: flex; flex-direction: column; gap: 8px; }
/* #qb-root + !important: el reset global de botones mobile (styles.css,
   `button:not(.pill)...{min-height:44px}!important` en @media 820px) tiene especificidad
   0,3,1 (tres :not() cuentan como clase) — le gana a un simple par de clases (0,2,0) aunque
   ambos sean !important. Sumar el ID del contenedor (1,2,0) es lo único que garantiza que
   estos targets queden en 48px reales, no 44px — bloqueante de aceptación de este issue. */
#qb-root .qb-actsheet-body .qb-act, #qb-root .qb-actsheet-body select.qb-act { width: 100%; min-height: 48px !important; font-size: 14.5px; justify-content: flex-start; }
.qb-actsheet-body .qb-actions-sp { display: none; }

.qb-msgs { flex: 1; overflow-y: auto; padding: 18px var(--chat-gutter); display: flex; flex-direction: column; gap: 9px; }
.qb-msgs-day { align-self: center; font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border-light); padding: 2px 12px; border-radius: 999px; margin-bottom: 4px; }
.qb-msg { display: flex; flex-direction: column; max-width: 74%; }
.qb-msg.in { align-self: flex-start; align-items: flex-start; }
.qb-msg.out { align-self: flex-end; align-items: flex-end; }
.qb-msg-bub { padding: 9px 13px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; border-radius: 15px; }
.qb-msg.in .qb-msg-bub { background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 5px; color: var(--text); }
.qb-msg.out .qb-msg-bub { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; box-shadow: var(--shadow-sm); }
.qb-msg-meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-muted); margin-top: 4px; padding: 0 4px; }
.qb-msg.out .qb-msg-meta svg { color: var(--accent-green); }
.qb-msg-juli { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 600; }
.qb-msg-nota { align-self: center; max-width: 88%; display: flex; gap: 9px; background: color-mix(in srgb, var(--accent-yellow) 12%, var(--bg-card)); border: 1px dashed color-mix(in srgb, var(--accent-yellow) 55%, var(--border)); border-radius: 12px; padding: 9px 13px; font-size: 12.5px; color: var(--text-secondary); font-style: italic; }
.qb-msg-nota svg { color: var(--accent-yellow); flex-shrink: 0; margin-top: 2px; }
.qb-msg-nota-tag { display: block; font-style: normal; font-weight: 700; font-size: 10.5px; color: var(--accent-yellow); margin-bottom: 2px; }
/* Resaltado al aterrizar desde un lead (tarea juli_* / notificación): el deep-link centra el
   mensaje del momento del lead y lo destella un instante. */
.qb-msg-foco { animation: qb-foco-flash 2.4s ease-out; }
@keyframes qb-foco-flash {
  0%, 35% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 70%, transparent); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
.qb-typing { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); font-style: italic; padding: 2px 4px; }
.qb-typing-dots, .qb-juli-dots { display: inline-flex; gap: 3px; }
.qb-typing-dots i, .qb-juli-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; animation: qb-bounce 1.2s infinite; }
.qb-typing-dots i:nth-child(2), .qb-juli-dots i:nth-child(2) { animation-delay: .2s; }
.qb-typing-dots i:nth-child(3), .qb-juli-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes qb-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Empty thread ---------- */
.qb-thread--empty { align-items: center; justify-content: center; }
.qb-empty-hero { text-align: center; max-width: 380px; padding: 30px; }
.qb-empty-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--bg-card); border: 1px solid var(--border); color: var(--accent); margin-bottom: 18px; box-shadow: var(--shadow); }
.qb-empty-hero h2 { margin: 0 0 8px; font-size: 19px; font-weight: 700; }
.qb-empty-hero p { margin: 0 0 18px; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.qb-empty-kbd { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.qb-empty-kbd > span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Composer ---------- */
.qb-composer-wrap { border-top: 1px solid var(--border); background: var(--bg-card); padding: 0 var(--chat-gutter) 12px; position: relative; }
.qb-composer-wrap.nota .qb-ta { background: color-mix(in srgb, var(--accent-yellow) 11%, var(--bg-input)); }
.qb-nota-tg { display: flex; align-items: center; gap: 8px; padding: 9px 4px 8px; font-size: 12px; color: var(--text-muted); cursor: pointer; user-select: none; }
.qb-nota-tg em { font-style: normal; }
.qb-nota-tg input { display: none; }
.qb-nota-box { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; transition: all .12s; }
.qb-nota-tg input:checked + .qb-nota-box { background: var(--accent-yellow); border-color: var(--accent-yellow); color: #fff; }

.qb-composer { display: flex; align-items: flex-end; gap: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 14px; padding: 7px 8px 7px 10px; transition: border-color .12s, box-shadow .12s; }
.qb-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.qb-composer-tools { display: flex; align-items: center; gap: 2px; padding-bottom: 2px; }
.qb-ask-juli { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: none; padding: 5px 10px; border-radius: 8px; white-space: nowrap; }
.qb-ask-juli:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.qb-ta { flex: 1; resize: none; border: none; background: none; outline: none; color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.5; padding: 6px 2px; max-height: 140px; }
.qb-ta::placeholder { color: var(--text-muted); }
.qb-send { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: none; background: var(--border); color: var(--text-muted); transition: all .14s; flex-shrink: 0; }
.qb-send.on { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.qb-send.on:hover { background: var(--accent-hover); }

/* ---------- Composer: adjuntar archivo saliente (imagen/audio/PDF — QUA-258) ---------- */
.qb-clip { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: none; background: none; color: var(--text-muted); cursor: pointer; flex-shrink: 0; transition: background .12s, color .12s; }
.qb-clip:hover { background: var(--accent-soft); color: var(--accent); }
.qb-adj-prev { padding: 8px 2px 0; }
.qb-adj-card { display: flex; align-items: center; gap: 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.qb-adj-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.qb-adj-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.qb-adj-tx strong { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-adj-tx span { font-size: 11.5px; color: var(--text-muted); }
.qb-adj-x { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: none; background: none; color: var(--text-muted); cursor: pointer; flex-shrink: 0; transition: background .12s, color .12s; }
.qb-adj-x:hover:not([disabled]) { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.qb-adj-x[disabled] { opacity: .5; cursor: default; }

/* ---------- Composer: canal=email (correspondencia deliberada, no chat — QUA-156) ---------- */
.qb-email-fields { padding: 6px 2px 4px; }
.qb-asunto { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-input); color: var(--text); font-size: 13.5px; font-weight: 600; padding: 8px 12px; outline: none; font-family: inherit; transition: border-color .12s, box-shadow .12s; }
.qb-asunto::placeholder { color: var(--text-muted); font-weight: 500; }
.qb-asunto:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.qb-composer--email { flex-direction: column; align-items: stretch; border-radius: 12px; padding: 8px; }
.qb-composer--email .qb-ta--email { max-height: 320px; padding: 6px 4px; }
.qb-send-email { align-self: flex-end; margin-top: 4px; }

/* ---------- Hilo: canal=email (correspondencia, no burbujas de chat — QUA-156) ---------- */
.qb-email-msg { max-width: 100%; align-self: stretch; background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 10px; padding: 12px 15px; margin: 0 0 4px; }
.qb-email-msg.out { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--bg-card)); }
.qb-email-msg-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.qb-email-from { font-size: 13px; font-weight: 700; color: var(--text); }
.qb-email-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.qb-email-subj { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.qb-email-body { font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: normal; }
.qb-email-body p { margin: 0 0 .8em; }
.qb-email-body p:last-child { margin-bottom: 0; }
.qb-email-msg-f { margin-top: 8px; font-size: 11px; color: var(--text-muted); }

/* ---------- Quick replies ---------- */
.qb-qr { position: absolute; left: var(--chat-gutter); right: var(--chat-gutter); bottom: calc(100% - 4px); background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; z-index: 20; margin-bottom: 8px; }
.qb-qr-head { display: flex; align-items: center; gap: 6px; padding: 9px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 1px solid var(--border-light); }
.qb-qr-head svg { color: var(--accent); }
.qb-qr-it { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; width: 100%; text-align: left; padding: 9px 12px; border: none; background: none; border-bottom: 1px solid var(--border-light); transition: background .1s; }
.qb-qr-it:last-child { border-bottom: none; }
.qb-qr-it:hover, .qb-qr-it.sel { background: var(--bg-card-hover); }
.qb-qr-a { grid-row: 1 / 3; align-self: start; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; }
.qb-qr-t { font-size: 13px; font-weight: 600; color: var(--text); }
.qb-qr-b { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Editing banner ---------- */
.qb-editing-banner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 9px; }
.qb-editing-discard { margin-left: auto; border: none; background: none; color: var(--text-secondary); font-size: 12px; font-weight: 600; text-decoration: underline; }
.qb-editing-discard:hover { color: var(--text); }

/* ============================================================
   JULI — tarjeta del copiloto
   ============================================================ */
.qb-juli-slot { margin-bottom: 9px; }
.qb-juli {
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border)); border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 60%, var(--bg-card)), var(--bg-card));
  padding: 12px 13px; box-shadow: var(--shadow);
}
.qb-juli--deriva { border-color: color-mix(in srgb, var(--accent-purple) 42%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-purple) 12%, var(--bg-card)), var(--bg-card)); }
.qb-juli-h { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 9px; }
.qb-juli-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: #fff; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.qb-juli--deriva .qb-juli-mark { background: var(--accent-purple); }
.qb-juli-h-tx { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.qb-juli-h-tx strong { font-size: 13.5px; font-weight: 700; display: block; line-height: 1.35; }
.qb-juli-conf { vertical-align: middle; margin-left: 7px; }
.qb-juli-sub { font-size: 11.5px; color: var(--text-muted); }
.qb-juli-conf { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.qb-juli-conf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.qb-juli-draft { background: var(--bg-card); border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; font-size: 13.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }

.qb-juli-ground-wrap { margin-top: 9px; }
.qb-juli-ground-toggle { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: var(--text-secondary); font-size: 12px; font-weight: 600; padding: 2px 0; }
.qb-juli-ground-toggle:hover { color: var(--text); }
.qb-juli-ground-n { background: var(--bg-card-hover); color: var(--text-muted); font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px; }
.qb-ground { margin-top: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
.qb-ground-note { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; line-height: 1.45; color: var(--text-secondary); margin-bottom: 9px; font-weight: 500; }
.qb-ground-note svg { color: var(--accent-green); flex-shrink: 0; margin-top: 1px; }
.qb-ground-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qb-ground-it { display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; }
.qb-ground-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.qb-ground-tx { display: block; min-width: 0; }
.qb-ground-tx b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.qb-ground-tx em { display: block; font-style: normal; font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.qb-juli-actions { display: flex; align-items: center; gap: 7px; margin-top: 11px; }
.qb-juli-deriva-body { background: var(--bg-card); border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; }
.qb-juli-deriva-area { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.qb-juli-deriva-area b { color: var(--accent-purple); }
.qb-juli-deriva-motivo { margin: 0 0 9px; font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }

/* Generando */
.qb-juli--gen .qb-juli-shimmer { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 2px; }
.qb-juli-shimmer span { height: 11px; border-radius: 6px; background: linear-gradient(90deg, var(--border-light), var(--bg-card-hover), var(--border-light)); background-size: 200% 100%; animation: qb-shim 1.3s infinite; }
.qb-juli-shimmer span:nth-child(1) { width: 92%; }
.qb-juli-shimmer span:nth-child(2) { width: 78%; }
.qb-juli-shimmer span:nth-child(3) { width: 55%; }
@keyframes qb-shim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.qb-juli-genfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--accent); }

/* ---------- Build card ---------- */
.qb-build { margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); overflow: hidden; }
.qb-build-h { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--border-light); }
.qb-build-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.qb-build-htx { display: flex; flex-direction: column; min-width: 0; }
.qb-build-htx strong { font-size: 13px; font-weight: 700; }
.qb-build-htx span { font-size: 11px; color: var(--text-muted); }
.qb-build-items { list-style: none; margin: 0; padding: 4px 13px; }
.qb-build-it { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 12.5px; }
.qb-build-it:last-child { border-bottom: none; }
.qb-build-it-name { display: inline-flex; align-items: center; gap: 7px; color: var(--text); min-width: 0; }
.qb-outlet { font-size: 9px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--accent); padding: 1px 5px; border-radius: 4px; flex-shrink: 0; }
.qb-build-it-price { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.qb-build-total { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: var(--bg-card-hover); border-top: 1px solid var(--border); font-size: 13px; }
.qb-build-total strong { font-size: 16px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.qb-build-note { display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 10px 13px; font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); border-top: 1px solid var(--border-light); }
.qb-build-note svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.qb-build-actions { display: flex; gap: 7px; padding: 11px 13px; border-top: 1px solid var(--border-light); }

/* ---------- Botones ---------- */
.qb-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; border: 1px solid transparent; font-weight: 600; transition: all .12s; white-space: nowrap; }
.qb-btn--sm { padding: 7px 12px; font-size: 12.5px; }
.qb-btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.qb-btn--primary:hover { background: var(--accent-hover); }
.qb-juli--deriva .qb-btn--primary { background: var(--accent-purple); }
.qb-btn--ghost { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.qb-btn--ghost:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }
.qb-btn--quiet { background: transparent; color: var(--text-muted); padding: 7px 9px; }
.qb-btn--quiet:hover { background: var(--bg-card-hover); color: var(--text); }
.qb-kbd { font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, currentColor 16%, transparent); margin-left: 3px; line-height: 1.4; }
.qb-btn--primary .qb-kbd { background: rgba(255,255,255,.22); }

/* ============================================================
   CONTEXTO — columna derecha
   ============================================================ */
.qb-ctx { width: clamp(300px, 22vw, 440px); flex-shrink: 0; border-left: 1px solid var(--border); overflow-y: auto; background: var(--bg-card); }
.qb-ctx-empty { padding: 50px 24px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qb-ctx-empty p { margin: 4px 0 0; font-weight: 600; color: var(--text-secondary); }
.qb-ctx-empty span { font-size: 12.5px; line-height: 1.5; }

.qb-ctx-id { padding: 16px 16px 14px; border-bottom: 1px solid var(--border); }
.qb-ctx-id-top { display: flex; align-items: center; gap: 11px; }
.qb-ctx-id-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.qb-ctx-id-tx strong { font-size: 15px; font-weight: 700; }
.qb-ctx-id-tx span { font-size: 11.5px; color: var(--text-muted); }
.qb-ctx-close { margin-left: auto; align-self: flex-start; }
.qb-ctx-stats { display: flex; gap: 10px; margin-top: 14px; }
.qb-ctx-stats > div { flex: 1; background: var(--bg); border: 1px solid var(--border-light); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 1px; }
.qb-ctx-stats b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qb-ctx-stats span { font-size: 10.5px; color: var(--text-muted); }
.qb-ctx-new { display: inline-flex; align-items: center; gap: 6px; margin-top: 13px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 6px 11px; border-radius: 8px; }

.qb-ctx-sec { padding: 14px 16px; border-bottom: 1px solid var(--border-light); }
.qb-ctx-h { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 10px; }
.qb-ctx-h svg { color: var(--text-muted); }
.qb-ctx-link { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--accent); text-decoration: none; text-transform: none; letter-spacing: 0; }
.qb-ctx-link:hover { text-decoration: underline; }

.qb-ctx-contact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.qb-ctx-contact li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); }
.qb-ctx-contact svg { color: var(--text-muted); flex-shrink: 0; }
.qb-ctx-contact span { min-width: 0; word-break: break-word; }

.qb-ctx-assign { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.qb-ctx-assign-who { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.qb-prio-tx { font-size: 12px; }
.qb-ctx-labels { display: flex; flex-wrap: wrap; gap: 5px; }
.qb-muted-sm { font-size: 12px; color: var(--text-muted); }

.qb-ctx-orders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.qb-order { background: var(--bg); border: 1px solid var(--border-light); border-radius: 10px; padding: 9px 11px; }
.qb-order-r1 { display: flex; align-items: center; gap: 8px; }
.qb-order-n { font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.qb-order-st { font-size: 10.5px; font-weight: 600; color: var(--t); background: color-mix(in srgb, var(--t) 14%, transparent); padding: 1px 8px; border-radius: 999px; }
.qb-order-date { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.qb-order-detail { font-size: 12.5px; color: var(--text-secondary); margin-top: 5px; }
.qb-order-track { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.qb-order-track svg { color: var(--text-muted); }

.qb-ctx-recompra { display: flex; flex-wrap: wrap; gap: 6px; }
.qb-recompra { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); background: var(--bg); border: 1px solid var(--border-light); padding: 4px 9px; border-radius: 7px; white-space: nowrap; max-width: 100%; }
.qb-recompra svg { flex-shrink: 0; }
.qb-recompra svg { color: var(--accent-green); }

.qb-ctx-warr { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qb-warr { display: flex; align-items: flex-start; gap: 9px; background: var(--bg); border: 1px solid var(--border-light); border-left: 3px solid var(--t); border-radius: 9px; padding: 9px 11px; }
.qb-warr svg { color: var(--t); flex-shrink: 0; margin-top: 1px; }
.qb-warr div { display: flex; flex-direction: column; min-width: 0; }
.qb-warr-prod { font-size: 12.5px; font-weight: 600; }
.qb-warr-st { font-size: 11px; color: var(--text-muted); }
.qb-ctx-vacio { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.qb-ctx-foot { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 20px; }
.qb-ctx-foot-link { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600; transition: all .12s; }
.qb-ctx-foot-link:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.qb-ctx-foot-link svg { color: var(--accent); }

/* ============================================================
   VISTAS SECUNDARIAS — outbox + métricas
   ============================================================ */
.qb-secview { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow); overflow: hidden; }
.qb-secview-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.qb-secview-head h2 { margin: 0 0 3px; font-size: 17px; font-weight: 700; }
.qb-secview-head p { margin: 0; font-size: 13px; color: var(--text-muted); }
.qb-secview-tools { display: flex; align-items: center; gap: 10px; }
.qb-secview-count { font-size: 12.5px; color: var(--text-muted); }

.qb-table-card { flex: 1; overflow: auto; }
.qb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.qb-table thead th { position: sticky; top: 0; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 11px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border); white-space: nowrap; }
.qb-table tbody td { padding: 12px 20px; border-bottom: 1px solid var(--border-light); }
.qb-table tbody tr:hover { background: var(--bg-card-hover); }
.qb-td-date { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qb-td-canal { display: inline-flex; align-items: center; gap: 7px; }
.qb-td-dest { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.qb-td-est { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--t); }
.qb-td-est-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--t); }

.qb-kpis { padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; overflow-y: auto; }
.qb-kpi { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 17px; display: flex; flex-direction: column; gap: 4px; position: relative; min-height: 116px; }
.qb-kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.qb-kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.qb-kpi-sub { font-size: 11.5px; color: var(--text-muted); }
.qb-kpi-bars { display: flex; align-items: flex-end; gap: 4px; height: 30px; margin-top: auto; }
.qb-kpi-bars span { flex: 1; border-radius: 3px 3px 0 0; opacity: .8; min-height: 3px; }
.qb-metric-note { display: flex; align-items: center; gap: 8px; margin: 0 20px 20px; padding: 11px 14px; font-size: 12.5px; color: var(--text-secondary); background: var(--accent-soft); border-radius: 10px; }
.qb-metric-note svg { color: var(--accent); flex-shrink: 0; }
.qb-metric-note code { font-family: var(--font-mono); font-size: 11.5px; background: var(--bg-card); padding: 1px 6px; border-radius: 5px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px) {
  .qb-inbox.ctx-hidden .qb-ctx { display: none; }
  .qb-ctx { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; box-shadow: var(--shadow-lg); width: 320px; }
}
@media (max-width: 860px) {
  .qb-sidebar { display: none; }
  .qb-list { width: 250px; }
}

/* ============================================================
   Bandeja — experiencia tipo WhatsApp en el teléfono PERO con la
   paleta de Quantum (no verde literal): lista de chats → chat a
   pantalla completa con back, info de contacto y visto (tildes).
   ============================================================ */
/* Base (todos los tamaños): header-id como botón + tildes de visto */
.qb-thread-h-id { background: none; border: none; font: inherit; color: inherit; text-align: left; cursor: default; }
.qb-tick { display: inline-flex; align-items: center; margin-left: 3px; vertical-align: middle; color: var(--text-muted); }
.qb-msg.out .qb-msg-meta .qb-tick { color: color-mix(in srgb, var(--accent) 50%, var(--text-muted)); }
.qb-tick--read { color: var(--accent-blue) !important; }
.qb-tick--fail { color: var(--accent-red) !important; }
.qb-ctx-mobh { display: none; }

@media (max-width: 640px) {
  /* Page + root: llenar el alto visible (patrón app-shell) */
  section#page-crm-bandeja2 { padding: 0 !important; }
  section#page-crm-bandeja2.active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; animation: none; }
  #page-crm-bandeja2 #qb-root { height: auto !important; min-height: 0 !important; flex: 1 1 auto; display: flex; }
  #qb-root .qb-page { flex: 1; min-height: 0; padding: 0; gap: 0; }
  #qb-root .qb-toolbar { display: none; }
  #qb-root .qb-inbox { display: block; position: relative; flex: 1; min-height: 0; height: 100%; border: none; border-radius: 0; overflow: hidden; }

  /* ---- Pantalla 1: lista de chats ---- */
  #qb-root .qb-list { width: 100%; height: 100%; border: none; }
  #qb-root .qb-list-filters { display: none; }
  #qb-root .qb-conv { padding: 10px 14px; gap: 13px; align-items: center; }
  #qb-root .qb-conv .qb-conv-r3 { display: none; }
  #qb-root .qb-conv-name { font-size: 15.5px; font-weight: 600; }
  #qb-root .qb-conv-prev { font-size: 13.5px; }
  #qb-root .qb-conv.unread .qb-conv-name { font-weight: 700; }

  /* ---- Pantalla 2: chat a pantalla completa (overlay) ---- */
  #qb-root .qb-thread { position: absolute; inset: 0; z-index: 6; display: none; flex-direction: column; --chat-gutter: 0px; }
  #qb-root.qb-show-thread .qb-thread { display: flex; }
  #qb-root.qb-show-thread .qb-list { visibility: hidden; }
  #qb-root .qb-thread-h { padding: 8px 8px 8px 2px; gap: 2px; }
  #qb-root .qb-back { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; background: none; color: var(--text); cursor: pointer; flex-shrink: 0; }
  #qb-root .qb-thread-h-id { flex: 1; min-width: 0; gap: 9px; cursor: pointer; padding: 3px 6px; border-radius: 10px; }
  #qb-root .qb-thread-h-id:active { background: var(--bg-card-hover); }
  /* QUA-393 — antes se ocultaba toda la barra de acciones (display:none) y ahí quedaban
     inexistentes las quick actions justo donde más se usan (vendedores atienden desde el
     celular). Ahora el trigger "⋯ Acciones" (siempre visible, 44×44) la reemplaza por el
     bottom sheet #qb-actsheet (ver bloque .qb-actsheet-* más arriba) — bloqueante de
     aceptación de este issue. */
  #qb-root .qb-actions { display: none; }
  #qb-root .qb-actions-trigger { display: inline-flex; }
  #qb-root .qb-msgs { padding: 12px 12px 8px; gap: 4px; }
  #qb-root .qb-msg { max-width: 84%; }
  #qb-root .qb-msg-bub { font-size: 14.5px; padding: 7px 11px 8px; }
  #qb-root .qb-msg-meta { font-size: 11px; margin-top: 2px; }
  /* composer compacto a una mano */
  #qb-root .qb-composer-wrap { padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  #qb-root .qb-composer { border-radius: 22px; padding: 5px 6px 5px 14px; }
  #qb-root .qb-send { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
  #qb-root .qb-composer-tools { padding-bottom: 6px; }

  /* ---- Pantalla 3: info de contacto (slide-in al tocar el header) ---- */
  #qb-root .qb-ctx { display: flex !important; flex-direction: column; position: absolute; inset: 0; z-index: 8; width: 100%; border: none; transform: translateX(100%); transition: transform .22s cubic-bezier(.22,.61,.36,1); }
  #qb-root.qb-show-ctx .qb-ctx { transform: translateX(0); }
  #qb-root .qb-ctx-mobh { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 2px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  #qb-root .qb-ctx-mobh strong { font-size: 16px; }
  #qb-root .qb-ctx-mobh .qb-back { display: inline-flex; }
}

@media (min-width: 641px) { #qb-root .qb-back, #qb-root .qb-ctx-mobh { display: none; } }

/* QUA-380 — buscador rápido de cliente (overlay #qb-bc-ov) */
.qb-bc-row:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }
.qb-bc-row.active, .qb-bc-row:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-card)); outline: 2px solid var(--accent); outline-offset: 1px; }
#qb-bc-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#qb-buscar-cliente:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
