/* lw-regulus — Day 3. Two-pane chat with inline citation chips. */

.lw-regulus {
  --pane-radius: 10px;
  --violet: #A78BFA;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lw-regulus__pane {
  background: var(--bg-elev-1);
  border: 1px solid var(--line-2);
  border-radius: var(--pane-radius);
  padding: 18px 20px;
  min-height: 110px;
  position: relative;
}
.lw-regulus__pane--user { }
.lw-regulus__pane--bot {
  border-color: color-mix(in srgb, var(--violet) 26%, var(--line-2));
}

.lw-regulus__pane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.lw-regulus__avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-elev-3);
  border: 1px solid var(--line-2);
  color: var(--text-secondary);
}
.lw-regulus__avatar--bot {
  background: color-mix(in srgb, var(--violet) 18%, var(--bg-elev-3));
  border-color: color-mix(in srgb, var(--violet) 60%, var(--line-2));
  color: var(--violet);
}
.lw-regulus__pane-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-heading);
}
.lw-regulus__pane-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}

.lw-regulus__text {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-body);
  margin: 0;
  min-height: 1.5em;
}
.lw-regulus__text strong { color: var(--text-heading); font-weight: 600; }

/* Caret */
.lw-regulus__caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: lw-reg-caret 700ms steps(1) infinite;
}
.lw-regulus__pane--user .lw-regulus__caret { background: var(--accent-purple); }
.lw-regulus__pane--bot  .lw-regulus__caret { background: var(--violet); }
@keyframes lw-reg-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Citation chip — inline */
.lw-cite {
  display: inline;
  padding: 1px 8px;
  margin: 0 2px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line-3);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--violet);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
  white-space: normal;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  opacity: 0;
  transform: translateY(4px);
  animation: lw-cite-in 220ms var(--ease-out) forwards;
}
.lw-cite::before {
  content: "📜 ";
  margin-right: 2px;
  filter: grayscale(0.4);
}
.lw-cite:hover {
  background: color-mix(in srgb, var(--violet) 10%, var(--bg-elev-2));
  border-color: var(--violet);
}
@keyframes lw-cite-in {
  0%   { opacity: 0; transform: translateY(4px); box-shadow: 0 0 0 0 color-mix(in srgb, var(--violet) 0%, transparent); }
  60%  { box-shadow: 0 0 12px 0 color-mix(in srgb, var(--violet) 35%, transparent); }
  100% { opacity: 1; transform: translateY(0);  box-shadow: 0 0 0 0 color-mix(in srgb, var(--violet) 0%, transparent); }
}

/* Pause button */
.lw-regulus__pause {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  border: 1px solid var(--line-2);
  color: var(--text-secondary);
  font-size: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 4;
}
.lw-regulus__pause:hover { color: var(--text-heading); border-color: var(--line-3); }
.lw-regulus__pause:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

@media (max-width: 720px) {
  .lw-regulus__text { font-size: 14px; }
  .lw-cite { font-size: 11px; padding: 1px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .lw-regulus__caret { animation: none; opacity: 1; }
  .lw-cite { animation: none; opacity: 1; transform: none; }
}
