/* Archivo: web/assets/css/chat-bubble.css | Resumen: lanzador circular y panel compacto del asistente. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.lab-bubble {
  position: fixed;
  z-index: 80;
  right: clamp(0.9rem, 3vw, 1.5rem);
  bottom: clamp(0.9rem, 3vw, 1.5rem);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  font-family: var(--sans);
  isolation: isolate;
  contain: layout;
}

.lab-bubble-panel {
  width: min(22.5rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 7.5rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  background: #111318;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
}

.lab-bubble-panel[hidden] { display: none !important; }

.lab-bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.lab-bubble-head p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.lab-bubble-head span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
}

.lab-bubble-x,
.lab-bubble-send,
.lab-bubble-launch {
  font: inherit;
  cursor: pointer;
}

.lab-bubble-x {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.lab-bubble-x:hover { color: var(--ink); }

.lab-bubble-log {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 11rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.85rem 1rem;
}

.lab-msg {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgb(244 241 234 / 0.08);
  border-radius: 12px;
  background: rgb(8 9 12 / 0.45);
}

.lab-msg p { margin: 0; font-size: 0.86rem; line-height: 1.5; }
.lab-msg-user {
  align-self: flex-end;
  background: rgb(197 232 168 / 0.12);
  border-color: rgb(197 232 168 / 0.22);
}

.lab-msg-error { color: #ffb6ab; border-color: rgb(255 123 114 / 0.3); }
.lab-msg-busy { color: var(--muted); font-style: italic; }
.lab-msg a { color: var(--accent); text-decoration: underline; }

.lab-bubble-form {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--line);
}

.lab-bubble-form textarea {
  width: 100%;
  min-height: 3.4rem;
  resize: none;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(8 9 12 / 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
}

.lab-bubble-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lab-bubble-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lab-bubble-send {
  border: 0;
  border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.lab-bubble-send:disabled { opacity: 0.45; cursor: not-allowed; }
.lab-bubble-count { margin-left: auto; color: var(--muted); font-size: 0.7rem; }

.lab-bubble-launch {
  position: relative;
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  box-shadow:
    0 10px 28px rgb(0 0 0 / 0.45),
    0 0 0 1px rgb(197 232 168 / 0.18);
}

.lab-bubble-launch:hover {
  background: #171717;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.5), 0 0 0 1px var(--accent);
}

.lab-bubble-launch svg {
  width: 1.45rem;
  height: 1.45rem;
  display: block;
  margin: 0 auto;
}

.lab-bubble-ia {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  margin: 0 auto;
  width: max-content;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  pointer-events: none;
}

.lab-bubble-dot {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid #111;
  border-radius: 50%;
  background: #ef4444;
}

.lab-bubble-launch.is-read .lab-bubble-dot { display: none; }
