/* The conversation view shared by messages.html and community.html's channels (messages.js). Scoped under .chat;
   colours come from the page's tokens (docs/brand/BRAND.md). */
.chat { display: grid; grid-template-columns: 18rem minmax(0, 1fr); min-height: 0; }
.chat.threaded { grid-template-columns: 18rem minmax(0, 1fr) 22rem; }
.chat.narrow { grid-template-columns: 11rem minmax(0, 1fr); border: 1px solid var(--line); border-radius: 8px;
  height: min(70vh, 40rem); margin-top: 8px; }
.chat.narrow.threaded { grid-template-columns: 11rem minmax(0, 1fr); }
.chat.narrow.threaded > .conv { display: none; }
.chat > aside, .chat > section { min-height: 0; display: flex; flex-direction: column; }
.chat > aside { border-right: 1px solid var(--line); }
.chat > .thread { border-left: 1px solid var(--line); }
.chat.narrow > .thread { border-left: 0; }
.chat .head { font: 650 15px/1.3 var(--f-display); margin: 0; padding: 12px; border: 0;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chat .convs { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.chat .convs button { all: unset; box-sizing: border-box; width: 100%; display: block; padding: 10px 12px;
  cursor: pointer; border-bottom: 1px solid var(--line); }
.chat .convs button:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.chat .convs button[aria-current="true"] { background: var(--panel); }
.chat .convs .t { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px;
  align-items: center; }
.chat .convs .p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat .badge { font-size: 11.5px; font-weight: 600; color: var(--on-primary, #fff); background: var(--primary); border-radius: 999px;
  padding: 0 7px; }
.chat .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; flex: none;
  border: 1px solid var(--muted); vertical-align: middle; }
.chat .dot.online { background: var(--teal); border-color: var(--teal); }
.chat .dot.today { background: transparent; border-color: var(--teal); }
.chat .stream { flex: 1; overflow: auto; padding: 8px 12px; }
.chat .m { padding: 8px 0; border-bottom: 1px solid var(--line); }
.chat .m .who { font-size: 12.5px; color: var(--muted); }
.chat .m .who a { color: var(--fg); font-weight: 600; text-decoration: none; }
.chat .m .x { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat .m .x.gone { color: var(--muted); font-style: italic; }
.chat .m .tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chat .m .tools button { font: inherit; font-size: 12.5px; color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; cursor: pointer; }
.chat .m .tools button:hover { color: var(--fg); border-color: var(--muted); }
.chat .m .tools button[aria-pressed="true"] { color: var(--primary); border-color: var(--primary); }
.chat .m textarea { width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--input);
  border-radius: 8px; padding: 6px 8px; min-height: 3rem; }
.chat .m textarea:hover { border-color: var(--input-hover); }
.chat .tag { display: inline-block; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 4px; padding: 0 4px; margin: 0 0 0 4px; }
.chat form.compose { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); margin: 0; }
.chat form.compose textarea { flex: 1; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--input); border-radius: 8px; padding: 8px 10px; min-height: 2.6rem; max-height: 10rem;
  resize: vertical; width: auto; }
.chat form.compose textarea:hover { border-color: var(--input-hover); }
.chat .note { font-size: 13px; color: var(--muted); padding: 6px 12px; margin: 0; white-space: normal; }
.chat .note.err { color: var(--bad); }
.chat .close { all: unset; cursor: pointer; color: var(--muted); font: 400 13px/1 var(--f-body); }
.chat .side-foot { border-top: 1px solid var(--line); padding: 10px 12px; font-size: 13px; }
.chat .side-foot label { font-weight: 400; font-size: 13px; margin: 0; display: flex; gap: 8px; align-items: flex-start; }
.chat .side-foot input[type=text] { width: 100%; font: inherit; font-size: 13px; padding: 5px 8px; margin-top: 4px;
  color: var(--fg); background: var(--bg); border: 1px solid var(--input); border-radius: 6px; }
.chat .side-foot input[type=text]:hover { border-color: var(--input-hover); }
.chat .side-foot .btn { margin-top: 6px; }
dialog.chat-dialog { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg);
  padding: 20px; width: min(30rem, calc(100vw - 32px)); max-width: calc(100vw - 32px); }
dialog.chat-dialog::backdrop { background: rgba(2, 8, 23, .55); }
dialog.chat-dialog h2 { font: 650 18px/1.3 var(--f-display); margin: 0 0 8px; border: 0; padding: 0; }
dialog.chat-dialog fieldset { border: 0; padding: 0; margin: 8px 0; }
dialog.chat-dialog legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
dialog.chat-dialog label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px;
  margin: 4px 0; }
dialog.chat-dialog textarea { width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--input); border-radius: 8px; padding: 6px 8px; min-height: 4rem; }
dialog.chat-dialog textarea:hover { border-color: var(--input-hover); }
dialog.chat-dialog .row-end { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
dialog.chat-dialog .hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
dialog.chat-dialog .err { color: var(--bad); font-size: 13px; }
/* Enola's answers (E6b, D2f): her own box, always labelled, never mistaken for a member's post. */
.chat .enola, .enola-answer { border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 6px;
  background: var(--panel); padding: 6px 10px; margin: 6px 0; }
.chat .thread > .enola, .chat .thread > div > .enola { margin: 8px 12px; }
.chat .enola .who, .enola-answer .who { font-size: 12.5px; color: var(--muted); }
.chat .enola .note, .enola-answer .note { padding: 4px 0 0; }
.chat .close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* D2g: the Google Chat link in a conversation's header (gchat-link.js). */
.chat .head .gchat { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.chat .head .gchat:empty { display: none; }
.chat .head .gchat a.tag { font: 400 11.5px/1.5 var(--f-body); color: var(--muted); text-decoration: underline; margin: 0; }
.chat .head .gchat a.tag:hover { color: var(--fg); }
.chat .head .gchat a.tag:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
dialog.chat-dialog input[type=text] { width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--input); border-radius: 8px; padding: 6px 8px; margin-top: 4px; }
dialog.chat-dialog input[type=text]:hover { border-color: var(--input-hover); }
@media (max-width: 760px) {
  .chat, .chat.threaded, .chat.narrow, .chat.narrow.threaded { grid-template-columns: minmax(0, 1fr); height: auto; }
  .chat > aside { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .chat > .thread { border-left: 0; border-top: 1px solid var(--line); }
  .chat .stream { max-height: 60vh; }
}
