/* Chat das propostas flutuante: botão, painel e aviso de mensagem nova. */

.tcf {
  --tcf-gap: 24px;
  --tcf-bottom: 24px;
  --tcf-fab: 56px;
  --tcf-gold: linear-gradient(140deg, var(--brand-cream) 0%, var(--brand-gold) 45%, var(--brand-gold-deep) 100%);
  position: fixed;
  right: var(--tcf-gap);
  bottom: var(--tcf-bottom);
  z-index: 1040;
  font-family: var(--font-body);
  pointer-events: none;
}
.tcf > * { pointer-events: auto; }

/* Páginas com compositor no rodapé (WhatsTax): sobe para não cobrir o botão de enviar. */
.tcf--alto { --tcf-bottom: 96px; }

/* ── Botão ─────────────────────────────────────────────── */
.tcf-fab {
  position: relative;
  width: var(--tcf-fab);
  height: var(--tcf-fab);
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tcf-gold);
  color: var(--brand-charcoal);
  font-size: 1.45rem;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--gold-line), 0 14px 30px -12px rgba(0, 0, 0, .65);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tcf-fab:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--gold-line), 0 18px 34px -12px rgba(0, 0, 0, .7); }
.tcf-fab:focus-visible { outline: 2px solid var(--brand-cream); outline-offset: 3px; }
.tcf-fab > .bi { grid-area: 1 / 1; transition: transform .2s ease, opacity .2s ease; }
.tcf-fab-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); font-size: 1.15rem; }
.tcf.is-open .tcf-fab-ico-open { opacity: 0; transform: rotate(90deg) scale(.6); }
.tcf.is-open .tcf-fab-ico-close { opacity: 1; transform: none; }

.tcf-fab.has-unread::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--gold-glow);
  animation: tcfPulse 2.4s ease-out infinite;
}
.tcf.is-open .tcf-fab.has-unread::after { animation: none; }

.tcf-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  border: 2px solid var(--bg);
}
.tcf-fab-badge[hidden] { display: none; }

@keyframes tcfPulse {
  0%   { box-shadow: 0 0 0 0 var(--gold-glow); }
  70%  { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Painel ────────────────────────────────────────────── */
.tcf-panel {
  position: absolute;
  right: 0;
  bottom: calc(var(--tcf-fab) + 14px);
  width: min(480px, calc(100vw - 2 * var(--tcf-gap)));
  height: min(820px, calc(100vh - var(--tcf-bottom) - var(--tcf-fab) - 36px));
  height: min(820px, calc(100dvh - var(--tcf-bottom) - var(--tcf-fab) - 36px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 30px 60px -30px rgba(0, 0, 0, .55);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease;
}
.tcf-panel[hidden] { display: none; }
.tcf.is-open .tcf-panel { opacity: 1; transform: none; }

.tcf-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 12px 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(207, 203, 150, .16), transparent 60%),
    var(--surface-2);
  border-top: 3px solid var(--brand-gold);
}
.tcf-panel-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--tcf-gold);
  color: var(--brand-charcoal);
  font-size: 1rem;
}
.tcf-panel-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.tcf-panel-title strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: .01em;
  color: var(--ink);
}
.tcf-panel-title span { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-head-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.tcf-head-btn:hover { background: var(--accent-soft); color: var(--ink); }
.tcf-head-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── Abas ──────────────────────────────────────────────── */
.tcf-tabs {
  --tcf-tab: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tcf-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 6px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.tcf-tabs button:hover { color: var(--ink); background: var(--accent-soft); }
.tcf-tabs button.is-active { color: var(--accent-strong); }
.tcf-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tcf-tabs button .bi { font-size: .95rem; }
.tcf-tabs-ink {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: calc(100% / 3);
  height: 2px;
  background: linear-gradient(90deg, var(--brand-gold-deep), var(--brand-cream));
  border-radius: 2px 2px 0 0;
  transform: translateX(calc(var(--tcf-tab) * 100%));
  transition: transform .25s cubic-bezier(.3, .8, .3, 1);
}
.tcf-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  display: inline-grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: .64rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.tcf-tab-badge[hidden] { display: none; }

/* ── Áreas ─────────────────────────────────────────────── */
.tcf-view {
  position: relative;
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: var(--bg-sunken);
}
.tcf-view.is-active { display: flex; }
.tcf-lista-view, .tcf-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tcf-lista-view[hidden], .tcf-thread[hidden] { display: none; }

.tcf-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 12px 0;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid oklch(from var(--warning) l c h / .45);
  background: oklch(from var(--warning) l c h / .12);
  font-size: .76rem;
  color: var(--ink-2);
}
.tcf-banner[hidden] { display: none; }
.tcf-banner > .bi { color: var(--warning); font-size: 1rem; }
.tcf-banner span { flex: 1; min-width: 0; }
.tcf-banner a { font-weight: 700; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }

.tcf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: .8rem;
  color: var(--muted);
}
.tcf-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: tcfSpin .8s linear infinite;
}
@keyframes tcfSpin { to { transform: rotate(360deg); } }

