.dialogue-active-detail > :not(.dialogue-window) {
  display: none;
}

.dialogue-window {
  display: block;
  min-width: 0;
  margin: 12px 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--nv-ink);
  scroll-margin-top: 84px;
}

.dialogue-send svg { width: 20px; height: 20px; }
.dialogue-heading { margin: 0 0 8px; font-size: 1rem; color: var(--nv-primary); }
.explore-tree button[data-saved-dialogue][aria-current="step"] {
  background: var(--nv-blue-soft);
  border-color: var(--nv-primary);
  font-weight: 650;
}
.explore-tree:has(button[data-saved-dialogue][aria-current="step"]) button[data-platform="job"][aria-current="step"] {
  background: transparent;
}

.dialogue-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  padding: 14px 16px;
  background: transparent;
}

.dialogue-turn {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 10px;
}

.dialogue-turn:empty { display: none; }

.dialogue-bubble {
  position: relative;
  align-self: flex-start;
  width: fit-content;
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 3px 15px 15px 15px;
  --dialogue-bubble-bg: var(--nv-blue-soft);
  background: var(--dialogue-bubble-bg);
  box-shadow: 0 1px 2px #0001;
  overflow-wrap: anywhere;
}

.dialogue-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: -6px;
  width: 10px;
  height: 9px;
  background: var(--dialogue-bubble-bg);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.dialogue-bubble p { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.dialogue-bubble time { display: block; margin-top: 3px; color: var(--nv-muted); font-size: .68rem; text-align: right; }
.dialogue-student {
  align-self: flex-end;
  border-radius: 15px 3px 15px 15px;
  --dialogue-bubble-bg: var(--nv-green-soft);
}

.dialogue-student::before { left: auto; right: -6px; transform: scaleX(-1); }

.dialogue-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 3px 15px 15px 15px;
  background: var(--nv-surface);
  color: var(--nv-muted);
  font-size: .875rem;
}

.dialogue-typing[hidden] { display: none; }
.dialogue-typing-dots { display: flex; gap: 3px; }
.dialogue-typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

@media (prefers-reduced-motion: no-preference) {
  .dialogue-typing-dots span { animation: dialogue-typing-pulse 1.2s infinite alternate; }
  .dialogue-typing-dots span:nth-child(2) { animation-delay: .15s; }
  .dialogue-typing-dots span:nth-child(3) { animation-delay: .3s; }
  @keyframes dialogue-typing-pulse { from { opacity: .35; } to { opacity: 1; } }
}

.dialogue-footer {
  overflow: visible;
  padding: 10px 12px;
  border-top: 0;
}

.dialogue-footer p { margin: 0 0 8px; }
.dialogue-footer p:empty { display: none; }
.dialogue-footer [role="alert"] { color: var(--bs-danger-text-emphasis); }
.dialogue-footer [role="status"] { color: var(--nv-muted); font-size: .875rem; }
.dialogue-options { display: grid; gap: 6px; margin-bottom: 10px; overflow: visible; }
.dialogue-options:empty { display: none; }
.dialogue-options button { justify-content: flex-start; padding: 7px 12px; text-align: left; }
.dialogue-composer > div { display: grid; gap: 8px; margin-bottom: 4px; }
.dialogue-composer textarea {
  width: 100%; min-width: 0; min-height: 7rem; max-height: 18rem;
  padding: 10px 14px; border-radius: 12px;
  field-sizing: content; resize: vertical;
}
.dialogue-send { justify-self: end; width: 44px; height: 44px; padding: 0; border-radius: 50%; }

.dialogue-turn { display: contents; }
.dialogue-bubble[hidden], .dialogue-pages[hidden] { display: none; }
.dialogue-pages { align-items: center; justify-content: flex-end; margin-bottom: 4px; }
.dialogue-pages span { color: var(--nv-muted); font-size: .8rem; }
.explore-detail-pane:has(.dialogue-active-detail) .explore-font-controls { display: none; }
