.ayudante-publico-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 2040;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: none;
  background: #0d6efd;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.ayudante-publico-fab:hover {
  background: #0b5ed7;
}

.ayudante-publico-fab--minimizado {
  background: #198754;
  box-shadow: 0 4px 16px rgba(25, 135, 84, 0.35);
}

.ayudante-publico-fab--minimizado:hover {
  background: #157347;
}

.ayudante-publico-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2045;
}

.ayudante-publico-backdrop[hidden] {
  display: none !important;
}

.ayudante-publico-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 2050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.ayudante-publico-panel.ayudante-publico-panel--abierto,
html.ayudante-publico-preabrir .ayudante-publico-panel {
  transform: translateX(0);
}

html.ayudante-publico-preabrir .ayudante-publico-backdrop {
  display: block !important;
}

html.ayudante-publico-preabrir .ayudante-publico-backdrop[hidden] {
  display: block !important;
}

.ayudante-publico-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #dee2e6;
  flex-shrink: 0;
}

.ayudante-publico-panel__title {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 600;
}

.ayudante-publico-panel__mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ayudante-publico-msg {
  max-width: 92%;
  padding: 0.55rem 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ayudante-publico-msg--user {
  align-self: flex-end;
  background: #0d6efd;
  color: #fff;
}

.ayudante-publico-msg--bot {
  align-self: flex-start;
  background: #f1f3f5;
  color: #212529;
}

.ayudante-publico-msg__links {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ayudante-publico-panel__chips {
  padding: 0 1rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ayudante-publico-form-busqueda {
  padding: 0 1rem 0.75rem;
  flex-shrink: 0;
  border-top: 1px solid #eee;
  padding-top: 0.75rem;
}

.ayudante-publico-panel__footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #dee2e6;
  flex-shrink: 0;
}

.ayudante-publico-form__acciones {
  display: flex;
  gap: 0.5rem;
  justify-content: stretch;
}

.ayudante-publico-form__acciones .btn {
  flex: 1 1 0;
}
