/* Team chats (chat.js, docs/TEAM-CHAT.md §6) and the thread of a customer conversation, in the Conversations area's
   detail pane (console redesign step 6: panels.js lays out the panes and draws their headers; conv-list.css the list).
   Flat: hairlines, no boxed cards, no thick rounded borders. The thread fills its pane: the messages scroll, and the
   composer stays at the bottom. (The docked ask field this once hid is ⌘K's sheet since step 10, so nothing steps aside.) */
.pn-b > .tc-thread { height: 100%; }
.pn-b > .cv-thread { height: 100%; min-height: 0; min-width: 0; display: flex; flex-direction: column; padding: 0; }
.pn-b > .cv-thread > :not(.cv-msgs):not(.cv-compose) { margin-left: 18px; margin-right: 18px; flex: none; }
.pn-b > .cv-thread > .cv-msgs { flex: 1 1 auto; min-height: 140px; overflow: auto; padding: 4px 18px 8px; }
.pn-b > .cv-thread > .cv-compose { flex: none; padding: 10px 18px 12px; border-top: 1px solid var(--line); background: var(--content-bg); }
.pn-b > .cv-thread > .cv-data { margin-top: 0; margin-bottom: 8px; }
/* The suggestion under the box (§1.4): what Tab takes, never sent by itself. Customer threads only (D3). */
.cv-sug { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-top: 6px; font-size: 12px; }
.cv-sug[hidden] { display: none; }
.cv-sug kbd { font: 11px var(--mono); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 4px; color: var(--text-2); }
.cv-sug .linkbtn { color: var(--accent-text); padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.cv-compose textarea::placeholder { color: var(--text-3); }
.tc-pad { padding: 14px 18px; }
.tc-small { font-size: 12px; margin: 8px 0 0; }

.tc-mute { flex: none; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.tc-hash { color: var(--text-3); margin-right: 2px; font-weight: 400; }
.mnav .tc-dot { width: 7px; height: 7px; padding: 0; min-width: 0; }

.tc-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tc-tog { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }

.tc-members { border-bottom: var(--hair); padding: 6px 18px 12px; }
.tc-members ul, .tc-subs { list-style: none; margin: 0; padding: 0; }
.tc-members li, .tc-subs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: var(--hair); font-size: 13.5px; }
.tc-members-acts { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 10px; font-size: 12.5px; }
.tc-members select { background: var(--ink-2); border: 1px solid var(--control); border-radius: 4px; padding: 5px 8px; color: var(--text); font-size: 12.5px; }

.tc-msgs { flex: 1; min-height: 0; overflow: auto; padding: 8px 18px 6px; display: flex; flex-direction: column; }
.tc-older { align-self: center; margin: 8px 0; }
.tc-day { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 11.5px; margin: 14px 0 2px; }
.tc-day::before, .tc-day::after { content: ''; flex: 1; border-top: var(--hair); }
.tc-msg { position: relative; padding: 8px 0 2px 12px; border-left: 2px solid var(--line-2); margin-top: 8px; }
.tc-msg.cont { margin-top: 0; padding-top: 2px; }
.tc-msg.mine { border-left-color: var(--canopy); }
.tc-who { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.tc-who b { font-weight: 600; }
.tc-who time { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.tc-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; margin-top: 2px; }
.tc-text.deleted { font-style: italic; color: var(--text-3); font-size: 13px; }
.tc-edited { font-size: 11.5px; }
.tc-chip { color: var(--sky); font-weight: 500; white-space: nowrap; }
.tc-chip.me { color: var(--warn); }
.tc-own { position: absolute; top: 6px; right: 0; display: none; gap: 10px; }
.tc-msg:hover .tc-own { display: flex; }
@media (hover: none) { .tc-own { position: static; display: flex; padding: 2px 0 2px; } }
.tc-own button { background: none; border: 0; padding: 0; color: var(--text-3); font-size: 11.5px; cursor: pointer; }
.tc-own button:hover { color: var(--text); text-decoration: underline; }
.tc-sys { align-self: center; text-align: center; font-size: 12px; color: var(--text-3); font-style: italic; margin: 10px 0 2px; }
.tc-seen { align-self: flex-end; font-size: 11.5px; margin: 6px 0 0; min-height: 14px; }

.tc-compose { border-top: var(--hair); padding: 10px 18px 12px; position: relative; background: var(--content-bg); }
.tc-box { display: flex; gap: 8px; align-items: flex-end; }
/* Send is as tall as a one-line field (40 px) and stays at its foot as the field grows: it was a 30 px button beside a 40 px field */
.tc-box > .btn { height: 40px; min-width: 40px; justify-content: center; flex: none; }
.tc-input { flex: 1; min-width: 0; max-height: 40vh; overflow: auto; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 9px 11px; color: var(--text); font: 14px/1.45 var(--sans); outline: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-input:focus { border-color: var(--canopy); }
.tc-input:empty::before { content: attr(data-ph); color: var(--text-3); pointer-events: none; }
.tc-input .tc-chip { background: var(--ink-3); border-radius: 3px; padding: 0 3px; }
.tc-hint { margin: 6px 0 0; font-size: 11.5px; }
.tc-editing { font-size: 12px; color: var(--warn); margin-bottom: 6px; }
.tc-editing .linkbtn { font-size: 12px; }
.tc-picker { position: absolute; left: 18px; bottom: calc(100% - 4px); min-width: 220px; max-width: calc(100% - 36px); background: var(--pop-bg); border: 0; border-radius: 6px; padding: 4px 0; z-index: var(--z-float); box-shadow: var(--elev-2); }
.tc-pick-head { font-size: 11px; padding: 4px 12px; }
.tc-picker button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 7px 12px; font-size: 13.5px; cursor: pointer; }
.tc-picker button.hi, .tc-picker button:hover { background: var(--ink-3); }

.tc-form { padding: 4px 18px 24px; overflow: auto; max-width: 640px; }
.tc-form h3 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin: 22px 0 8px; }
.tc-people { display: flex; flex-direction: column; border-top: var(--hair); }
.tc-person { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: none; border: 0; border-bottom: var(--hair); color: var(--text); padding: 10px 2px; text-align: left; cursor: pointer; font-size: 14px; }
.tc-person:hover { background: var(--ink-2); }
.tc-person b { font-weight: 500; }
.tc-pickset { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tc-pickset legend { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; padding: 0; }
.tc-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; cursor: pointer; }
.tc-row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tc-quiet { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.tc-quiet input[type=time] { background: var(--ink-2); border: 1px solid var(--control); border-radius: 4px; padding: 5px 8px; color: var(--text); color-scheme: dark; }

@media (max-width: 780px) {
  .pn-b > .cv-thread > :not(.cv-msgs):not(.cv-compose) { margin-left: 14px; margin-right: 14px; }
  .pn-b > .cv-thread > .cv-msgs { padding: 4px 14px 8px; }
  .pn-b > .cv-thread > .cv-compose { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
  .cv-compose textarea { font-size: 16px; } /* no zoom on focus in iOS Safari */
  .tc-msgs { padding: 6px 16px 4px; }
  .tc-compose { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
  .tc-hint { display: none; }
  .tc-send-word { display: none; }
  .tc-input { font-size: 16px; } /* no zoom on focus in iOS Safari */
  .tc-form { padding: 0 16px 24px; }
  .tc-members { padding: 4px 16px 10px; }
}

/* ------------------------------------------------------------ live (TEAM-CHAT §4b): who is typing, under the thread */
.tc-typing { flex: none; min-height: 18px; padding: 0 18px; font-size: 12px; font-style: italic; }
.tc-typing:empty { min-height: 0; }

/* ------------------------------------------------------------ files and images (TEAM-CHAT §4a, chat-files.js) */
/* The paperclip sits in the box's row, as tall as Send. */
.tcf-clip { flex: none; height: 40px; width: 36px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--text-3); cursor: pointer; border-radius: 4px; }
.tcf-clip:hover, .tcf-clip:focus-visible { color: var(--text); background: var(--ink-2); }
.tcf-clip svg { width: 18px; height: 18px; }
/* Send queued while files go up: a hairline pulse under it, no spinner box. */
.tc-box > .btn.tcf-wait { opacity: .7; box-shadow: inset 0 -2px 0 var(--canopy); }
/* Uploads waiting for the message: one row each, a hairline of progress along its foot. */
.tcf-tray { display: flex; flex-direction: column; margin: 0 0 8px; border-top: var(--hair); }
.tcf-tray[hidden] { display: none; }
.tcf-up { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 0 7px; border-bottom: var(--hair); min-width: 0; }
.tcf-up.failed .tcf-meta .dim { color: var(--warn); }
.tcf-thumb { flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 3px; background: var(--ink-2); }
.tcf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tcf-type { font: 600 10px/1 var(--mono); letter-spacing: .04em; color: var(--text-2); text-transform: uppercase; max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.tcf-meta b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-meta .dim { font-size: 11.5px; }
.tcf-x { flex: none; background: none; border: 0; color: var(--text-3); cursor: pointer; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.tcf-x:hover { color: var(--text); background: var(--ink-2); }
.tcf-x svg { width: 14px; height: 14px; }
.tcf-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; }
.tcf-bar i { display: block; height: 100%; background: var(--canopy); transition: width .2s; }
.tcf-up.failed .tcf-bar i { background: var(--warn); }
/* Dropping files on the thread: the whole thread says so. */
.tc-thread { position: relative; }
.tc-thread.tcf-drop::after { content: 'Drop to attach'; position: absolute; inset: 6px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--canopy); border-radius: 6px; background: color-mix(in srgb, var(--content-bg) 86%, transparent); color: var(--text); font-size: 15px; pointer-events: none; z-index: var(--z-float); }
/* On a message: pictures in a grid (one alone larger), files as rows with Save. */
.tcf-files { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 520px; }
.tcf-imgs { display: grid; gap: 4px; }
.tcf-imgs.n1 { grid-template-columns: minmax(0, 360px); }
.tcf-imgs.n2 { grid-template-columns: repeat(2, minmax(0, 200px)); }
.tcf-imgs.n3 { grid-template-columns: repeat(3, minmax(0, 150px)); }
.tcf-img { display: block; padding: 0; border: 0; background: var(--ink-2); border-radius: 3px; overflow: hidden; cursor: zoom-in; min-height: 60px; }
.tcf-imgs:not(.n1) .tcf-img { aspect-ratio: 1; }
.tcf-imgs.n1 .tcf-img img { display: block; max-width: 100%; max-height: 320px; width: auto; height: auto; }
.tcf-imgs:not(.n1) .tcf-img img, .tcf-grid .tcf-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tcf-img img:not([src]) { visibility: hidden; }
.tcf-img.gone { cursor: default; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--text-3); }
.tcf-img:focus-visible { outline: 2px solid var(--canopy); outline-offset: 1px; }
.tcf-file { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: var(--hair); border-bottom: var(--hair); min-width: 0; }
.tcf-file .tcf-type { width: 40px; text-align: center; flex: none; }
.tcf-file .btn svg { width: 14px; height: 14px; }
/* The info panel's shared media: a grid of pictures, then files as list rows. */
.tcf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; margin-bottom: 8px; }
.tcf-grid .tcf-img { aspect-ratio: 1; min-height: 0; }
.tcf-rows li { gap: 10px; }
/* The lightbox: the picture alone on a dark ground, its name and Save above, arrows at the sides. */
.tcf-lb { position: fixed; inset: 0; z-index: var(--z-dialog); background: rgba(8, 9, 10, .94); display: flex; flex-direction: column; color: #f2f1ee; }
.tcf-lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.tcf-lb-what { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.tcf-lb-what b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-lb-what .dim { color: rgba(242, 241, 238, .6); font-size: 12px; }
.tcf-lb-acts { display: flex; gap: 6px; flex: none; }
.tcf-lb .btn.ghost { color: #f2f1ee; }
.tcf-lb .btn svg { width: 15px; height: 15px; }
.tcf-lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; }
.tcf-lb-stage img { max-width: calc(100% - 96px); max-height: 100%; object-fit: contain; }
.tcf-lb-nav { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: #f2f1ee; cursor: pointer; border-radius: 50%; }
.tcf-lb-nav:hover { background: rgba(255, 255, 255, .08); }
.tcf-lb-nav[hidden] { display: none; }
.tcf-lb-nav svg { width: 22px; height: 22px; }
@media (max-width: 780px) { .tcf-lb-stage { padding: 0; } .tcf-lb-stage img { max-width: 100%; } }
/* A search hit's message (TEAM-CHAT §4c): marked for a moment where the thread opened. */
.tc-msg.tc-found { background: color-mix(in srgb, var(--canopy) 14%, transparent); transition: background .6s; }
