/* ─── LiveChat v2 — el chat de Textti de cara al cliente ──────────────────
 * Implementación FIEL del diseño "Textti Sitio Chat v2" (Claude Design).
 * Cargado vía <link> desde BaseLayoutV4 → /styles/livechat.css?v=2
 * Mobile-first: hoja completa en móvil, tarjeta anclada 400×640 en escritorio.
 * ─────────────────────────────────────────────────────────────────────── */

:root {
  --lc-accent: #0071E3;
  --lc-accent-ink: #005CBF;
  --lc-accent-soft: #EEF4FF;
  --lc-grad: linear-gradient(110deg, #04264E 0%, #0353AC 62%, #0071E3 100%);
  --lc-ink: #0E0E10;
  --lc-ink2: #4A4A52;
  --lc-ink3: #7A7A82;
  --lc-ink3m: #8C8C94;
  --lc-ink4: #B8B8BE;
  --lc-line: rgba(15, 15, 15, 0.08);
  --lc-line-s: rgba(15, 15, 15, 0.14);
  --lc-s1: #F5F5F7;
  --lc-s2: #FAFAFA;
  --lc-cream: #F7F4EE;
  --lc-cream-deep: #EFE9DE;
  --lc-live: #00A862;
  --lc-live-soft: #E6F7EF;
  --lc-warn: #B7791F;
  --lc-warn-soft: #FEF3DD;
  --lc-warn-ink: #7A5414;
  --lc-sale: #C53030;
  --lc-gold: #A57C2C;
  --lc-gold-soft: #F9F1DC;
  --lc-vendor: #1B7A43;
  --lc-vendor-soft: #EAF3EC;
  --lc-pro: #6D4AA6;
  --lc-pro-soft: #F3EEF9;
  --lc-sh-sm: 0 1px 2px rgba(15,15,15,0.05), 0 1px 3px rgba(15,15,15,0.05);
  --lc-sh-md: 0 6px 18px rgba(15,15,15,0.08), 0 2px 6px rgba(15,15,15,0.05);
  --lc-sh-lg: 0 24px 60px rgba(15,25,60,0.22), 0 8px 20px rgba(15,25,60,0.12);
}

/* ════════════════════════════════════════════════════════════════════
   BURBUJA + badge
   ════════════════════════════════════════════════════════════════════ */
.lc-bubble {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(155deg, #26262B 0%, #16161A 55%, #0B0B0D 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15,15,15,0.3), 0 3px 8px rgba(15,15,15,0.18);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 200ms cubic-bezier(0.32, 0.72, 0, 1),
              box-shadow 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.lc-bubble.is-on { display: inline-flex; }
.lc-bubble:hover { transform: scale(1.05); }
.lc-bubble:active { transform: scale(0.96); }
.lc-bubble__icon { display: inline-flex; }
.lc-bubble__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--lc-sale);
  color: #fff;
  border: 2.5px solid #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Móvil: la barra de navegación inferior del sitio es fija (56px sobre
   max(safe-area, 12px), oculta en ≥768px) → la burbuja vive ENCIMA de ella. */
@media (max-width: 767px) {
  .lc-bubble { bottom: calc(max(env(safe-area-inset-bottom, 0px), 12px) + 80px); }
  .lc-toast-stack, #lc-strip-slot { bottom: calc(max(env(safe-area-inset-bottom, 0px), 12px) + 150px); }
}

body[data-lc-hide="1"] .lc-bubble,
body[data-lc-hide="1"] .lc-toast-stack,
body[data-lc-hide="1"] #lc-strip-slot { display: none; }

/* ════════════════════════════════════════════════════════════════════
   TOASTS (mensaje nuevo, logueados)
   ════════════════════════════════════════════════════════════════════ */
.lc-toast-stack {
  position: fixed;
  right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 56;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(340px, calc(100vw - 32px));
}
.lc-toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--lc-sh-lg);
  cursor: pointer;
  text-align: left;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.25, 1);
  position: relative;
}
.lc-toast.is-in { opacity: 1; transform: translateY(0) scale(1); }
.lc-toast.is-out { opacity: 0; transform: translateY(6px) scale(0.97); }
.lc-toast__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--lc-accent-soft);
  color: var(--lc-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
}
.lc-toast__avatar img { width: 100%; height: 100%; object-fit: cover; }
.lc-toast__main { flex: 1; min-width: 0; }
.lc-toast__name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--lc-ink);
}
.lc-toast__body {
  margin: 3px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--lc-ink2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lc-toast__close {
  position: absolute;
  top: 8px; right: 8px;
  border: none;
  background: transparent;
  color: var(--lc-ink4);
  cursor: pointer;
  padding: 3px;
  display: inline-flex;
}

/* ════════════════════════════════════════════════════════════════════
   TIRA PROACTIVA (empujón a anónimos) — discreta, descartable, no modal
   ════════════════════════════════════════════════════════════════════ */
#lc-strip-slot {
  position: fixed;
  right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 56;
  max-width: min(360px, calc(100vw - 32px));
}
.lc-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--lc-sh-md);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.25, 1);
}
.lc-strip.is-in { opacity: 1; transform: translateY(0) scale(1); }
.lc-strip.is-out { opacity: 0; transform: translateY(6px) scale(0.97); }
.lc-strip__text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.35;
  color: var(--lc-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lc-strip__cta {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--lc-accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.lc-strip__close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--lc-ink4);
  cursor: pointer;
  padding: 3px;
  display: inline-flex;
}

