/* SOLΞ Voice — panel «Pregunta a la web». Aislado del tema: todo con prefijo
   y valores explícitos para que ningún maquetador lo deforme. */
.solx-assist {
  --solx-assist-accent: #7c3aed;
  --solx-assist-ink: #0f172a;
  --solx-assist-muted: #64748b;
  --solx-assist-line: #e2e8f0;
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 2147483600;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: min(620px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #fff;
  color: var(--solx-assist-ink);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28), 0 2px 6px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  font: 400 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: normal;
  text-align: left;
  animation: solx-assist-in 0.18s ease-out;
}
.solx-assist[hidden] { display: none !important; }
.solx-assist--left { right: auto; left: 20px; }
.solx-assist *, .solx-assist *::before, .solx-assist *::after { box-sizing: border-box; }
@keyframes solx-assist-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.solx-assist__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  background: var(--solx-assist-accent);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.12));
  color: #fff;
}
.solx-assist__avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.solx-assist__avatar svg { width: 22px; height: 22px; }
.solx-assist__avatar.has-img { flex-basis: 44px; width: 44px; height: 44px; padding: 0; background: #fff; overflow: hidden; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }
.solx-assist__avatar img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 50%; object-fit: cover; }
.solx-assist__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.solx-assist__title { font-size: 16px; font-weight: 700; line-height: 1.25; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.solx-assist__subtitle { font-size: 12.5px; opacity: 0.9; color: #fff; }
.solx-assist__close {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  line-height: 0;
}
.solx-assist__close:hover, .solx-assist__close:focus-visible { background: rgba(255, 255, 255, 0.3); outline: 2px solid #fff; outline-offset: 1px; }
.solx-assist__close svg { width: 20px; height: 20px; }

.solx-assist__tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px;
  background: var(--solx-assist-accent);
  background-image: linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12));
}
.solx-assist__tab {
  margin: 0;
  padding: 9px 14px 10px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600; font-size: 13.5px; line-height: 1;
  font-family: inherit;
  cursor: pointer;
}
.solx-assist__tab.is-active { background: #fff; color: var(--solx-assist-ink); }
.solx-assist__tab:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.solx-assist__body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #f8fafc; }
.solx-assist__thread, .solx-assist__articles { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 6px; overscroll-behavior: contain; }
.solx-assist__thread[hidden], .solx-assist__articles[hidden] { display: none !important; }

.solx-assist__msg { max-width: 88%; margin: 0 0 10px; padding: 10px 13px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.solx-assist__msg p { margin: 0; padding: 0; font-size: 14.5px; line-height: 1.5; color: inherit; }
.solx-assist__msg--bot { background: #fff; border: 1px solid var(--solx-assist-line); border-bottom-left-radius: 4px; color: var(--solx-assist-ink); }
.solx-assist__msg--user { margin-left: auto; background: var(--solx-assist-accent); color: #fff; border-bottom-right-radius: 4px; }
.solx-assist__msg--user p { color: #fff; }

.solx-assist__links { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.solx-assist__links li { margin: 0; padding: 8px 10px; background: #f1f5f9; border-radius: 10px; }
.solx-assist__links a { color: var(--solx-assist-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.solx-assist__links a:focus-visible { outline: 2px solid var(--solx-assist-accent); outline-offset: 2px; }
.solx-assist__snippet { display: block; margin-top: 3px; font-size: 13px; color: #475569; line-height: 1.4; }
.solx-assist__articles .solx-assist__links li { background: #fff; border: 1px solid var(--solx-assist-line); }
.solx-assist__empty { margin: 8px 2px; color: var(--solx-assist-muted); font-size: 14px; }

.solx-assist__tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.solx-assist__tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #ede9fe; color: #5b21b6; }
.solx-assist__speak {
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--solx-assist-line);
  border-radius: 50%;
  background: #fff;
  color: #334155;
  cursor: pointer;
  line-height: 0;
}
.solx-assist__speak:hover, .solx-assist__speak:focus-visible { border-color: var(--solx-assist-accent); color: var(--solx-assist-accent); outline: none; }
.solx-assist__speak svg { width: 16px; height: 16px; }

.solx-assist__chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 12px; }
.solx-assist__chip {
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--solx-assist-accent);
  border-radius: 999px;
  background: #fff;
  color: var(--solx-assist-accent);
  font-weight: 600; font-size: 13px; line-height: 1.2;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.solx-assist__chip:hover, .solx-assist__chip:focus-visible { background: var(--solx-assist-accent); color: #fff; outline: none; }

.solx-assist__typing { display: inline-flex; align-items: center; }
.solx-assist__dots { display: inline-flex; gap: 4px; padding: 2px 0; }
.solx-assist__dots i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: solx-assist-dot 1s infinite ease-in-out; }
.solx-assist__dots i:nth-child(2) { animation-delay: 0.15s; }
.solx-assist__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes solx-assist-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.solx-assist__sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.solx-assist__composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 0;
  padding: 10px 10px 8px 14px;
  border-top: 1px solid var(--solx-assist-line);
  background: #fff;
}
.solx-assist__input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 120px;
  margin: 0;
  padding: 9px 4px;
  border: 0;
  background: transparent;
  color: var(--solx-assist-ink);
  font-weight: 400; font-size: 15px; line-height: 1.35;
  font-family: inherit;
  resize: none;
  box-shadow: none;
  outline: none;
}
.solx-assist__mic, .solx-assist__send {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
}
.solx-assist__mic { background: #f1f5f9; color: #334155; }
.solx-assist__mic:hover, .solx-assist__mic:focus-visible { background: #e2e8f0; outline: 2px solid var(--solx-assist-accent); outline-offset: 1px; }
.solx-assist__mic.is-listening { background: #dc2626; color: #fff; animation: solx-assist-pulse 1.2s infinite; }
@keyframes solx-assist-pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); } 70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.solx-assist__send { background: var(--solx-assist-accent); color: #fff; }
.solx-assist__send:disabled { opacity: 0.5; cursor: default; }
.solx-assist__send:focus-visible { outline: 2px solid var(--solx-assist-ink); outline-offset: 1px; }
.solx-assist__mic svg, .solx-assist__send svg { width: 22px; height: 22px; }

.solx-assist__note { margin: 0; padding: 4px 14px 9px; background: #fff; color: var(--solx-assist-muted); font-size: 11.5px; line-height: 1.3; text-align: center; }

@media (max-width: 600px) {
  .solx-assist, .solx-assist--left { left: 0; right: 0; bottom: 0; top: 0; width: 100%; max-width: none; height: 100%; border-radius: 0; }
  /* A pantalla completa los botones flotantes taparían la caja de escritura. */
  html.solx-assist-open .solx-a11y-mount:not([data-solx-a11y-anchor="menu"]):not([data-solx-a11y-anchor="footer"]):not([data-solx-a11y-anchor="inline"]),
  html.solx-assist-open .opnv-rgpd-fab, html.solx-assist-open #argpd-fab { visibility: hidden !important; }
}
@media (prefers-reduced-motion: reduce) {
  .solx-assist, .solx-assist__dots i, .solx-assist__mic.is-listening { animation: none; }
}
