/* Atlas — a CONVERSATION: the thread, the bubbles, the composer, the AI banner.

   Extracted from views.css by board task 48, because there are now two apps that
   draw a conversation and only one of them is the therapist's. The client's
   surface (static/client/) loads this file and app.css and nothing else, so what
   lives here is exactly what both surfaces share:

     - the AI disclosure banner, which is a safety string, not decoration;
     - the scrolling thread and the bubbles in it;
     - the typing indicator;
     - the "this conversation has ended" line;
     - the composer.

   What did NOT move, and stays in views.css: the therapist's chat PAGE - its
   header, title, chip row and mode switch. A client sees none of that, and the
   two layouts around this shared middle are deliberately different.

   `renderMarkdown` draws an assistant bubble's HTML (FIXER-NOTES footgun 27), so
   the element rules below (`.bubble p`, `.bubble ul`, `.bubble code`) apply to
   both apps for the same reason the renderer does. */

.ai-banner {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
}

.chat-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble-row { display: flex; }
.row-user { justify-content: flex-end; }
.row-assistant { justify-content: flex-start; }

.bubble {
  max-width: 76%;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 14.5px;
}

.bubble-user { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble-assistant { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; }

.bubble p { margin: 0.35em 0; }
.bubble ul, .bubble ol { margin: 0.35em 0; padding-left: 20px; }
.bubble code { background: rgba(0, 0, 0, 0.07); border-radius: 4px; padding: 0 4px; font-size: 0.92em; }
.bubble-user code { background: rgba(255, 255, 255, 0.2); }
.bubble-time { display: block; font-size: 10.5px; opacity: 0.6; margin-top: 4px; text-align: right; }

.typing { display: inline-flex; align-items: center; gap: 4px; padding: 14px 16px; }
.typing span {
  width: 7px;
  height: 7px;
  background: var(--text-soft);
  border-radius: 50%;
  display: inline-block;
  animation: typing-blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.chat-ended-notice {
  flex: none;
  text-align: center;
  color: var(--text-soft);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px;
  font-size: 13.5px;
}

.chat-composer { flex: none; display: flex; gap: 10px; align-items: flex-end; }

.chat-input {
  flex: 1;
  resize: none;
  font: inherit;
  color: var(--text);
  font-size: 14.5px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  min-height: 44px;
  max-height: 140px;
}

.chat-input:focus { outline: var(--focus-ring); border-color: var(--accent); }

/* A phone bubble that keeps a desktop's 24% margin wastes the only axis it has;
   the row alignment still tells you who is speaking. Here rather than with the
   shell's breakpoints in views.css, so the rule travels with the element it is
   about - and so the client app gets it without loading the therapist's CSS. */
@media (max-width: 700px) {
  .bubble { max-width: 88%; }
}