/* ════════════════════════════════════════════════════════════════════
   AVATARES + etiquetas de contraparte (multi-parte)
   ════════════════════════════════════════════════════════════════════ */
.lc-team-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--lc-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.lc-team-avatar img { width: 62%; height: 62%; object-fit: contain; display: block; }
.lc-team-avatar--sm { width: 30px; height: 30px; }
.lc-team-avatar--lg { width: 46px; height: 46px; box-shadow: inset 0 0 0 1px var(--lc-line), 0 0 0 3px rgba(255,255,255,0.3); }
/* pila del saludo (logo + equipo) */
.lc-stack { display: flex; align-items: center; }
.lc-stack > * { box-shadow: 0 0 0 3px rgba(255,255,255,0.35); }
.lc-stack__u {
  width: 38px; height: 38px;
  border-radius: 50%;
  margin-left: -14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.lc-stack__u--brand { background: #2B8CF2; }
.lc-stack__u--gold { background: var(--lc-gold); }
.lc-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--lc-s1);
  color: var(--lc-ink2);
}
.lc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lc-avatar--vendor { background: var(--lc-vendor-soft); color: var(--lc-vendor); }
.lc-avatar--pro { background: var(--lc-pro-soft); color: var(--lc-pro); }
.lc-avatar--directo { background: var(--lc-s1); color: var(--lc-ink2); }

.lc-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.lc-tag--textti { background: var(--lc-accent-soft); color: var(--lc-accent); }
.lc-tag--vendor { background: var(--lc-vendor-soft); color: var(--lc-vendor); }
.lc-tag--pro { background: var(--lc-pro-soft); color: var(--lc-pro); }
.lc-tag--directo { background: var(--lc-s1); color: var(--lc-ink3); }
.lc-tag--onnavy { background: rgba(255,255,255,0.16); color: #fff; }

.lc-livedot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lc-live);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35);
}
.lc-livedot--sm { width: 7px; height: 7px; }

/* ════════════════════════════════════════════════════════════════════
   PANEL — hoja móvil / tarjeta escritorio
   ════════════════════════════════════════════════════════════════════ */
