:root {
    --hc-bg: #fff;
    --hc-primary: #2563eb;
    --hc-primary-600: #1d4ed8;
    --hc-text: #0f172a;
    --hc-muted: #6b7280;
    --hc-line: #e5e7eb;
    --hc-soft: #fafafa;
    --hc-shadow: 0 14px 30px rgba(16, 24, 40, .14)
}

* {
    box-sizing: border-box
}

.hc-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1060
}

.hc-fab .hc-pill {
    background: #0ea5e9;
    color: #fff;
    border-radius: 999px;
    padding: 8px 10px;
    font-weight: 700;
    box-shadow: var(--hc-shadow);
    display: none
}

.hc-fab .hc-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 20px rgba(2, 6, 23, .18);
    transition: transform .12s ease
}

.hc-fab .hc-btn i {
    font-size: 22px
}

.hc-fab .hc-btn:active {
    transform: scale(.98)
}

.hc-fab .hc-dot {
    position: absolute;
    right: -2px;
    top: -2px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #9ca3af;
    border: 2px solid #fff
}

.hc-fab .hc-badge {
    position: absolute;
    left: -6px;
    top: -6px;
    background: #f59e0b;
    color: #111827;
    border-radius: 999px;
    font-size: .72rem;
    line-height: 1;
    padding: 3px 6px;
    border: 2px solid #fff;
    display: none
}

@media(hover:hover) {
    .hc-fab:hover .hc-pill {
        display: block
    }
}

.hc-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 380px;
    max-width: 92vw;
    background: #fff;
    border: 1px solid var(--hc-line);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(2, 6, 23, .16);
    overflow: hidden;
    z-index: 1060;
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .16s ease, transform .16s ease
}

.hc-panel.open {
    display: block;
    opacity: 1;
    transform: translateY(0)
}

.hc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hc-line);
    background: #fff
}

.hc-brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.hc-logo {
    background: #fbbf24;
    color: #000;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px
}

.hc-title {
    line-height: 1;
    display: flex;
    flex-direction: column
}

.hc-title strong {
    font-size: 14px;
    color: var(--hc-text)
}

.hc-status {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #16a34a;
    font-weight: 500;
    font-size: 10px;
}


.hc-status .dot {
    width: 6px;
    height: 5px;
    border-radius: 50%;
}
.hc-icon {
    border: none;
    background: #f2f4f7;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: #344054;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.hc-icon:hover {
    filter: brightness(.96)
}

.hc-body {
    padding: 14px;
    background: #fff
}

.hc-body h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: var(--hc-text)
}

.hc-sub {
    color: var(--hc-muted);
    margin: 0 0 10px 0;
    font-size: .95rem
}

.hc-bullets {
    padding-left: 18px;
    margin: 0 0 12px 0;
    color: #475569;
    font-size: .95rem
}

.hc-tip {
    background: #f9fafb;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    color: #475569;
    font-size: .9rem
}

.hc-chat {
    display: flex;
    flex-direction: column;
    height: 520px;
    background: #fff
}

.hc-room {
    flex: 1;
    overflow: auto;
    padding: 20px;
    background: #fafafa
}

.hc-room::-webkit-scrollbar {
    width: 6px
}

.hc-room::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px
}

.hc-empty {
    color: #6b7280;
    text-align: center;
    margin: 40px 0 20px 0;
    font-size: 14px
}

.hc-sep {
    display: inline-block;
    margin: 18px auto 14px auto;
    background: #eef2f7;
    color: #6b7280;
    font-size: 12px;
    border-radius: 999px;
    padding: 3px 10px
}

.msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: hcFade .2s ease
}

@keyframes hcFade {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.msg.me {
    flex-direction: row-reverse
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0
}

.msg.them .avatar {
    background: #10b981
}

.bubble {
    max-width: 70%;
    background: #fff;
    border: 1px solid var(--hc-line);
    border-radius: 12px;
    border-bottom-left-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #111827
}

.msg.me .bubble {
    background: #dbeafe;
    border-color: #dbeafe;
    color: #1e40af;
    border-bottom-right-radius: 6px
}

.btxt {
    white-space: pre-wrap;
    word-wrap: break-word
}

.meta {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start
}

.msg.me .meta {
    justify-content: flex-end
}

.ticks {
    display: inline-flex;
    gap: 2px;
    transform: translateY(1px)
}

.tick {
    font-style: normal;
    font-size: 14px;
    color: #9ca3af
}

.tick.ok {
    color: #2563eb
}

.msg-typing .bubble {
    display: flex;
    gap: 6px;
    align-items: center
}

.msg-typing .bubble.typing {
    background: #fff;
    border-color: var(--hc-line)
}

.msg-typing .dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: hcTyping 1.4s infinite
}

