:root{
  --chat-dock-height: 64px;
  --chat-yellow: #FFC83D;
  --chat-dark: #161a24;
  --chat-radius: 16px;
  --chat-border: #e6e6e6;
  --chat-shadow: 0 4px 24px rgba(0,0,0,0.10);
  --chat-header-color: #333;
  --chat-body-bg: #fff;
  --chat-msg-title: #222;
  --chat-msg-text: #444;
  --chat-msg-time: #888;
  --chat-input-bg: #f8f8f8;
  --chat-input-border: #e6e6e6;
  --chat-btn-bg: #fff;
  --chat-btn-border: #FFD050;
  --chat-btn-color: #FFD050;
  --chat-btn-hover: #ffe9a7;
}


/* Dock fijo */
.chat-dock{
  position: fixed; left:0; right:0; bottom:0; height: var(--chat-dock-height); z-index:1050;
}

/* Ventana */

.chat-window {
  position: fixed;
  right: 24px;
  bottom: calc(var(--chat-dock-height) + 24px);
  width: 420px;
  max-width: 96vw;
  z-index: 1060;
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  background: var(--chat-body-bg);
  border: 1px solid var(--chat-border);
}
.chat-card {
  overflow: hidden;
  border-radius: var(--chat-radius);
  background: var(--chat-body-bg);
}
.chat-hdr {
  background: var(--chat-yellow);
  color: #1f1f1f;
  border-bottom: 1px solid rgba(0,0,0,.08);
  border-radius: var(--chat-radius) var(--chat-radius) 0 0;
  min-height: 48px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
}
.chat-body {
  max-height: 440px;
  overflow-y: auto;
  background: var(--chat-body-bg);
  padding: 24px 32px 0 32px;
  padding-bottom: 0;
}
.dot {
  margin: 0 .35rem;
  color: #adb5bd;
}
.date-sep {
  position: relative;
  text-align: center;
  margin: 6px 0 16px;
  color: #bdbdbd;
  font-size: .90rem;
  font-weight: 500;
}
.date-sep::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid #e6e6e6;
  transform: translateY(-50%);
}
.date-sep span {
  background: #fff;
  padding: 0 .7rem;
  position: relative;
}
.chat-ftr {
  background: #fff;
  border-top: 1px solid #eee;
  border-radius: 0 0 var(--chat-radius) var(--chat-radius);
  padding: 16px 20px 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-input {
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid #e6e6e6;
  font-size: 1.08rem;
  padding: 10px 20px;
  color: #222;
  box-shadow: none;
  min-width: 0;
  flex: 1 1 auto;
  height: 44px;
}
.chat-ftr .btn {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.3rem;
  box-shadow: none;
  border: 1.5px solid var(--chat-yellow);
  background: #fff;
  transition: background 0.2s, border 0.2s;
}
.chat-ftr .btn.btn-warning {
  background: var(--chat-yellow);
  color: #fff;
  border: 1.5px solid var(--chat-yellow);
  box-shadow: none;
}
.chat-ftr .btn.btn-warning:hover {
  background: #ffe9a7;
  color: #222;
  border: 1.5px solid var(--chat-yellow);
}
.chat-ftr .btn.btn-light {
  background: #fff;
  color: var(--chat-yellow);
  border: 1.5px solid var(--chat-yellow);
}
.chat-ftr .btn.btn-light:hover {
  background: #ffe9a7;
  color: var(--chat-yellow);
}
.msg-row {
  gap: 16px !important;
  margin-bottom: 32px !important;
}
.msg-row img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  margin-top: 2px;
}
.msg-row .fw-semibold {
  color: #1f1f1f;
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 2px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.msg-row .text-body-secondary {
  color: #222;
  font-size: 1.01rem;
  margin-top: 2px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.msg-row .text-muted.small {
  color: #888 !important;
  font-size: .98em;
  font-weight: 400;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.msg-row ul {
  margin: 10px 0 0 0;
  padding-left: 24px;
}
.msg-row li {
  color: #444;
  font-size: 1em;
  margin-bottom: 3px;
}
.chat-card {
  box-shadow: var(--chat-shadow);
}


/* Chips */
.chat-chips {
  display: flex;
  gap: 12px;
  align-items: center;
}
.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px 0 8px;
  background: var(--chat-yellow);
  color: #1f1f1f;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  cursor: pointer;
}
.chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.chip-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-close {
  margin-left: 6px;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: background 0.2s;
}
.chip-close:hover {
  background: #ffe9a7;
}


/* ===== MOBILE ===== */
@media (max-width: 576px){
  .chat-window{
    left: 8px; right: 8px; width: auto; max-width: none; border-radius:14px;
    bottom: max(calc(var(--chat-dock-height) + 8px), env(safe-area-inset-bottom));
  }
  .chat-card{ border-radius:14px; }
  .chat-body{ max-height: calc(100vh - 220px); }

  /* composer como barra oscura */
  .chat-ftr{
    background: var(--chat-dark); border-top:none;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }
  .chat-ftr .btn.btn-light{ background:transparent; border-color:rgba(255,255,255,.15); color:#fff; }
  .chat-ftr .btn.btn-warning{ background:var(--chat-yellow); color:#1f1f1f; border:0; }
  .chat-input{ background:#fff; border:0; }

  /* chips compactos: solo avatar + X */
  .chat-chips{ gap:8px; }
  .chat-chip{ height:48px; width:56px; padding:0; justify-content:center; border-radius:10px; }
  .chat-chip .chip-name{ display:none; }
  .chat-chip .chip-avatar{ width:30px; height:30px; }
  .chat-chip .chip-close{ position:absolute; right:10px; font-size:22px; }
}