.lc-panel { position: fixed; inset: 0; z-index: 70; }
.lc-panel[hidden] { display: none; }
.lc-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 16, 0.4);
  opacity: 0;
  transition: opacity 220ms ease;
}
.lc-panel.is-open .lc-panel__backdrop { opacity: 1; }
.lc-panel__sheet {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
.lc-panel.is-open .lc-panel__sheet { opacity: 1; transform: translateY(0); }
.lc-panel.is-busy .lc-panel__sheet { pointer-events: none; opacity: 0.7; }

@media (min-width: 641px) {
  .lc-panel__backdrop { background: transparent; }
  .lc-panel__sheet {
    inset: auto 24px calc(96px + env(safe-area-inset-bottom, 0px)) auto;
    width: 400px;
    height: min(640px, calc(100vh - 140px));
    border-radius: 22px;
    box-shadow: var(--lc-sh-lg);
  }
}

/* Vistas: solo la del modo actual */
.lc-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.lc-panel[data-mode="home"] .lc-view--home,
.lc-panel[data-mode="list"] .lc-view--list,
.lc-panel[data-mode="thread"] .lc-view--thread,
.lc-panel[data-mode="gate"] .lc-view--gate { display: flex; }

/* ── Encabezados ── */
.lc-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px;
  background: var(--lc-grad);
  color: #fff;
}
@media (min-width: 641px) {
  .lc-head { padding-top: 12px; }
}
.lc-head--solid { background: #fff; color: var(--lc-ink); border-bottom: 1px solid var(--lc-line); }
.lc-head__main { flex: 1; min-width: 0; }
.lc-head__name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 7px;
}
.lc-head__sub {
  margin: 1px 0 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lc-head--solid .lc-head__sub { color: var(--lc-ink3); opacity: 1; }
.lc-icon-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.lc-icon-btn--ink { background: var(--lc-s1); color: var(--lc-ink2); }

/* ── HOME ── */
.lc-view--home { background: var(--lc-s1); }
.lc-hero {
  position: relative;
  flex-shrink: 0;
  background: var(--lc-grad);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 22px 24px;
}
@media (min-width: 641px) { .lc-hero { padding-top: 20px; } }
.lc-hero__weave {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 13px),
    repeating-linear-gradient(-45deg, #fff 0 2px, transparent 2px 13px);
  pointer-events: none;
}
.lc-hero__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.lc-brand-logo {
  height: 22px;
  width: auto;
  display: block;
}
.lc-brand {
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.lc-hero__title {
  position: relative;
  margin: 14px 0 0;
  color: #fff; /* :where(h1-h6) global pisa la herencia */
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.6px;
  line-height: 1.1;
}
.lc-hero__reply {
  position: relative;
  margin: 11px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(255,255,255,0.86);
}
.lc-home__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}
.lc-write {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid var(--lc-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--lc-sh-sm);
  cursor: pointer;
  text-align: left;
}
.lc-write:active { transform: scale(0.99); }
.lc-write__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-write__main strong { font-family: var(--font-sans); font-size: 15.5px; font-weight: 700; color: var(--lc-ink); }
.lc-write__main small { font-family: var(--font-sans); font-size: 12.5px; color: var(--lc-ink3); }
.lc-write__go {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--lc-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lc-recent {
  width: 100%;
  margin-top: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--lc-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--lc-sh-sm);
  cursor: pointer;
  text-align: left;
}
.lc-recent__stack { display: flex; align-items: center; }
.lc-recent__av { display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.lc-recent__av + .lc-recent__av { margin-left: -10px; }
.lc-recent__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lc-recent__main strong { font-family: var(--font-sans); font-size: 14px; font-weight: 700; color: var(--lc-ink); }
.lc-recent__main small { font-family: var(--font-sans); font-size: 12px; color: var(--lc-ink3); }
.lc-recent__badge {
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #1C1C21;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lc-recent__chev { color: var(--lc-ink4); flex-shrink: 0; }
.lc-sect-label {
  margin: 20px 2px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--lc-ink3m);
}
.lc-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lc-tile {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 106px;
  padding: 13px 14px;
  border: 1px solid var(--lc-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--lc-sh-sm);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.lc-tile:active { transform: scale(0.99); }
.lc-tile strong { font-family: var(--font-sans); font-size: 14px; font-weight: 700; color: var(--lc-ink); line-height: 1.15; }
.lc-tile small { font-family: var(--font-sans); font-size: 11.5px; color: var(--lc-ink3); line-height: 1.35; margin-top: -5px; }
.lc-tile__ic {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lc-tile__ic--navy { background: var(--lc-accent-soft); color: var(--lc-accent); }
.lc-tile__ic--gold { background: var(--lc-gold-soft); color: var(--lc-gold); }
.lc-tile__ic--green { background: var(--lc-vendor-soft); color: var(--lc-vendor); }
.lc-tile__ic--purple { background: var(--lc-pro-soft); color: var(--lc-pro); }
.lc-trust {
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3px;
  color: var(--lc-ink3m);
}

/* ── LISTA (bandeja multi-parte) ── */
.lc-view--list { background: var(--lc-s1); }
.lc-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.lc-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: none;
  border-bottom: 1px solid var(--lc-line);
  background: #fff;
  cursor: pointer;
  text-align: left;
  position: relative;
}
.lc-item:first-child { border-top-left-radius: 14px; border-top-right-radius: 14px; }
.lc-item:last-child { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; border-bottom: none; }
.lc-item:hover { background: var(--lc-s2); }
.lc-item__main { flex: 1; min-width: 0; }
.lc-item__top { display: flex; align-items: center; gap: 7px; }
.lc-item__name {
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--lc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-item__time {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--lc-ink3m);
  flex-shrink: 0;
}
.lc-item__ctx {
  display: inline-block;
  max-width: 100%;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--lc-s1);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2px;
  color: var(--lc-ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-item__preview {
  margin: 4px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--lc-ink3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-item.is-unread .lc-item__preview { color: var(--lc-ink); font-weight: 600; }
.lc-item__dot {
  position: absolute;
  right: 14px;
  bottom: 16px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--lc-accent);
}
.lc-item--locked { opacity: 0.75; }
.lc-item__avatar--lock {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--lc-s1);
  color: var(--lc-ink3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* esqueleto de carga */
.lc-skel-list { background: #fff; border-radius: 14px; padding: 6px 14px; }
.lc-skel-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; }
.lc-skel {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--lc-s1) 25%, #ECECEF 50%, var(--lc-s1) 75%);
  background-size: 200% 100%;
  animation: lcShimmer 1.3s infinite;
}
.lc-skel--av { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.lc-skel--l1 { height: 14px; flex: 1; max-width: 75%; }
.lc-skel--l2 { height: 14px; flex: 1; max-width: 55%; }
@keyframes lcShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.lc-empty {
  padding: 46px 24px;
  text-align: center;
  color: var(--lc-ink3);
  font-family: var(--font-sans);
}
.lc-empty__icon {
  display: inline-flex;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff;
  color: var(--lc-ink4);
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: var(--lc-sh-sm);
}
.lc-empty strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--lc-ink);
  letter-spacing: -0.2px;
}
.lc-empty p { margin: 7px 0 0; font-size: 13.5px; line-height: 1.5; }

/* ── HILO ── */
.lc-view--thread { background: var(--lc-s1); }
.lc-chip-slot { flex-shrink: 0; }
.lc-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid var(--lc-line);
}
.lc-chip__ic {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--lc-accent-soft);
  color: var(--lc-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lc-chip__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--lc-ink3m);
  flex-shrink: 0;
}
.lc-chip__title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--lc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lc-day {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--lc-ink3m);
  padding: 4px 0;
}
.lc-msg { display: flex; align-items: flex-end; gap: 8px; }
.lc-msg--mine { flex-direction: row-reverse; }
.lc-msg__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--lc-accent-soft);
  color: var(--lc-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
}
.lc-msg__avatar img { width: 100%; height: 100%; object-fit: cover; }
.lc-msg__bubble {
  max-width: 80%;
  padding: 10px 13px;
  border-radius: 16px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  background: #fff;
  color: var(--lc-ink);
  border: 1px solid var(--lc-line);
  border-bottom-left-radius: 5px;
}
.lc-msg--mine .lc-msg__bubble {
  background: #1C1C21;
  color: #fff;
  border: none;
  border-radius: 16px;
  border-bottom-right-radius: 5px;
}
.lc-msg__bubble--card {
  background: transparent;
  border: none;
  padding: 0;
  max-width: 92%;
  width: 100%;
}
.lc-msg__body { margin: 0; overflow-wrap: break-word; white-space: pre-wrap; }
.lc-msg__time {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  opacity: 0.55;
}
.lc-system { display: flex; justify-content: center; margin: 4px 0; }
.lc-system span {
  display: inline-flex;
  max-width: 88%;
  padding: 6px 13px;
  border-radius: 999px;
  background: #EDEEF2;
  color: var(--lc-ink3);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}