.tcf-vazio {
  margin: auto;
  max-width: 280px;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
}
.tcf-vazio strong { font-family: var(--font-display); font-weight: 600; font-size: .98rem; color: var(--ink); }
.tcf-vazio-ico {
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px dashed var(--gold-line);
}
.tcf-vazio.is-erro .tcf-vazio-ico { color: var(--danger); border-color: currentColor; background: transparent; }

/* ── Avatares ──────────────────────────────────────────── */
.tcf-avatar {
  --h: 45;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  color: #fff;
  background: linear-gradient(140deg, hsl(var(--h) 38% 52%), hsl(calc(var(--h) + 25) 42% 34%));
}
.tcf-avatar-sm { width: 28px; height: 28px; font-size: .68rem; align-self: flex-end; }
.tcf-avatar-gap { width: 28px; flex-shrink: 0; }

/* ── Mensagens ─────────────────────────────────────────── */
.tcf-msgs {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background:
    radial-gradient(circle at 1px 1px, rgba(237, 232, 207, .045) 1px, transparent 0) 0 0 / 18px 18px,
    var(--bg-sunken);
  scrollbar-width: thin;
}
.tcf-dia { display: flex; justify-content: center; margin: 12px 0 8px; }
.tcf-dia span {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.tcf-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.tcf-msg.is-inicio { margin-top: 8px; }
.tcf-msg.is-minha { justify-content: flex-end; }
.tcf-bolha {
  position: relative;
  max-width: 78%;
  padding: 7px 11px 6px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-size: .86rem;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .18);
}
.tcf-msg.is-outra .tcf-bolha { border-bottom-left-radius: 4px; }
.tcf-msg.is-outra:not(.is-inicio) .tcf-bolha { border-top-left-radius: 4px; }
.tcf-msg.is-minha .tcf-bolha {
  background: linear-gradient(160deg, rgba(207, 203, 150, .22), rgba(184, 178, 122, .14));
  border-color: var(--gold-line);
  border-bottom-right-radius: 4px;
}
.tcf-msg.is-minha:not(.is-inicio) .tcf-bolha { border-top-right-radius: 4px; }
.tcf-msg-autor {
  display: block;
  margin-bottom: 2px;
  font-size: .72rem;
  font-weight: 700;
  color: hsl(var(--h, 45) 55% 70%);
}
[data-theme="light"] .tcf-msg-autor { color: hsl(var(--h, 45) 50% 36%); }
.tcf-msg-texto { white-space: pre-wrap; word-break: break-word; }
.tcf-msg-texto a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.tcf-msg-hora {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 6px 0 -2px 10px;
  font-size: .64rem;
  color: var(--muted);
}
.tcf-msg-hora .bi { font-size: .9rem; line-height: 1; }
.tcf-msg-hora .is-lida { color: #5cc4f0; }
[data-theme="light"] .tcf-msg-hora .is-lida { color: #1a8fd0; }

/* ── Compositor ────────────────────────────────────────── */
.tcf-composer { padding: 10px 12px 12px; background: var(--surface); border-top: 1px solid var(--border); }
.tcf-composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 5px 5px 5px 14px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tcf-composer-box:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.tcf-composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 140px;
  padding: 7px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .88rem;
  line-height: 1.4;
}
.tcf-composer textarea::placeholder { color: var(--muted-soft); }
.tcf-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tcf-gold);
  color: var(--brand-charcoal);
  font-size: .9rem;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.tcf-send:hover:not(:disabled) { transform: scale(1.06); }