.msg-typing .dot:nth-child(2) {
    animation-delay: .2s
}

.msg-typing .dot:nth-child(3) {
    animation-delay: .4s
}

@keyframes hcTyping {

    0%,
    60%,
    100% {
        transform: translateY(0)
    }

    30% {
        transform: translateY(-6px)
    }
}

.hc-att {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--hc-line);
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 8px;
    text-decoration: none;
    color: #0f172a
}

.hc-att-img {
    border: none;
    padding: 0
}

.hc-att-img img {
    max-width: 240px;
    border-radius: 10px;
    display: block
}

.hc-att-file i {
    font-size: 18px;
    color: #344054
}

.hc-att-file .meta {
    display: flex;
    flex-direction: column
}

.hc-att-file .meta small {
    color: #667085
}

.hc-att-file .dl i {
    font-size: 16px;
    color: #0f172a
}

.hc-file-preview {
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid var(--hc-line)
}

.fp-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--hc-line)
}

.fp-icon {
    width: 40px;
    height: 40px;
    background: #dbeafe;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb
}

.fp-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.fp-size {
    font-size: 12px;
    color: #6b7280
}

.hc-bottom {
    border-top: 1px solid var(--hc-line);
    background: #fff
}

.hc-form {
    display: grid;
    grid-template-columns: 40px 1fr 44px;
    gap: 12px;
    padding: 16px 20px
}

.hc-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f3f5f7;
    color: #6b7280;
    cursor: pointer
}

.hc-attach i {
    font-size: 20px
}

.hc-form textarea {
    width: 100%;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    border: 1px solid var(--hc-line);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit
}

.hc-form textarea:focus {
    outline: none;
    border-color: #2563eb
}



.btns {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: .92rem;
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.btn-primary {
    background: #2563eb;
    color: #fff
}

.btn-primary:hover {
    background: #1d4ed8
}

.btn-outline {
    background: #fff;
    border-color: #d0d5dd;
    color: #111827
}

.btn-outline:hover {
    border-color: #98a2b3
}

.btn-light {
    background: #f8fafc;
    border-color: #e4e7ec;
    color: #0f172a
}

.hc-actions-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    gap: 8px
}

.hc-cta {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--hc-line);
    background: #fff
}

.hc-typing {
    padding: 0 20px 12px 20px
}

@media(max-width:420px) {
    .hc-panel {
        right: 12px;
        width: auto;
        left: 12px
    }
}

.hc-panel,
.hc-panel * {
    font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif !important
}

/* --- Header logo --- */
.hc-logo-img {
    height: 28px;
    width: auto;
    display: block
}

/* --- Línea de entrada: alturas iguales y alineación --- */
.hc-form {
    display: grid !important;
    grid-template-columns: 44px 1fr 44px !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    align-items: center !important;
    border-top: 1px solid var(--hc-line) !important;
    background: #fff !important;
}

.hc-attach {
    width: 44px !important;
    height: 44px !important;
    border-radius: 8px !important;
    background: #F3F5F6 !important;
    color: #6b7280 !important;
    display: ruby;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #e7e9ee !important;
    margin-top: 8px;
    cursor: context-menu;
}

.hc-attach i {
    font-size: 16px !important
}

.hc-form textarea {
    min-height: 44px !important;
    max-height: 120px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    border: 1px solid var(--hc-line) !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
}

.hc-form textarea:focus {
    outline: none !important;
    border-color: #2563eb !important
}

.hc-send {
    width: 41px !important;
    height: 41px !important;
    border-radius: 10px !important;
    border: none !important;
    background: #003399 !important;
    color: #fff !important;
    display: flex !important
;
    align-items: center !important;
    justify-content: center !important;
}

.hc-send i {
    font-size: 18px !important
}

/* --- Barra “Cerrar ticket” estilo fila (no botón) --- */
.hc-closebar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
    background: #fff !important;
    border-top: 1px solid var(--hc-line) !important;
    cursor: pointer !important;
}

.hc-closebar .hl {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: #374151 !important;
    font-weight: 500 !important
}

.hc-closebar .hl i {
    color: #10b981 !important
}

.hc-closebar .bi-chevron-down {
    color: #6b7280 !important
}

.hc-closebar:hover {
    background: #f9fafb !important
}

/* --- Ajustes de burbuja y checks para consistencia --- */
.msg .meta {
    font-size: 12px !important
}

.msg.me .bubble {
    background: #dbeafe !important;
    border-color: #dbeafe !important
}

.tick {
    font-size: 14px !important
}