.lc-stream-empty {
  margin: auto;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--lc-ink3);
  padding: 24px 12px;
}
.lc-stream-empty strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--lc-ink);
  margin-bottom: 4px;
}
.lc-warn-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--lc-warn-soft);
  border: 1px solid rgba(183, 121, 31, 0.19);
  color: var(--lc-warn-ink);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
}
.lc-warn-banner svg { flex-shrink: 0; margin-top: 2px; color: var(--lc-warn); }

/* composer */
.lc-composer {
  flex-shrink: 0;
  border-top: 1px solid var(--lc-line);
  background: #fff;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 641px) { .lc-composer { padding-bottom: 12px; } }
.lc-composer__warn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--lc-warn-ink);
}
.lc-composer__row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  background: var(--lc-s1);
  border: 1px solid var(--lc-line);
  border-radius: 20px;
  padding: 7px 7px 7px 15px;
}
.lc-composer textarea {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  resize: none;
  font-family: var(--font-sans);
  font-size: 16px; /* 16px: iOS no hace zoom */
  line-height: 1.4;
  color: var(--lc-ink);
  padding: 5px 0;
  min-height: 22px;
  outline: none;
}
.lc-composer textarea::placeholder { color: var(--lc-ink3m); }
.lc-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--lc-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.lc-send:disabled { background: var(--lc-ink4); cursor: default; }

