/* FlowStack Chat: conversation list on the left, the open conversation beside it. */
.ch { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - 64px); min-height: 420px; border-top: 1px solid var(--rule); }
.ch-list { border-right: 1px solid var(--rule); overflow-y: auto; padding: 12px 8px 24px; background: var(--card); }
.ch-list h3 { display: flex; align-items: center; justify-content: space-between; margin: 16px 8px 6px; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ch-list h3 button { border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.ch-list h3 button:hover { background: var(--sunk); }
.ch-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 0.92rem; }
.ch-item:hover { background: var(--sunk); }
.ch-item[aria-current="page"] { background: var(--burgundy); color: var(--on-burgundy); }
.ch-item.is-unread { color: var(--ink); font-weight: 700; }
.ch-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-item__org { font-size: 0.75rem; opacity: 0.7; font-weight: 400; }
.ch-count { background: var(--urgent); color: #fff; border-radius: 999px; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; }
.ch-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ch-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule); }
.ch-head h2 { margin: 0; font-size: 1.05rem; }
.ch-head p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.ch-head__tools { margin-left: auto; display: flex; gap: 8px; }
.ch-back { display: none; }
.ch-shared { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: var(--pink-soft, #fde7ec); color: var(--burgundy); margin-left: 6px; vertical-align: middle; }
.ch-msgs { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.ch-msg { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 4px 6px; border-radius: 6px; }
.ch-msg:hover { background: var(--sunk); }
.ch-msg.is-cont { padding-top: 0; }
.ch-msg.is-cont .ch-av, .ch-msg.is-cont .ch-msg__who { visibility: hidden; height: 0; }
.ch-av { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--burgundy-2); color: #fff; font-weight: 700; font-size: 0.8rem; }
.ch-msg__who { display: flex; gap: 8px; align-items: baseline; font-size: 0.85rem; }
.ch-msg__who b { color: var(--ink); }
.ch-msg__who span { color: var(--muted); font-size: 0.75rem; }
.ch-msg__body { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.ch-msg__body.is-gone { color: var(--muted); font-style: italic; }
.ch-msg__acts { display: none; gap: 4px; }
.ch-msg:hover .ch-msg__acts { display: inline-flex; }
.ch-msg__acts button { border: 0; background: none; color: var(--muted); font-size: 0.75rem; cursor: pointer; padding: 0 4px; }
.ch-msg__acts button:hover { color: var(--ink); text-decoration: underline; }
.ch-day { text-align: center; color: var(--muted); font-size: 0.75rem; margin: 14px 0 6px; }
.ch-compose { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--rule); }
.ch-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 180px; }
.ch-join { padding: 16px 20px; border-top: 1px solid var(--rule); text-align: center; }
.ch-empty { margin: auto; text-align: center; color: var(--muted); max-width: 360px; padding: 40px 20px; }
.ch-people { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; margin-top: 10px; }
.ch-people button { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 1px solid var(--rule); background: var(--card); padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.ch-people button:hover { border-color: var(--ink-2); }
.ch-people small { color: var(--muted); }
.ch-page { max-width: 760px; padding: 24px 20px 48px; }
.ch-links { display: grid; gap: 8px; margin: 12px 0 24px; }
.ch-link { display: flex; align-items: center; gap: 12px; border: 1px solid var(--rule); background: var(--card); border-radius: 8px; padding: 12px 14px; }
.ch-link > div { flex: 1; }
.ch-link small { color: var(--muted); display: block; }
@media (max-width: 760px) {
  .ch { grid-template-columns: 1fr; height: calc(100vh - 56px); }
  .ch.is-open .ch-list { display: none; }
  .ch:not(.is-open) .ch-main { display: none; }
  .ch-back { display: inline-flex; }
  .ch-msgs, .ch-head, .ch-compose { padding-left: 12px; padding-right: 12px; }
}
.ch-at { color: var(--burgundy); background: var(--pink-soft, #fde7ec); border-radius: 3px; padding: 0 2px; }