.tick.ok {
    color: #2563eb !important
}

/* --- Pequeño ajuste del contenedor total --- */
.hc-chat {
    height: 520px !important
}

.msg .content{
  display:flex !important;
  flex-direction:column !important;
  max-width:70% !important;      /* igual que la burbuja */
}

/* La burbuja no debe estirar el contenedor más de lo necesario */
.bubble{
  display:inline-block !important;
  max-width:100% !important;
}

/* Alineación por tipo de mensaje */
.msg.them .content{ align-items:flex-start !important; }
.msg.me   .content{ align-items:flex-end   !important; }

/* Fila de hora + checks justo debajo de la burbuja */
.msg .meta{
  margin-top:6px !important;
  font-size:.75rem !important;
  color:#667085 !important;
  line-height:1 !important;
  display:flex !important;
  gap:6px !important;
  align-items:center !important;
  /* no permitimos que se estire a la derecha del contenedor */
  max-width:100% !important;
}

/* Asegurar que no herede justificaciones raras */
.msg .meta{ justify-content:flex-start !important; }
.msg.me .meta{ justify-content:flex-end !important; }

/* (Opcional) ajustes visuales menores */
.tick{ font-size:14px !important; color:#9ca3af !important; }
.tick.ok{ color:#2563eb !important; }

/* El puntito de “Online” perfectamente redondo */
.hc-status .dot{ width:8px !important; height:8px !important; background:#10b981 !important; }

/* La línea de entrada: todos iguales de alto y alineados */
.hc-form{ grid-template-columns:44px 1fr 44px !important; align-items:center !important; }
.hc-form textarea{ min-height:44px !important; }
.hc-send{ width:44px !important; height:44px !important; }

.hc-sending-dot{display:inline-block;width:4px;height:4px;border-radius:999px;background:#9ca3af;margin-left:3px;animation:hcBlink 1.2s infinite}
.hc-sending-dot:nth-child(2){animation-delay:.2s}
.hc-sending-dot:nth-child(3){animation-delay:.4s}
@keyframes hcBlink{0%,60%,100%{opacity:.35}30%{opacity:1}}
.bubble.pending{opacity:.85}
.bubble.failed{border-color:#fca5a5;background:#fff1f2}





.hc-guest{display:flex;align-items:center;gap:12px;padding:12px 14px;border-top:1px solid var(--hc-line);background:#fff}
.hc-guest-icon{width:32px;height:32px;border-radius:8px;background:#f3f4f6;display:flex;align-items:center;justify-content:center;color:#111827}
.hc-guest-copy{flex:1}
.hc-guest-copy #hc-guest-title{font-weight:700}
.hc-guest-sub{color:#6b7280;font-size:.95rem}
.hc-guest .btns{margin-left:auto}
.hc-sending-dot{display:inline-block;width:6px;height:6px;background:#9ca3af;border-radius:999px;margin-left:3px;animation:hcBounce 1.2s infinite}
.hc-sending-dot:nth-child(2){animation-delay:.15s}
.hc-sending-dot:nth-child(3){animation-delay:.3s}
@keyframes hcBounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}

.hc-toast {
  position: fixed;
  top: auto;
  right: 24px;
  bottom: 96px;
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid #94a3b8;
  border-left: 4px solid #0b1b3b;
  border-radius: 4px;
  background: #f8fbff;
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .28);
  opacity: 0;
  pointer-events: none;
  transform: translateX(120%);
  overflow: hidden;
}

.hc-toast.show {
  opacity: 1;
  pointer-events: auto;
  animation: hcToastIn .28s ease-out forwards;
}

.hc-toast.is-closing {
  pointer-events: none;
  animation: hcToastOut .22s ease-in forwards;
}

.hc-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: #0b1b3b;
  color: #ffffff;
}

.hc-toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
}

.hc-toast-content strong {
  font-size: .92rem;
}

.hc-toast-content span {
  color: #64748b;
  font-size: .78rem;
}

.hc-toast-open,
.hc-toast-close {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hc-toast-open {
  padding: 6px 4px;
  color: #2563eb;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 48px;
  overflow: visible;
  text-overflow: clip;
}

.hc-toast-open:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.hc-toast-close {
  align-self: flex-start;
  padding: 2px;
  color: #64748b;
}

.hc-toast-close:hover {
  color: #0f172a;
}

.hc-toast-open:focus-visible,
.hc-toast-close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@keyframes hcToastIn {
  from { opacity: 0; transform: translateX(120%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes hcToastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(120%); }
}

@media (max-width: 576px) {
  .hc-toast {
    right: 16px;
    bottom: 88px;
  }
}
