/* Chat rail: conversation header, drawer and the symptom/protocol chips (static/chat.js). Uses index.html's tokens. */
.chat { position: relative; }
.chat-head { gap: 8px; }
.ch-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; margin: -4px -6px;
  border-radius: 8px; font: inherit; font-size: 15px; font-weight: 650; color: var(--ink); cursor: pointer; text-align: left; }
.ch-title:hover, .ch-title[aria-expanded="true"] { background: var(--surface-2); }
.ch-title .ch-ic { color: var(--ink-3); font-size: 14px; }
.ch-title .ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-title .ch-caret { color: var(--ink-3); font-size: 11px; }
.ch-new { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--accent); border-radius: 999px;
  padding: 5px 11px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; min-height: 30px; }
.ch-new:hover { background: var(--accent-soft); }

.ch-drawer { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; z-index: 20; background: var(--surface);
  border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.ch-drawer[hidden] { display: none; }
.ch-drawer-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ch-drawer-head .spacer { flex: 1; }
.ch-arch-toggle { font-size: 12px; color: var(--ink-2); display: flex; gap: 5px; align-items: center; cursor: pointer; }
.ch-close { border: 0; background: none; font-size: 14px; color: var(--ink-3); cursor: pointer; padding: 4px 6px; }
.ch-list { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; display: grid; gap: 2px; align-content: start; }
.ch-empty { font-size: 12.5px; color: var(--ink-3); padding: 12px 8px; }
.ch-item { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.ch-item:hover, .ch-item.on { background: var(--surface-2); }
.ch-item.on .t { font-weight: 650; }
.ch-open { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; border: 0; background: none; padding: 9px 8px;
  font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; text-align: left; }
.ch-open .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-open .d { flex: none; font-size: 11px; color: var(--ink-3); }
.ch-acts { display: flex; gap: 2px; padding-right: 4px; }
.ch-acts button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 13px; width: 30px; height: 30px; border-radius: 6px; }
.ch-acts button:hover { background: var(--surface); color: var(--ink); }
.ch-acts .ch-del:hover { color: var(--high); }
.ch-rename { flex: 1; display: flex; gap: 6px; padding: 5px 6px; }
.ch-rename input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; }
.ch-rename button { border: 0; background: var(--accent); color: #fff; border-radius: 8px; padding: 0 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .ch-item:not(:hover):not(:focus-within) .ch-acts button { opacity: .35; } }

.cite.protocol { color: #7a3f8f; border-color: #e0c9ea; background: #f8f0fb; }
.pop a.ch-goto-protocol, .pop a.ch-goto-sym { color: var(--accent); font-weight: 600; text-decoration: none; }

/* Which data the chat answers from ("Use demo data" switch), above the input */
.ch-source { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.ch-source[hidden] { display: none; }
.ch-source .dot { color: var(--warn, #a16207); }
.ch-source.own .dot { color: var(--accent); }
.ch-item .ch-tag { font-size: 10.5px; font-weight: 600; color: var(--warn, #a16207); margin-right: 4px; }

/* Talk to Rapha calls saved in a chat (via "voice"): a divider per call and a small "Voice" mark on each turn */
.ch-call { align-self: center; display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.ch-call::before, .ch-call::after { content: ""; width: 32px; border-top: 1px solid currentColor; opacity: .35; }
.ch-mic { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px; border: 1px solid currentColor; opacity: .75; margin-right: 4px; }

@media (max-width: 820px) {
  .ch-new { padding: 5px 9px; }
  .ch-title { font-size: 14px; }
}
