/* ============================================================
   lab-agents.css — floating lab agent chat widget
   Contract + Everything personas. Desktop only (≥ 768px).
   ============================================================ */

/* ── Pill (collapsed state) ──────────────────────────── */

.lac-pill {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.lac-pill.lac-visible {
  opacity: 1;
  transform: translateY(0);
}
.lac-pill:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.lac-pill:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ── Status dots ─────────────────────────────────────── */

.lac-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lac-dot--online      { background: oklch(0.58 0.09 150); }
.lac-dot--degraded    { background: oklch(0.65 0.12 50); }
.lac-dot--calibrating { background: var(--ink-3); }

/* ── Expanded card ───────────────────────────────────── */

.lac-card {
  position: fixed;
  bottom: 62px;
  right: 22px;
  z-index: 89;
  width: 320px;
  max-height: 480px;
  background: var(--paper);
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.06);
}
.lac-card.lac-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Card header ─────────────────────────────────────── */

.lac-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.lac-head-id {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}
.lac-head-domain {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
}
.lac-head-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-3);
  padding: 0 3px;
  flex-shrink: 0;
}
.lac-head-btn:hover { color: var(--ink); }
.lac-head-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ── Messages ────────────────────────────────────────── */

.lac-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.lac-msg {
  max-width: 90%;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}
.lac-msg--agent { align-self: flex-start; }
.lac-msg--user {
  align-self: flex-end;
  background: var(--paper-2);
  padding: 7px 10px;
  border: 1px solid var(--rule);
}

/* Behavior annotation (Everything only) */
.lac-annotation {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-top: 5px;
  opacity: 0.75;
}

/* Course CTA */
.lac-cta {
  align-self: flex-start;
  margin-top: 4px;
  padding: 8px 0 2px;
  border-top: 1px dashed var(--rule);
  width: 100%;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.lac-cta a {
  color: var(--ink);
  text-underline-offset: 3px;
}

/* Typing indicator */
.lac-typing {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  opacity: 0.7;
}
@media (prefers-reduced-motion: no-preference) {
  .lac-typing { animation: lac-blink 1.2s ease-in-out infinite; }
}
@keyframes lac-blink {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.85; }
}

/* ── Input row ───────────────────────────────────────── */

.lac-input-row {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
}
.lac-input {
  flex: 1;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 12px;
  resize: none;
  min-height: 40px;
  max-height: 80px;
}
.lac-input::placeholder { color: var(--ink-4); }
.lac-send {
  background: none;
  border: none;
  border-left: 1px solid var(--rule);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.lac-send:hover:not(:disabled) { color: var(--ink); }
.lac-send:disabled { opacity: 0.35; cursor: default; }

/* Rate / status note */
.lac-rate-note {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  text-align: center;
  padding: 5px 12px 6px;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
}

/* ── Mobile: hide entirely ───────────────────────────── */

@media (max-width: 767px) {
  .lac-pill,
  .lac-card { display: none !important; }
}