/* ── GATE (crear cuenta para responder) ── */
.lc-view--gate { background: var(--lc-s1); }
.lc-gate__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px));
}
.lc-gate__ctx {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--lc-line);
  border-radius: 14px;
  box-shadow: var(--lc-sh-sm);
  margin-bottom: 16px;
}
.lc-gate__ctx-main { flex: 1; min-width: 0; }
.lc-gate__ctx-name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--lc-ink);
}
.lc-gate__ctx-text {
  margin: 3px 0 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--lc-ink2);
}
.lc-gate__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.15;
  color: var(--lc-ink);
}
.lc-gate__sub {
  margin: 7px 0 16px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--lc-ink2);
}
.lc-view--gate .lc-trust { margin-top: 14px; }

/* ══ FASE C · compartir tela desde el chat (lado cliente) ══ */
.lc-tela-btn { flex-shrink: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--lc-line, #e4e4e7); border-radius: 10px; background: var(--lc-surface, #fff); color: var(--lc-ink-2, #52525b); cursor: pointer; transition: border-color .12s, color .12s; }
.lc-tela-btn:hover { border-color: var(--lc-accent, #0071e3); color: var(--lc-accent, #0071e3); }
.lc-telapick { margin: 0 0 8px; border: 1px solid var(--lc-line, #e4e4e7); border-radius: 12px; background: var(--lc-surface, #fff); box-shadow: 0 -8px 24px -12px rgba(0,0,0,.18); overflow: hidden; }
.lc-telapick__head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--lc-line, #e4e4e7); }
.lc-telapick__head input { flex: 1; border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--lc-ink, #18181b); }
.lc-telapick__results { max-height: 240px; overflow-y: auto; }
.lc-telapick__empty { margin: 0; padding: 14px 12px; font-size: 12px; color: var(--lc-ink-3, #a1a1aa); }
.lc-telapick__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; border-bottom: 1px solid var(--lc-line, #f0f0f1); background: transparent; cursor: pointer; text-align: left; }
.lc-telapick__item:hover { background: var(--lc-surface-2, #f6f6f7); }
.lc-telapick__item:last-child { border-bottom: none; }
.lc-telapick__item img, .lc-telapick__ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--lc-surface-2, #f0f0f1); flex-shrink: 0; }
.lc-telapick__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lc-telapick__info strong { font-size: 13px; font-weight: 600; color: var(--lc-ink, #18181b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-telapick__info small { font-size: 11.5px; color: var(--lc-ink-3, #71717a); }

/* ═══ v7 (2026-07-16): adjuntos, resumen "Para ti", expandir, barra inferior ═══ */

/* ── Adjuntos genéricos (imagen / documento) en burbujas ── */
.lc-att-img { display: block; margin: 2px 0 4px; border-radius: 10px; overflow: hidden; max-width: 240px; }
.lc-att-img img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; }
.lc-att-doc {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 2px 0 4px; padding: 8px 12px;
  border: 1px solid rgb(0 0 0 / 0.10); border-radius: 10px;
  background: rgb(255 255 255 / 0.75);
  font-size: 12.5px; font-weight: 600; color: inherit; text-decoration: none;
  max-width: 100%;
}
.lc-att-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-att-doc:hover { background: rgb(255 255 255 / 0.95); }
.lc-att-doc svg { flex-shrink: 0; opacity: 0.7; }

/* ── "Para ti": resumen COMPACTO del inicio ── */
.lc-pt { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.lc-pt-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; text-align: left; text-decoration: none; cursor: pointer;
  background: var(--lc-surface, #fff);
  border: 1px solid var(--lc-line, #e4e4e7); border-radius: 14px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.04); font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.lc-pt-row:hover { border-color: var(--lc-ink-4, #a1a1aa); box-shadow: 0 3px 10px rgb(0 0 0 / 0.07); transform: translateY(-1px); }
.lc-pt-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.lc-pt-ic.is-live { background: var(--lc-accent-soft, #eef4ff); color: var(--lc-accent, #0071e3); }
.lc-pt-ic.is-prep { background: var(--lc-surface-2, #f4f4f5); color: var(--lc-ink-2, #3f3f46); }
.lc-pt-ic.is-ok   { background: #e5f5ec; color: #00814c; }
.lc-pt-ic.is-warn { background: #fdf3e0; color: #a16207; }
.lc-pt-ic.is-gold { background: #f7f0df; color: #8a6d1d; }
.lc-pt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lc-pt-main strong {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  font-size: 13px; font-weight: 650; color: var(--lc-ink, #09090b); letter-spacing: -0.1px;
}
.lc-pt-main small { font-size: 11.5px; color: var(--lc-ink-3, #71717a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-pt-estado {
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.lc-pt-estado.is-live { background: var(--lc-accent-soft, #eef4ff); color: var(--lc-accent, #0071e3); }
.lc-pt-estado.is-prep { background: var(--lc-surface-2, #f4f4f5); color: var(--lc-ink-2, #3f3f46); }
.lc-pt-estado.is-ok   { background: #e5f5ec; color: #00814c; }
.lc-pt-estado.is-warn { background: #fdf3e0; color: #a16207; }
.lc-pt-chev { flex-shrink: 0; color: var(--lc-ink-4, #a1a1aa); }
.lc-pt-cta {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px;
  background: var(--lc-ink, #09090b); color: #fff;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.lc-pt-row:hover .lc-pt-cta { opacity: 0.9; }

/* ── Expandir/contraer (paridad Crisp) — solo escritorio ── */
.lc-expand { display: none; }
.lc-expand .lc-expand__min { display: none; }
@media (min-width: 900px) {
  .lc-expand { display: inline-flex; }
  .lc-panel__sheet { transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1), width 260ms cubic-bezier(0.32, 0.72, 0, 1); }
  .lc-panel.is-expanded .lc-panel__sheet { width: min(760px, 92vw); }
  .lc-panel.is-expanded .lc-expand .lc-expand__max { display: none; }
  .lc-panel.is-expanded .lc-expand .lc-expand__min { display: inline; }
  .lc-panel.is-expanded .lc-msg__bubble { max-width: 520px; }
}

/* ── Barra inferior de navegación (Inicio / Mensajes) ── */
.lc-bar {
  display: none; flex-shrink: 0;
  border-top: 1px solid var(--lc-line, #e4e4e7);
  background: var(--lc-surface, #fff);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
}
.lc-panel[data-mode="home"] .lc-bar,
.lc-panel[data-mode="list"] .lc-bar { display: flex; }
.lc-bar__tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border: none; background: transparent; cursor: pointer;
  color: var(--lc-ink-3, #71717a); font-size: 10.5px; font-weight: 600;
  border-radius: 10px; transition: color 0.15s ease, background 0.15s ease;
  position: relative;
}
.lc-bar__tab:hover { color: var(--lc-ink, #09090b); background: var(--lc-surface-2, #f4f4f5); }
.lc-panel[data-mode="home"] .lc-bar__tab--home,
.lc-panel[data-mode="list"] .lc-bar__tab--list { color: var(--lc-accent, #0071e3); }
.lc-bar__badge {
  position: absolute; top: 2px; right: calc(50% - 18px);
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px;
  background: var(--lc-danger, #ef4444); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 15px; text-align: center;
}

/* ── v7.1: expansión CORRECTA (alto + ancho, estilo Intercom) + posición del botón ── */
@media (min-width: 900px) {
  .lc-panel.is-expanded .lc-panel__sheet {
    inset: 20px 20px 20px auto;   /* casi toda la altura, anclada a la derecha */
    width: min(720px, calc(100vw - 40px));
    height: auto;                 /* la definen top+bottom del inset */
  }
  .lc-panel.is-expanded .lc-home__body,
  .lc-panel.is-expanded .lc-list { padding-left: 22px; padding-right: 22px; }
}
/* El botón expandir SIEMPRE pegado al grupo derecho (el space-between del héroe lo dejaba flotando en el centro). */
.lc-hero__top { gap: 8px; }
.lc-hero__top .lc-expand { margin-left: auto; }
