/* Aba "Chat da Equipe" */
.tc-wrap [hidden], .tc-badge[hidden] { display: none !important; } /* o atributo hidden vale mesmo com display definido nas classes */
.tc-wrap { position: relative; display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 380px; max-width: 920px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg, 16px); overflow: hidden; }
.tc-list { flex: 1; overflow-y: auto; padding: 1rem; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tc-msgs { display: flex; flex-direction: column; gap: .5rem; }
.tc-more { display: block; margin: 0 auto 1rem; background: none; border: 1px solid var(--border); color: var(--text-secondary); font: inherit; font-size: .82rem;
    padding: .45rem .9rem; border-radius: 999px; cursor: pointer; min-height: 36px; }
.tc-more:hover { color: var(--text-primary); border-color: var(--accent); }
.tc-empty { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.tc-empty i { font-size: 2rem; margin-bottom: .6rem; display: block; opacity: .6; }
.tc-day { align-self: center; margin: .6rem 0 .2rem; padding: .2rem .75rem; border: 1px solid var(--border); border-radius: 999px; font-size: .74rem; color: var(--text-secondary); background: var(--bg-input); }

.tc-msg { display: flex; }
.tc-msg.mine { justify-content: flex-end; }
.tc-bubble { max-width: min(78%, 560px); padding: .55rem .8rem; border-radius: 14px; border-bottom-left-radius: 4px; background: var(--bg-input);
    border: 1px solid var(--border); color: var(--text-primary); font-size: .92rem; line-height: 1.45; overflow-wrap: anywhere; }
.tc-msg.mine .tc-bubble { background: var(--primary-gradient, var(--primary)); color: #fff; border-color: transparent; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.tc-name { font-size: .76rem; font-weight: 700; color: var(--accent); margin-bottom: .15rem; }
.tc-text { white-space: pre-wrap; }
.tc-text a { color: inherit; text-decoration: underline; }
.tc-meta { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .25rem; font-size: .68rem; opacity: .75; }
.tc-del { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: .35rem; min-width: 32px; min-height: 32px; border-radius: 8px; }
.tc-del:hover { opacity: 1; background: rgba(0,0,0,.12); }

.tc-img { display: block; padding: 0; margin: 0 0 .35rem; border: 0; background: rgba(127,127,127,.15); border-radius: 10px; cursor: zoom-in; overflow: hidden; min-width: 160px; min-height: 110px; max-width: 100%; }
.tc-img img { display: block; max-width: 100%; max-height: 280px; object-fit: cover; }
.tc-img-ph { display: grid; place-items: center; width: 100%; height: 110px; opacity: .5; font-size: 1.6rem; }
.tc-img-fail { cursor: default; padding: 1rem; font-size: .82rem; color: var(--text-muted); }

.tc-file { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; margin-bottom: .35rem; border-radius: 10px; background: rgba(127,127,127,.14); color: inherit; text-decoration: none; }
.tc-file > i { font-size: 1.5rem; opacity: .85; }
.tc-file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tc-file-name { font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-file-size { font-size: .72rem; opacity: .75; }
.tc-dl { display: inline-flex; align-items: center; gap: .35rem; flex: none; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); border-radius: 8px;
    padding: .4rem .7rem; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; min-height: 36px; }
.tc-dl:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.tc-dl:disabled { opacity: .6; cursor: progress; }

.tc-pending { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-top: 1px solid var(--border); background: var(--bg-input); }
.tc-pending > img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.tc-pending > i { font-size: 1.6rem; color: var(--accent); }
.tc-pending-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tc-pending-x { background: none; border: 0; color: var(--text-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; min-width: 40px; min-height: 40px; }
.tc-pending-x:hover { color: var(--urgent-color, #ef4444); }
.tc-progress { height: 6px; border-radius: 99px; background: var(--border); margin-top: .35rem; overflow: hidden; }
.tc-progress i { display: block; height: 100%; background: var(--accent); transition: width .15s; }

.tc-composer { display: flex; align-items: flex-end; gap: .5rem; padding: .7rem 1rem; border-top: 1px solid var(--border); }
.tc-composer textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; padding: .65rem .85rem; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 1rem; line-height: 1.4; }
.tc-composer textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tc-attach, .tc-send { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; font-size: 1rem; }
.tc-attach { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border); }
.tc-attach:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.tc-attach:disabled { opacity: .45; cursor: not-allowed; }
.tc-send:disabled { opacity: .6; cursor: progress; }
.tc-hint { margin: 0; padding: 0 1rem .7rem; font-size: .74rem; color: var(--text-muted); line-height: 1.4; }
.tc-drop { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(2, 132, 199, .18); border: 3px dashed var(--accent); border-radius: inherit;
    font-weight: 700; color: var(--text-primary); backdrop-filter: blur(2px); }

.tc-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 999px; background: var(--urgent-color, #ef4444); color: #fff; font-size: .7rem; font-weight: 700; display: inline-grid; place-items: center; }
.tc-badge[hidden] { display: none; }

.tc-lightbox { position: fixed; inset: 0; z-index: 4000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; background: rgba(0,0,0,.88); }
.tc-lightbox img { max-width: 100%; max-height: calc(100dvh - 110px); object-fit: contain; border-radius: 8px; }
.tc-lb-bar { display: flex; gap: .6rem; }

@supports (height: 100dvh) {
    .tc-wrap { height: calc(100dvh - 230px); }
}
@media (max-width: 640px) {
    .tc-wrap { height: calc(100vh - 190px); min-height: 340px; border-radius: 12px; }
    @supports (height: 100dvh) { .tc-wrap { height: calc(100dvh - 190px); } }
    .tc-bubble { max-width: 88%; }
    .tc-list { padding: .75rem; }
    .tc-composer { padding: .6rem .75rem; }
}
@media (prefers-reduced-motion: reduce) { .tc-progress i { transition: none; } }
