/* Compact conversation across V1–V5. Color always has a role glyph and accessible name. */
:root { --chat-ai:#59356e; --chat-ai-bg:#eee8f4; --chat-doctor:#315744; --chat-doctor-bg:#e7eee8; --chat-consultant:#755020; --chat-consultant-bg:#faeddc; }
.chat-role { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; flex:0 0 24px; border-radius:50%; font-size:10px; font-weight:750; background:var(--role-bg); color:var(--role-ink); vertical-align:middle; }
.chat-role svg { width:17px; height:17px; }
.role-ai { --role-ink:var(--chat-ai); --role-bg:var(--chat-ai-bg); }
.role-doctor { --role-ink:var(--chat-doctor); --role-bg:var(--chat-doctor-bg); }
.role-consultant { --role-ink:var(--chat-consultant); --role-bg:var(--chat-consultant-bg); }
.role-safety,.role-imported { --role-ink:#8b352f; --role-bg:#fff0eb; }
.msg .chat-question,.cqlist .chat-question { margin:8px 0 10px auto; width:fit-content; max-width:88%; padding:10px 13px; border-radius:8px 8px 2px 8px; background:var(--surface-2,var(--canvas-alt)); border:1px solid var(--line); overflow-wrap:anywhere; }
.chat-question blockquote { border:0; padding:0; margin:6px 0 0; font-size:15px; line-height:1.5; white-space:pre-wrap; }
.msg .chat-question .msg-meta,.chat-question .msg-meta { font-size:11px; line-height:1.5; text-align:right; }
.msg .answer.chat-answer,.cqlist .answer.chat-answer { margin:10px auto 6px 0; width:fit-content; max-width:92%; padding:11px 13px; border:1px solid color-mix(in srgb,var(--role-ink) 18%,transparent); border-radius:2px 8px 8px 8px; background:var(--role-bg); color:var(--ink); overflow-wrap:anywhere; }
.chat-answer .answer-meta { display:flex; align-items:center; gap:7px; flex-wrap:wrap; color:var(--ink-2); font-size:11px; line-height:1.4; }
.chat-answer p { font-size:15px; line-height:1.55; }
.chat-answer .memline,.chat-answer .reviewline,.msg .brief-note { font-size:11px; line-height:1.45; }
.msg .brief-note { text-align:right; margin:0 0 6px 15%; }
.msg .thread-actions { margin:5px 0 12px; display:flex; gap:6px; }
.msg .thread-actions button { min-height:40px; font-size:12px; }
.msg .chat-followup-label { display:block; font-size:11px; color:var(--ink-2); margin-bottom:4px; }
.talkf .qto button,#cqf .seg button { display:inline-flex; justify-content:center; align-items:center; gap:5px; min-height:40px; padding:5px 6px; font-size:12px; }
.talk-thread-context { display:flex; gap:8px; align-items:start; margin-bottom:8px; padding:9px 10px; background:var(--surface-2,var(--canvas-alt)); border-left:3px solid var(--blue); border-radius:8px; }
.talk-thread-context > div { flex:1; min-width:0; font-size:12px; line-height:1.4; }
.thread-subject { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink-2); }
.thread-state { display:block; color:var(--ink-2); font-size:11px; }
.talk-thread-context button { min-height:40px; flex:none; font-size:11px; padding:4px 6px; }
.talk .talk-head,body[data-ui-family="modern"] .talk .talk-head { padding:8px 10px; align-items:center; flex-wrap:nowrap; gap:6px; border-bottom:0; }
.talk .talk-head #talkh { font-size:16px; flex:1; min-width:0; line-height:1.3; }
.talk .talk-head .talk-header-actions { display:flex; flex:none; gap:2px; align-items:center; }
.talk .talk-head .talk-tabs { background:none; padding:0; border-radius:0; gap:2px; flex:none; }
.talk .talk-head button,.talk .talk-head a { width:40px; height:40px; min-height:40px; flex:0 0 40px; padding:8px; display:inline-flex; justify-content:center; align-items:center; border-radius:10px; }
.talk .talk-head [data-talkclose] { color:#b32637; }
.talk .talk-head [data-talkclose]:hover { background:#fff0f1; }
.talk .talk-head .ic { width:19px; height:19px; }
.talk .talk-privacy { font-size:12px; line-height:1.4; margin:0; padding:0 12px 8px; border-bottom:1px solid var(--line); color:var(--ink-2); }
.talk .talk-list { padding:10px 12px; }
.talk .talk-list > .msg { padding:4px 0; border-bottom:0; }
.talk .talk-form { padding:8px 12px max(10px,env(safe-area-inset-bottom)); }
.talk .talkf .talkhelp,body[data-ui-family="modern"] .talk .talkf .talkhelp { font-size:12px; line-height:1.4; margin:5px 0; display:block; overflow:visible; }
.talk .talk-form textarea { font-size:16px; min-height:56px; height:56px; max-height:140px; }
.talk .talkf .actions { margin-top:5px; }
.talk .talkf .actions button { min-height:40px; padding:7px 13px; }
.talk-thread-filter { display:flex; gap:8px; align-items:center; margin:0 0 8px; font-size:12px; }
@media(max-width:640px) { .talk .talk-head #talkh { font-size:15px; } .talk .talk-head { gap:2px; } .talk .talk-head a,.talk .talk-head button { width:40px; flex-basis:40px; } .talk .chat-question { max-width:90%; } .talk .chat-answer { max-width:94%; } }


body[data-ui-family="modern"] .msg .brief-note,body[data-ui-family="modern"] .msg .memline,body[data-ui-family="modern"] .msg .reviewline {font-size:12px;line-height:1.45;}
body[data-ui-family="modern"] .chat-question {background:var(--chat-question-bg,#f1e0e5);}
#cqf .talkhelp {font-size:12px;line-height:1.45;}

:root[data-theme="dark"] {--chat-ai:#d5c4ff; --chat-ai-bg:#30293f; --chat-doctor:#a5e3c6; --chat-doctor-bg:#19382d; --chat-consultant:#f9d0a6; --chat-consultant-bg:#412f24; --chat-question-bg:#382735; --chat-safety-ink:#ffd0c4; --chat-safety-bg:#432b2a; --chat-close:#ffa7b3;}
@media(prefers-color-scheme:dark) { :root:not([data-theme="light"]) {--chat-ai:#d5c4ff; --chat-ai-bg:#30293f; --chat-doctor:#a5e3c6; --chat-doctor-bg:#19382d; --chat-consultant:#f9d0a6; --chat-consultant-bg:#412f24; --chat-question-bg:#382735; --chat-safety-ink:#ffd0c4; --chat-safety-bg:#432b2a; --chat-close:#ffa7b3;} }
.role-safety,.role-imported {--role-ink:var(--chat-safety-ink,#8b352f);--role-bg:var(--chat-safety-bg,#fff0eb);}
.talk .talk-head [data-talkclose] {color:var(--chat-close,#b32637);width:44px;height:44px;min-width:44px;min-height:44px;flex-basis:44px;border:0;border-radius:8px;background:transparent;box-shadow:none;}
.talk .talk-head [data-talkclose]:focus-visible {outline:2px solid var(--focus,var(--blue));outline-offset:2px;}
@media(max-height:620px) {
  .talk .talk-chat {overflow:hidden;}
  .talk .talk-list {flex:1 1 0;min-height:44px;overflow-y:auto;}
  .talk .talk-form {flex:0 1 auto;overflow-y:auto;min-height:0;max-height:calc(75% + 4px);}
  .talk .talk-form textarea,body[data-ui-family="modern"] .talk .talk-form textarea {min-height:48px;height:48px;}
  .talk .talk-form .actions {position:sticky;bottom:0;background:var(--surface);padding-block:3px;}
}

.talkf[data-thread-active="true"] > .qto,#cqf[data-thread-active="true"] > .seg {display:none;}
.talk-thread-context b {display:flex;align-items:center;gap:5px;}
.talk-thread-context b .chat-role {width:20px;height:20px;flex-basis:20px;}
