/* Asistente PRO del portal — mismo lenguaje visual que la app (SupportAgent + Material). */
#pmsgAsistenteBtn.pmsg-as-fab,
#pmsgAsistentePanel.pmsg-as-panel,
#pmsgAsistentePanel.pmsg-as-panel * {
  box-sizing: border-box;
}
#pmsgAsistenteBtn.pmsg-as-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483001;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #1976d2;
  color: #fff;
  box-shadow: 0 4px 6px rgba(25, 118, 210, 0.22), 0 8px 20px rgba(17, 24, 39, 0.16);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
#pmsgAsistenteBtn.pmsg-as-fab:hover {
  background: #1565c0;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(25, 118, 210, 0.32);
}
#pmsgAsistenteBtn.pmsg-as-fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(25, 118, 210, 0.45);
}
#pmsgAsistenteBtn.pmsg-as-fab svg {
  width: 26px;
  height: 26px;
  display: block;
}

#pmsgAsistentePanel.pmsg-as-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 2147483000;
  width: min(400px, calc(100vw - 24px));
  height: min(580px, 74vh);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.2);
  overflow: hidden;
  font: 14px/1.45 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  color: #111827;
}
#pmsgAsistentePanel.pmsg-as-panel[hidden] {
  display: none !important;
}

.pmsg-as-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  flex: none;
}
.pmsg-as-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e3f2fd;
  color: #1976d2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pmsg-as-head-icon svg {
  width: 22px;
  height: 22px;
}
.pmsg-as-head-txt {
  flex: 1;
  min-width: 0;
}
.pmsg-as-head-txt strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.pmsg-as-head-txt span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
  font-weight: 500;
}
.pmsg-as-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  flex: none;
}
.pmsg-as-close {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #6b7280;
  border-radius: 20px;
  cursor: pointer;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pmsg-as-close svg {
  width: 20px;
  height: 20px;
}
.pmsg-as-close:hover {
  background: #f4f7fb;
  color: #111827;
}

.pmsg-as-msgs {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
  background: #f4f7fb;
  -webkit-overflow-scrolling: touch;
}
.pmsg-as-row {
  display: flex;
  margin: 0 0 10px;
}
.pmsg-as-row.is-mio {
  justify-content: flex-end;
}
.pmsg-as-burbuja {
  max-width: 82%;
  padding: 10px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
}
.pmsg-as-row:not(.is-mio) .pmsg-as-burbuja {
  background: #e8eaed;
  color: #374151;
  border-radius: 16px 16px 16px 4px;
}
.pmsg-as-row.is-mio .pmsg-as-burbuja {
  background: #1976d2;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}

.pmsg-as-chips-wrap {
  flex: none;
  padding: 4px 16px 12px;
  background: #f4f7fb;
}
.pmsg-as-chips-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin: 0 0 8px;
}
.pmsg-as-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pmsg-as-chip {
  border: 0;
  background: rgba(232, 234, 237, 0.85);
  color: #111827;
  border-radius: 8px;
  padding: 8px 12px;
  font: 500 12.5px/1.2 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}
.pmsg-as-chip:hover {
  background: #dce3ea;
}

.pmsg-as-form {
  flex: none;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e8eaed;
}
.pmsg-as-input-wrap {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}
#pmsgAsistentePanel.pmsg-as-panel input[type="file"] {
  display: none !important;
}
.pmsg-as-foto {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #1976d2;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
}
.pmsg-as-foto:hover {
  background: #e3f2fd;
}
.pmsg-as-foto svg {
  width: 24px;
  height: 24px;
}
.pmsg-as-input {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  resize: none;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  box-sizing: border-box;
  border: 1px solid #c5cdd6;
  border-radius: 4px;
  padding: 11px 12px;
  font: 14px/1.3 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  color: #111827;
  background: #fff;
}
.pmsg-as-input:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 1px #1976d2;
}
.pmsg-as-enviar {
  position: static;
  flex: 0 0 auto;
  border: 0;
  background: #1976d2;
  color: #fff;
  border-radius: 16px;
  height: 48px;
  min-width: 88px;
  padding: 0 14px;
  font: 600 13px/1 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(25, 118, 210, 0.28);
}
.pmsg-as-enviar:hover {
  background: #1565c0;
}
.pmsg-as-enviar svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {
  #pmsgAsistenteBtn.pmsg-as-fab {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  #pmsgAsistentePanel.pmsg-as-panel {
    right: 8px;
    left: 8px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: min(70vh, calc(100dvh - 96px));
    max-height: calc(100dvh - 96px);
    border-radius: 16px;
  }
  .pmsg-as-enviar {
    padding: 0 12px;
    min-width: 88px;
  }
}

@media (min-width: 641px) {
  .pmsg-as-enviar {
    padding: 0 16px;
  }
}