.tcf-send:disabled { opacity: .35; cursor: default; }
.tcf-composer.is-sending .tcf-send { opacity: .5; pointer-events: none; }
.tcf-composer-erro { margin: 6px 6px 0; font-size: .72rem; color: var(--danger); }
.tcf-composer-erro[hidden] { display: none; }

/* ── Listas (Privado e Propostas) ─────────────────────────────────── */
.tcf-busca {
  margin: 12px 12px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.tcf-busca:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.tcf-busca input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: .84rem; }
.tcf-lista { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px 10px; display: flex; flex-direction: column; scrollbar-width: thin; }
.tcf-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.tcf-item:hover { background: var(--accent-soft); }
.tcf-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tcf-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tcf-item-top, .tcf-item-bottom { display: flex; align-items: center; gap: 8px; }
.tcf-item-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 600; color: var(--ink); }
.tcf-item-top time { font-size: .68rem; color: var(--muted); }
.tcf-item-previa { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--muted); }
.tcf-item-previa.is-muted { color: var(--muted-soft); }
.tcf-item.is-unread .tcf-item-previa { color: var(--ink-2); font-weight: 600; }
.tcf-item.is-unread time { color: var(--accent-strong); font-weight: 700; }
.tcf-item-sub { font-size: .68rem; color: var(--muted-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-abrir-num {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 4px 6px;
  padding: 10px 12px;
  border: 1px dashed var(--gold-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.tcf-abrir-num:hover { filter: brightness(1.1); }

/* ── Anexos (Propostas) ────────────────────────────────── */
.tcf-msg.has-anexo .tcf-bolha { padding: 4px 4px 6px; }
.tcf-msg.has-anexo .tcf-msg-autor,
.tcf-msg.has-anexo .tcf-msg-texto { display: block; padding: 0 7px; }
.tcf-msg.has-anexo .tcf-msg-texto { margin-top: 4px; }
.tcf-msg.has-anexo .tcf-msg-hora { margin-right: 6px; }
.tcf-anexo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(260px, 100%);
  min-width: 120px;
  min-height: 80px;
  max-height: 280px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--bg-sunken);
}
.tcf-anexo-audio { display: block; width: min(260px, 100%); height: 38px; }
.tcf-anexo-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.tcf-anexo-doc:hover, .tcf-anexo-doc:focus-visible { border-color: var(--gold-line); background: rgba(0, 0, 0, .28); outline: none; }
.tcf-anexo-doc span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-anexo-doc .bi-file-earmark-pdf { font-size: 1.3rem; color: var(--danger); }
.tcf-anexo-doc .bi-box-arrow-up-right { color: var(--muted); font-size: .8rem; }
.tcf-anexo-doc:hover .bi-box-arrow-up-right { color: var(--accent-strong); }
.tcf-anexo-ver {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
}
.tcf-anexo-ver:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.tcf-anexo-ver .tcf-anexo-img { transition: transform .2s ease, filter .2s ease; }
.tcf-anexo-ver:hover .tcf-anexo-img { transform: scale(1.03); filter: brightness(1.08); }

.tcf-visor {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 10, 9, .78);
  backdrop-filter: blur(4px);
  animation: tcfVisorIn .18s ease;
}
.tcf-visor[hidden] { display: none; }
@keyframes tcfVisorIn { from { opacity: 0; } }
.tcf-visor-caixa {
  width: min(1100px, 100%);
  height: min(90vh, 100%);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.tcf-visor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tcf-visor-ico { font-size: 1.1rem; color: var(--accent-strong); }
.tcf-visor-ico.bi-file-earmark-pdf { color: var(--danger); }
.tcf-visor-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: var(--ink); }
.tcf-visor-head a.tcf-head-btn:not([href]) { opacity: .4; pointer-events: none; }
.tcf-visor-corpo { position: relative; flex: 1; min-height: 0; background: var(--bg-sunken); }
.tcf-visor-corpo.is-imagem img {
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: contain;
}
.tcf-visor-corpo iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
@media (max-width: 520px) {
  .tcf-visor { padding: 0; }
  .tcf-visor-caixa { height: 100%; border-radius: 0; border: 0; }
}

.tcf-tool {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.tcf-tool:hover { color: var(--ink); background: var(--accent-soft); }
.tcf-composer-box:has(.tcf-tool) { padding-left: 5px; }
.tcf-composer-box[hidden] { display: none; }

.tcf-anexo-prev,
.tcf-gravando {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: .8rem;
  color: var(--ink-2);
}
.tcf-anexo-prev[hidden], .tcf-gravando[hidden] { display: none; }
.tcf-anexo-prev span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-anexo-prev .bi-paperclip { color: var(--accent-strong); }
.tcf-anexo-prev .tcf-head-btn { width: 28px; height: 28px; font-size: .75rem; }
.tcf-gravando { margin-bottom: 0; padding: 8px 8px 8px 14px; color: var(--danger); font-weight: 600; }
.tcf-gravando [data-tcf="rec-tempo"] { flex: 1; font-variant-numeric: tabular-nums; }
.tcf-rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: tcfRec 1.2s ease-in-out infinite; }
@keyframes tcfRec { 50% { opacity: .3; } }
.tcf-btn, .tcf-btn-ghost {
  border-radius: var(--radius);
  padding: 6px 12px;
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
}
.tcf-btn { border: 0; background: var(--tcf-gold); color: var(--brand-charcoal); }
.tcf-btn-ghost { border: 1px solid var(--border-strong); background: transparent; color: var(--muted); }
.tcf-btn-ghost:hover { color: var(--ink); }

.tcf-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tcf-thread-head .tcf-avatar { width: 34px; height: 34px; font-size: .78rem; }
.tcf-thread-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tcf-thread-title strong { font-size: .9rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-thread-title span { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-thread { position: relative; }
.tcf-thread-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.tcf-thread-info:hover, .tcf-thread-info:focus-visible { background: var(--surface-2); outline: none; }

/* ── Arquivos da conversa ─────────────────────────────── */
.tcf-arquivos {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  animation: tcfArqIn .2s ease;
}
.tcf-arquivos[hidden] { display: none; }
@keyframes tcfArqIn { from { opacity: 0; transform: translateX(24px); } }
.tcf-arq-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.tcf-arq-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 20px 18px;
  text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, oklch(from var(--brand-gold) l c h / .14), transparent 70%);
  border-bottom: 1px solid var(--border);
}
.tcf-avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; margin-bottom: 6px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--gold-line); }
.tcf-arq-info strong { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--ink); }
.tcf-arq-info > span:not(.tcf-avatar):not(.tcf-arq-tags) { font-size: .78rem; color: var(--muted); }
.tcf-arq-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.tcf-arq-tags em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-style: normal;
  font-size: .72rem;
  color: var(--ink);
}
.tcf-arq-tags i { color: var(--accent-strong); }
.tcf-arq-tabs {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tcf-arq-tabs button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.tcf-arq-tabs button:hover { color: var(--ink); }
.tcf-arq-tabs button.is-active { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }
.tcf-arq-tabs em { font-style: normal; font-size: .68rem; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--muted); }
.tcf-arq-tabs em:empty { display: none; }
.tcf-arq-tabs button.is-active em { background: var(--accent-soft); color: var(--accent-strong); }
.tcf-arq-corpo { position: relative; flex: 1; display: flex; flex-direction: column; padding: 4px 12px 16px; }
.tcf-arq-grupo h4 {
  margin: 14px 2px 8px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tcf-arq-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tcf-arq-thumb {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-sunken);
  cursor: zoom-in;
}
.tcf-arq-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease, filter .2s ease; }
.tcf-arq-thumb:hover img { transform: scale(1.06); filter: brightness(1.1); }
.tcf-arq-thumb:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.tcf-arq-doc {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease;
}
.tcf-arq-doc:hover, .tcf-arq-doc:focus-visible { border-color: var(--gold-line); outline: none; }
.tcf-arq-doc-ico {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: var(--danger);
  background: oklch(from var(--danger) l c h / .12);
}
.tcf-arq-doc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tcf-arq-doc-txt strong { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcf-arq-doc-txt small, .tcf-arq-audio small { font-size: .7rem; color: var(--muted); }
.tcf-arq-doc > .bi { color: var(--muted); font-size: .8rem; }
.tcf-arq-doc:hover > .bi { color: var(--accent-strong); }
.tcf-arq-audio {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.tcf-arq-audio audio { width: 100%; height: 36px; }

/* ── Aviso de mensagem nova ───────────────────────────── */
.tcf-avisos {
  position: absolute;
  right: 0;
  bottom: calc(var(--tcf-fab) + 14px);
}
.tcf-aviso {
  position: relative;
  width: 340px;
  max-width: calc(100vw - 2 * var(--tcf-gap));
  padding: 16px 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--brand-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 24px 50px -24px rgba(0, 0, 0, .6);
  overflow: hidden;
  animation: tcfAvisoIn .32s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes tcfAvisoIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.tcf-aviso-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
}
.tcf-aviso-x:hover { background: var(--accent-soft); color: var(--ink); }
.tcf-aviso-main { display: flex; gap: 12px; align-items: flex-start; }
.tcf-aviso-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tcf-gold);
  color: var(--brand-charcoal);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .02em;
}
.tcf-aviso-body { min-width: 0; flex: 1; padding-right: 18px; display: flex; flex-direction: column; }
.tcf-aviso-tipo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.tcf-aviso-autor {
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tcf-aviso-empresa {
  margin-top: 3px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tcf-aviso-texto {
  margin: 8px 0 0;
  font-size: .84rem;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.tcf-aviso-acoes { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tcf-aviso-btn {
  border: 0;
  border-radius: var(--radius);
  padding: 7px 16px;
  background: var(--tcf-gold);
  color: var(--brand-charcoal);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.tcf-aviso-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.tcf-aviso-btn:focus-visible { outline: 2px solid var(--brand-cream); outline-offset: 2px; }
.tcf-aviso-mais { font-size: .7rem; color: var(--muted); }
.tcf-aviso-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--brand-gold-deep), var(--brand-cream));
  transform-origin: left;
  animation: tcfTimer var(--tcf-aviso-ms, 12000ms) linear forwards;
}
.tcf-aviso:hover .tcf-aviso-timer { animation-play-state: paused; }
@keyframes tcfTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── Telas pequenas: painel em tela cheia ─────────────── */
@media (max-width: 520px) {
  .tcf { --tcf-gap: 16px; --tcf-bottom: 16px; }
  .tcf--alto { --tcf-bottom: 88px; }
  .tcf-panel {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
  }
  .tcf.is-open .tcf-fab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tcf *, .tcf *::before, .tcf *::after { transition-duration: .01ms !important; }
  .tcf-fab.has-unread::after, .tcf-aviso { animation: none; }
}

@media print {
  .tcf { display: none !important; }
}
