/* NexusWA — Chat interno (v6.6): janela flutuante de conversa particular entre os logins. */
.tc-fab { position: fixed; right: 20px; bottom: 96px; z-index: 44; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 24px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); display: grid; place-items: center; }
.tc-fab[hidden] { display: none; }
.tc-fab.pulse { animation: tc-pulse 1.6s ease-in-out infinite; }
@keyframes tc-pulse { 0%, 100% { box-shadow: 0 6px 20px rgba(0, 0, 0, .25), 0 0 0 0 rgba(34, 197, 94, .5); } 50% { box-shadow: 0 6px 20px rgba(0, 0, 0, .25), 0 0 0 10px rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) { .tc-fab.pulse { animation: none; } }
.tc-badge, .tc-nav-badge, .tc-count { background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; min-width: 18px; text-align: center; }
.tc-badge { position: absolute; top: -2px; right: -2px; }
.tc-badge[hidden], .tc-nav-badge[hidden] { display: none; }
.nav a .tc-nav-badge { margin-left: auto; }
.shell.side-collapsed .nav a { position: relative; }
.shell.side-collapsed .nav a .tc-nav-badge { position: absolute; top: 2px; right: 2px; margin: 0; }

.tc-panel { position: fixed; right: 20px; bottom: 20px; z-index: 45; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 40px)); display: flex; flex-direction: column; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 48px rgba(0, 0, 0, .3); overflow: hidden; }
.tc-panel[hidden] { display: none; }
/* Mensagem nova abriu sozinha: janela no meio da tela, com o fundo escurecido. */
.tc-panel.tc-center { left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); z-index: 49; width: min(600px, calc(100vw - 32px)); height: min(700px, calc(100vh - 32px)); border-top: 4px solid var(--brand); box-shadow: 0 0 0 100vmax rgba(2, 6, 23, .45), 0 24px 64px rgba(0, 0, 0, .4); }
@media (max-width: 600px) { .tc-panel, .tc-panel.tc-center { left: auto; top: auto; transform: none; right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; } .tc-fab { right: 16px; bottom: 84px; } .tc-compose { padding-bottom: calc(8px + env(safe-area-inset-bottom)); } }

.tc-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.tc-title { flex: 1; min-width: 0; }
.tc-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-sub { font-size: 12px; color: var(--muted); }
.tc-icon { background: none; border: 0; color: var(--text); font-size: 18px; line-height: 1; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.tc-icon:hover { background: var(--border); }
.tc-searchbar { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tc-search { width: 100%; }
.tc-list { flex: 1; overflow-y: auto; }
.tc-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; background: none; border: 0; border-bottom: 1px solid var(--border); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.tc-item:hover { background: var(--panel-2); }
.tc-item-main { flex: 1; min-width: 0; }
.tc-item-top, .tc-item-bottom { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-when { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.tc-prev { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-item.unread .tc-prev { color: var(--text); font-weight: 600; }
.tc-item.unread .tc-when { color: var(--brand); font-weight: 600; }
.tc-avatar { position: relative; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.tc-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #94a3b8; border: 2px solid var(--panel); }
.tc-dot.on { background: #22c55e; }
.tc-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; }

.tc-private { font-size: 11px; color: var(--muted); text-align: center; padding: 4px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.tc-msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; background: var(--bg); }
.tc-day { align-self: center; font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 2px 10px; margin: 8px 0 4px; }
.tc-older { align-self: center; margin-bottom: 6px; }
.tc-row { display: flex; }
.tc-row.me { justify-content: flex-end; }
.tc-bubble { position: relative; max-width: 82%; padding: 6px 9px 4px; border-radius: 10px; background: var(--bubble-them); border: 1px solid var(--border); box-shadow: 0 1px 1px rgba(0, 0, 0, .05); }
.tc-row.me .tc-bubble { background: var(--bubble-me); border-color: transparent; }
.tc-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-meta { display: flex; gap: 4px; justify-content: flex-end; align-items: center; font-size: 10px; color: var(--muted); margin-top: 2px; }
.tc-tick { letter-spacing: -2px; }
.tc-tick.read { color: #3b82f6; }
.tc-img { display: block; max-width: 100%; max-height: 240px; border-radius: 8px; cursor: zoom-in; margin-bottom: 4px; background: var(--panel-2); min-width: 80px; min-height: 60px; }
.tc-audio { max-width: 240px; }
.tc-file { display: block; background: rgba(0, 0, 0, .05); border: 0; border-radius: 8px; padding: 8px 10px; color: var(--text); cursor: pointer; text-align: left; font: inherit; overflow-wrap: anywhere; margin-bottom: 4px; }
.tc-del { position: absolute; top: -8px; left: -10px; display: none; background: var(--panel); border: 1px solid var(--border); border-radius: 50%; width: 24px; height: 24px; font-size: 12px; cursor: pointer; padding: 0; }
.tc-bubble:hover .tc-del, .tc-del:focus { display: block; }
@media (hover: none) { .tc-del { display: block; opacity: .7; } }

.tc-compose { display: flex; align-items: flex-end; gap: 4px; padding: 8px; border-top: 1px solid var(--border); background: var(--panel-2); }
.tc-input { flex: 1; resize: none; min-height: 38px; max-height: 120px; padding: 8px 10px; border-radius: 18px; }
.tc-send { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 16px; cursor: pointer; }
.tc-send:disabled { opacity: .6; }
.tc-emoji { position: absolute; left: 8px; right: 8px; bottom: 58px; max-height: 260px; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); padding: 6px; z-index: 2; }
.tc-toast { cursor: pointer; }
.tc-section { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tc-section .btn { text-transform: none; letter-spacing: 0; font-weight: 600; }
.tc-avatar.group { font-size: 18px; }
.tc-from { font-size: 12px; font-weight: 700; color: var(--brand); margin-bottom: 2px; }
.tc-picklist { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.tc-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.tc-pick:last-child { border-bottom: 0; }
.tc-pick > span:nth-child(2) { flex: 1; }
.tc-pick .tc-avatar { flex-basis: 30px; width: 30px; height: 30px; font-size: 12px; }

/* Janela arrastada (Carlos 05/12): left/top vêm do JS; o resto do posicionamento padrão sai. */
@media (min-width: 861px) {
  .tc-head { cursor: move; user-select: none; touch-action: none; }
  .tc-head .tc-title { cursor: move; }
  .tc-panel.tc-moved, .tc-panel.tc-center.tc-moved { right: auto; bottom: auto; transform: none; }
  .tc-panel.tc-dragging { opacity: .96; box-shadow: 0 24px 64px rgba(0, 0, 0, .45); transition: none; }
  .tc-panel.tc-center.tc-dragging { box-shadow: 0 0 0 100vmax rgba(2, 6, 23, .45), 0 24px 64px rgba(0, 0, 0, .45); }
  .tc-panel.tc-dragging * { cursor: move !important; }
}
.tc-icon .ic { width: 18px; height: 18px; }
.tc-fab .ic { width: 24px; height: 24px; }
.tc-send .ic { width: 18px; height: 18px; }
.tc-del .ic { width: 13px; height: 13px; }
.tc-avatar.group .ic { width: 20px; height: 20px; }
