/* Client group chats (KEO portal Phase 5; clientchat.js). Boards Chat + TeamChatClients. */
:root {
  --cc-team-bg: #FFF8D6; --cc-team-line: #D9B23A; --cc-team-ink: #5C4600;
  --cc-client-bg: #FFF4B9; --cc-client-ink: #5C4600;
  --cc-sys-bg: #F4F4EF; --cc-sys-ink: #3D3D38; --cc-dot: #F5C500;
  --cc-card-head: #0F1115; --cc-muted: #6E6E68;
}

/* Inbox: the CLIENT badge (rows, legacy list) */
.tp-inbox-client {
  display: inline-flex; align-items: center; height: 16px; padding: 0 5px; margin-left: 6px; border-radius: 4px;
  background: var(--cc-client-bg); color: var(--cc-client-ink); font-size: 10px; font-weight: 700; letter-spacing: .2px; flex: none;
}
.chats-list-subhead { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--cc-muted); text-transform: uppercase; padding: 14px 16px 6px; }

/* Bubbles */
.tp-b-row.tp-cc-teamonly .tp-bubble {
  background: var(--cc-team-bg); color: #111; box-shadow: inset 0 0 0 1.5px transparent;
  outline: 1.5px dashed var(--cc-team-line); outline-offset: -1.5px;
}
.tp-b-row.tp-cc-teamonly.mine .tp-bubble { background: var(--cc-team-bg); }
.tp-cc-team-chip {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 3px; font-size: 11px; font-weight: 700; color: var(--cc-team-ink); letter-spacing: .1px;
}
.tp-cc-team-chip + .tp-cc-card, .tp-cc-team-chip + .tp-b-body, .tp-cc-team-chip + .tp-b-quote { margin-top: 2px; }
.tp-cc-client-chip {
  display: inline-flex; align-items: center; height: 15px; padding: 0 4px; border-radius: 4px;
  background: var(--cc-client-bg); color: var(--cc-client-ink); font-size: 9.5px; font-weight: 800; letter-spacing: .3px;
}
.tp-b-row.tp-cc-fromclient .tp-bubble { background: #F0F0EA; }
.tp-cc-card {
  display: flex; flex-direction: column; gap: 0; margin: 0 -13px 6px; border-radius: 12px 12px 0 0; overflow: hidden; text-decoration: none; color: inherit;
}
.tp-bubble > .tp-cc-card:first-child { margin-top: -8px; border-radius: 19px 19px 0 0; }
.tp-cc-card-head { display: flex; align-items: center; gap: 6px; padding: 8px 13px; background: var(--cc-card-head); color: #fff; font-size: 13px; font-weight: 600; }
.tp-cc-card-stage { align-self: flex-start; margin: 6px 13px 0; padding: 1px 8px; border-radius: 10px; background: #fff; color: #3D3D38; font-size: 11.5px; font-weight: 600; box-shadow: 0 0 0 .5px rgba(0,0,0,.14); }
a.tp-cc-card:hover .tp-cc-card-head { background: #23262c; }
a.tp-cc-card:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* Tracker lines: centred, grey, a gold dot */
.tp-cc-system {
  align-self: center; display: flex; align-items: center; gap: 7px; margin: 10px auto; max-width: min(92%, 520px); width: fit-content;
  padding: 4px 11px; border-radius: 11px; background: var(--cc-sys-bg); color: var(--cc-sys-ink); font-size: 12.5px; line-height: 1.35; text-align: center;
}
.tp-cc-dot { width: 7px; height: 7px; border-radius: 4px; background: var(--cc-dot); flex: none; }
.tp-cc-desk-link { color: #111; font-weight: 600; white-space: nowrap; }

/* Voice transcripts: under the player, three lines then "Show more" */
.tp-cc-tx { margin-top: 6px; font-size: 13px; line-height: 1.4; color: #3D3D38; }
.tp-cc-tx-text { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.tp-cc-tx.is-open .tp-cc-tx-text { display: block; -webkit-line-clamp: unset; }
.tp-cc-tx-more { border: 0; background: none; padding: 2px 0 0; font: inherit; font-size: 12px; font-weight: 600; color: #111; cursor: pointer; }
.tp-cc-tx.is-pending { font-style: italic; color: var(--cc-muted); }

/* Composer: audience toggle, + Quote, pending card, Team only tint */
.tp-cc-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 10px 2px; }
.tp-cc-aud { display: inline-grid; grid-auto-flow: column; background: #ECECE5; border-radius: 9px; padding: 2px; }
.tp-cc-aud-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
  font: inherit; font-size: 12.5px; color: #3D3D38; cursor: pointer; white-space: nowrap;
}
.tp-cc-aud-btn.is-on { background: #fff; color: #111; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tp-cc-aud-btn:focus-visible, .tp-cc-quote-btn:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
.tp-cc-quote-btn { min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: #111; cursor: pointer; box-shadow: 0 0 0 .5px rgba(0,0,0,.2); }
.tp-cc-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 26px; padding: 0 4px 0 9px; border-radius: 13px; background: var(--cc-card-head); color: #fff; font-size: 12px; font-weight: 600; }
.tp-cc-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-cc-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 11px; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; }
.tp-cc-team-note { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--cc-team-ink); }
.tp-composer.tp-cc-team .tp-composer-pill { background: #EFEFEA; box-shadow: inset 0 0 0 1.5px var(--cc-team-line); border-style: dashed; }
.tp-composer.tp-cc-team .tp-composer-input::placeholder { color: var(--cc-team-ink); }
.tp-cc-edit-note { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; color: var(--cc-team-ink); }

/* "+ Quote" picker */
.tp-cc-picker {
  position: fixed; z-index: 5000; max-height: min(420px, 70vh); display: flex; flex-direction: column; gap: 6px; padding: 10px;
  background: #fff; border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.12); box-sizing: border-box;
}
.tp-cc-picker-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.tp-cc-picker-x { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.tp-cc-picker-q { height: 36px; border-radius: 9px; border: 0; box-shadow: 0 0 0 .5px rgba(0,0,0,.25); padding: 0 10px; font: inherit; font-size: 14px; }
.tp-cc-picker-list { overflow: auto; display: flex; flex-direction: column; }
.tp-cc-picker-row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.tp-cc-picker-row:hover, .tp-cc-picker-row:focus-visible { background: #F4F4EF; outline: none; }
.tp-cc-picker-meta { font-size: 12px; color: var(--cc-muted); }
.tp-cc-note { font-size: 13px; color: var(--cc-muted); margin: 6px 4px; }

/* My desk: the per-quote chat panel */
.tp-cc-panel-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.tp-cc-open { margin-left: auto; font-size: 12.5px; font-weight: 600; color: #111; }
.tp-cc-panel-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.tp-cc-pmsg { padding: 7px 10px; border-radius: 12px; background: #F0F0EA; font-size: 13px; }
.tp-cc-pmsg p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tp-cc-pmsg.tp-cc-teamonly { background: var(--cc-team-bg); outline: 1.5px dashed var(--cc-team-line); outline-offset: -1.5px; }
.tp-cc-pmsg-who { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #3D3D38; }
.tp-cc-pmsg-who time { margin-left: auto; font-weight: 400; color: var(--cc-muted); }
.tp-cc-panel .tp-cc-system { margin: 2px auto; }
.tp-cc-panel-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tp-cc-panel-row { display: flex; gap: 6px; }
.tp-cc-panel-input { flex: 1; min-width: 0; min-height: 36px; border-radius: 18px; border: 0; box-shadow: 0 0 0 .5px rgba(0,0,0,.25); padding: 0 12px; font: inherit; font-size: 13.5px; }
.tp-cc-panel-row.is-team .tp-cc-panel-input { background: #EFEFEA; box-shadow: inset 0 0 0 1.5px var(--cc-team-line); }

@media (prefers-reduced-motion: reduce) { .tp-cc-picker { transition: none; } }
@media (max-width: 600px) {
  .tp-cc-aud-btn { min-height: 34px; }
  .tp-cc-quote-btn { min-height: 34px; }
}
