/* TeamIRCC Chat — app a pantalla completa (estilo Teams) */
:root {
  --navy-1: #08172f;
  --navy-2: #0c2347;
  --navy-3: #10305e;
  --brand: #1f6fe0;
  --brand-soft: #e8f0fd;
  --mine: #dfe7fb;
  --mine-border: #c8d6f6;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e4e9f1;
  --text: #1b2433;
  --muted: #64748b;
  --hover: #f1f5fb;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .07);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--brand); }

.tc-boot { display: grid; place-items: center; height: 100%; background: linear-gradient(135deg, var(--navy-1), var(--navy-3)); }
.tc-splash { display: grid; justify-items: center; gap: 14px; color: #c9d7ee; font-size: 14px; }
.tc-splash img { width: 120px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }

/* ── Login propio (app instalada: la sesión no se comparte con la plataforma) ── */
.tc-login { width: min(340px, calc(100vw - 48px)); text-align: center; }
.tc-login h1 { margin: 0; color: #fff; font-size: 22px; font-weight: 800; }
.tc-login p { margin: 0; font-size: 14px; }
.tc-login__form { display: grid; gap: 10px; width: 100%; margin-top: 6px; }
.tc-login__form input { width: 100%; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 16px; }
.tc-login__form input::placeholder { color: #8fa3c4; }
.tc-login__form input:focus { outline: none; border-color: var(--brand); background: rgba(255, 255, 255, .12); }
.tc-login__btn { padding: 12px 14px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.tc-login__btn:disabled { opacity: .6; }
.tc-login__err { padding: 8px 10px; border-radius: 10px; background: rgba(224, 82, 82, .16); color: #ffb4b4; font-size: 13px; }
.tc-login__help { color: #8fa3c4; font-size: 13px; text-decoration: none; }
.tc-login__help:hover { color: #c9d7ee; text-decoration: underline; }

/* ── Layout ── */
/* --vvh la publica src/core/viewportKeyboard.js: alto visible real con el
   teclado abierto (iOS no encoge 100dvh al mostrar el teclado). */
.tc-app { display: grid; grid-template-columns: 72px 340px minmax(0, 1fr); height: 100vh; height: 100dvh; height: var(--vvh, 100dvh); }
.tc-app.is-drop::after { content: "Suelta los archivos para adjuntarlos"; position: fixed; inset: 12px; display: grid; place-items: center; border: 3px dashed var(--brand); border-radius: 18px; background: rgba(31, 111, 224, .08); color: var(--brand); font-size: 20px; font-weight: 800; pointer-events: none; z-index: 50; }

/* Riel */
.tc-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 12px; background: linear-gradient(180deg, var(--navy-1), var(--navy-2) 60%, var(--navy-3)); }
.tc-rail__logo { display: grid; place-items: center; width: 52px; height: 44px; margin-bottom: 10px; padding: 6px; border-radius: 12px; background: #fff; }
.tc-rail__logo img { max-width: 100%; max-height: 100%; }
.tc-rail__btn { position: relative; display: grid; justify-items: center; gap: 3px; width: 60px; padding: 8px 0; border: 0; border-radius: 12px; background: transparent; color: #b9c8e2; font-size: 10.5px; font-weight: 600; text-decoration: none; transition: background .12s, color .12s; }
.tc-rail__btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.tc-rail__btn.is-active { background: rgba(31, 111, 224, .9); color: #fff; box-shadow: 0 4px 14px rgba(31, 111, 224, .45); }
.tc-rail__btn.is-on { color: #86efac; }
.tc-rail__badge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; font-style: normal; font-weight: 800; line-height: 18px; }
.tc-rail__spacer { flex: 1; }
.tc-rail__me { margin-top: 6px; }

/* Lista */
.tc-list { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); background: #fafbfd; }
.tc-list__hd { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px; }
.tc-list__hd h1 { margin: 0; font-size: 22px; font-weight: 800; }
.tc-list__actions { display: flex; gap: 4px; }
.tc-search { display: flex; align-items: center; gap: 8px; margin: 0 14px 10px; padding: 0 12px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); }
.tc-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 111, 224, .12); }
.tc-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; color: var(--text); }
.tc-search--sm { margin: 0 0 8px; height: 34px; }
.tc-filters { display: flex; gap: 6px; padding: 0 14px 10px; }
.tc-filter { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tc-filter.is-active { border-color: var(--navy-2); background: var(--navy-2); color: #fff; }
.tc-convs { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.tc-sec { padding: 10px 10px 4px; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tc-conv { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; transition: background .1s; }
.tc-conv:hover { background: var(--hover); }
.tc-conv.is-active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.tc-conv__body { display: grid; flex: 1; min-width: 0; gap: 2px; }
.tc-conv__top, .tc-conv__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.tc-conv__top strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tc-conv__top time { flex: 0 0 auto; color: var(--muted); font-size: 11.5px; }
.tc-conv__bottom span { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tc-conv.is-unread .tc-conv__top strong, .tc-conv.is-unread .tc-conv__bottom span { color: var(--text); font-weight: 800; }
.tc-typing-inline { color: var(--brand); font-size: 13px; }
.tc-badge { flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }
.tc-list__empty { padding: 30px 16px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* Avatares */
.tc-av { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: var(--s); height: var(--s); border-radius: 50%; background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 32%); font-size: calc(var(--s) * .36); font-weight: 800; }
.tc-av b { font-weight: 800; }
.tc-av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.tc-dot { position: absolute; right: -1px; bottom: -1px; width: calc(var(--s) * .3); height: calc(var(--s) * .3); min-width: 9px; min-height: 9px; border: 2px solid #fff; border-radius: 50%; background: #cbd5e1; }
.tc-dot.is-on { background: #22c55e; }
.tc-dot-inline { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #cbd5e1; vertical-align: middle; }
.tc-dot-inline.is-on { background: #22c55e; }

/* Botones */
.tc-ibtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #475569; }
.tc-ibtn:hover { background: var(--hover); color: var(--navy-2); }
.tc-ibtn.is-on { color: var(--brand); background: var(--brand-soft); }
.tc-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; font-size: 14px; }
.tc-btn--primary { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(31, 111, 224, .3); }
.tc-btn--danger { border-color: var(--danger); background: var(--danger); color: #fff; }

/* Principal */
.tc-main { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.tc-empty { display: grid; place-content: center; justify-items: center; gap: 8px; height: 100%; color: var(--muted); text-align: center; }
.tc-empty img { width: 110px; opacity: .9; }
.tc-empty h2 { margin: 6px 0 0; color: var(--text); font-size: 22px; }
.tc-empty p { margin: 0 0 8px; }

.tc-head { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.tc-head__back { display: none; }
.tc-head__id { display: grid; min-width: 0; }
.tc-head__id strong { overflow: hidden; font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tc-head__id small { color: var(--muted); font-size: 12.5px; }
.tc-tabs { display: flex; gap: 4px; margin-left: 14px; }
.tc-tab { position: relative; padding: 8px 10px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.tc-tab.is-active { color: var(--text); }
.tc-tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -11px; height: 3px; border-radius: 3px; background: var(--brand); }
.tc-head__actions { margin-left: auto; display: flex; gap: 4px; }

.tc-body { flex: 1; overflow-y: auto; padding: 18px 28px 8px; scroll-behavior: auto; }
.tc-more { display: block; margin: 0 auto 12px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--brand); font-size: 12.5px; font-weight: 700; }
.tc-start { display: grid; justify-items: center; gap: 6px; margin: 30px 0; color: var(--muted); text-align: center; }
.tc-start h3 { margin: 6px 0 0; color: var(--text); }
.tc-day { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: capitalize; }
.tc-day::before, .tc-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Mensajes */
.tc-msg { display: flex; gap: 10px; margin-top: 2px; }
.tc-msg.is-first { margin-top: 12px; }
.tc-msg__av { width: 32px; flex: 0 0 32px; }
.tc-msg__col { display: grid; justify-items: start; min-width: 0; max-width: min(72%, 760px); }
.tc-msg.is-mine { justify-content: flex-end; }
.tc-msg.is-mine .tc-msg__col { justify-items: end; }
.tc-msg__meta { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 3px; color: var(--muted); font-size: 12px; }
.tc-msg__meta strong { color: var(--text); font-size: 13px; }
.tc-msg__meta em, .tc-edited { color: var(--muted); font-size: 11px; font-style: italic; }
.tc-bubble { position: relative; padding: 9px 14px; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; background: var(--panel); box-shadow: 0 1px 1px rgba(16, 24, 40, .03); font-size: 14.5px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; }
.tc-msg.is-mine .tc-bubble { border-color: var(--mine-border); border-radius: 14px 4px 14px 14px; background: var(--mine); }
.tc-msg:not(.is-first) .tc-bubble { border-radius: 14px; }
.tc-msg.is-pending .tc-bubble { opacity: .65; }
.tc-msg.is-flash .tc-bubble { animation: tc-flash 1.4s ease; }
@keyframes tc-flash { 0%, 60% { box-shadow: 0 0 0 4px rgba(31, 111, 224, .35); } 100% { box-shadow: none; } }
.tc-bubble.is-deleted { color: var(--muted); font-style: italic; background: transparent; }
.tc-bubble.is-emoji { padding: 2px 4px; border: 0; background: transparent !important; box-shadow: none; font-size: 40px; line-height: 1.15; }
.tc-text a { word-break: break-all; }
.tc-quote { display: grid; gap: 1px; width: 100%; margin-bottom: 6px; padding: 6px 10px; border: 0; border-left: 3px solid var(--brand); border-radius: 6px; background: rgba(31, 111, 224, .07); text-align: left; font-size: 12.5px; }
.tc-quote span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
/* Archivos dentro del mensaje: miniaturas + tarjetas (ícono | nombre | descargar) */
.tc-bubble.has-files { min-width: min(300px, 100%); }
.tc-mfiles { display: grid; gap: 6px; width: min(340px, 100%); margin: 2px 0 6px; }
.tc-imgs { display: grid; gap: 3px; overflow: hidden; border-radius: 10px; }
.tc-imgs--2, .tc-imgs--3, .tc-imgs--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tc-img { position: relative; display: block; aspect-ratio: 1 / 1; padding: 0; border: 0; overflow: hidden; background: #e2e8f0; cursor: zoom-in; }
.tc-imgs--3 .tc-img:first-child { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
/* Foto única: completa, sin recorte (el alto manda; el ancho sigue la proporción) */
.tc-imgs--1 { display: block; width: fit-content; max-width: 100%; }
.tc-msg.is-mine .tc-imgs--1 { margin-left: auto; }
.tc-imgs--1 .tc-img { aspect-ratio: auto; width: fit-content; max-width: 100%; min-width: 120px; min-height: 0; }
.tc-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.tc-imgs--1 .tc-img img { width: auto; height: auto; max-width: 100%; max-height: 380px; object-fit: contain; }
.tc-img:hover img { transform: scale(1.03); }
.tc-img__more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 23, 47, .55); color: #fff; font-size: 22px; font-weight: 800; }
.tc-doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.tc-doc__main { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; }
.tc-doc__ico { display: grid; place-items: center; width: 34px; height: 40px; }
.tc-doc__ico svg { display: block; }
.tc-doc__txt { display: grid; gap: 1px; min-width: 0; line-height: 1.3; }
.tc-doc__txt b { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tc-doc__txt small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.tc-doc__main:hover b { color: var(--brand); }
.tc-doc__dl { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--brand-soft); color: var(--brand); transition: background .12s, color .12s; }
.tc-doc__dl:hover { background: var(--brand); color: #fff; }
.tc-doc__dl.is-busy { pointer-events: none; }
.tc-zip { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 36px; padding: 6px 12px; border: 1px dashed #b9cbe6; border-radius: 10px; background: #f5f9ff; color: var(--brand); font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.tc-zip em { color: var(--muted); font-size: 11.5px; font-style: normal; font-weight: 600; }
.tc-zip:hover { border-style: solid; background: var(--brand-soft); }
.tc-zip.is-busy { pointer-events: none; opacity: .85; }
.tc-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(31, 111, 224, .25); border-top-color: var(--brand); border-radius: 50%; vertical-align: -2px; animation: tc-rot .7s linear infinite; }
.tc-spin--lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes tc-rot { to { transform: rotate(360deg); } }
.tc-task { display: grid; gap: 2px; min-width: 240px; margin-bottom: 6px; padding: 10px 12px; border: 1px solid #c7d7ee; border-left: 4px solid var(--brand); border-radius: 10px; background: #f5f9ff; color: var(--text); text-decoration: none; }
.tc-task span { display: flex; align-items: center; gap: 6px; color: var(--brand); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.tc-task small { color: var(--muted); }

/* Barra al pasar el mouse */
/* Barra de acciones: por ENCIMA del mensaje completo (nombre y hora incluidos), alineada al
   borde de la burbuja y siempre dentro del área visible (la ubica placeHoverBar, dom.js). */
.tc-hover { position: absolute; left: 0; bottom: calc(100% + 3px); display: none; align-items: center; gap: 1px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); z-index: 5; white-space: nowrap; }
.tc-msg.is-mine .tc-hover { left: auto; right: 0; }
.tc-hover.is-below { top: calc(100% + 3px); bottom: auto !important; }
/* Puente invisible: el mouse puede subir hasta la barra sin que desaparezca */
.tc-hover::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 32px; }
.tc-hover.is-below::after { top: auto; bottom: 100%; }
/* Junto al nombre: puente hacia la izquierda (hasta el nombre) para llegar con el mouse */
.tc-hover.is-beside::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 12px; }
.tc-hover.is-beside::after { height: 12px; }
.tc-msg__col:hover .tc-hover, .tc-msg__col:focus-within .tc-hover, .tc-hover:focus-within { display: flex; }
.tc-hover button { display: grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 7px; background: transparent; font-size: 17px; transition: transform .1s; }
.tc-hover button:hover { background: var(--hover); transform: scale(1.18); }
.tc-hover__ico { color: #475569; }
.tc-hover__ico:hover { transform: none !important; }

/* Reacciones */
.tc-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 4px 0; }
.tc-react { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; transition: transform .1s; }
.tc-react b { color: var(--muted); font-size: 12px; }
.tc-react:hover { transform: scale(1.06); border-color: #c9d8ee; }
.tc-react.is-mine { border-color: var(--brand); background: var(--brand-soft); }
.tc-react.is-mine b { color: var(--brand); }
.tc-seen { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 4px 4px 0; color: var(--muted); font-size: 11.5px; }

/* Escribiendo */
.tc-typing { min-height: 22px; padding: 0 30px; color: var(--muted); font-size: 12.5px; }
.tc-dots { display: inline-flex; gap: 3px; margin-right: 4px; vertical-align: middle; }
.tc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: tc-dot 1.2s infinite ease-in-out; }
.tc-dots i:nth-child(2) { animation-delay: .15s; } .tc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Composer */
.tc-composer { padding: 0 24px 18px; }
.tc-composer__ctx { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; padding: 6px 6px 6px 12px; border-left: 3px solid var(--brand); border-radius: 8px; background: var(--brand-soft); color: #1e3a8a; font-size: 12.5px; }
.tc-ctx-quote { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-composer__files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tc-chip { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; max-width: 260px; padding: 5px 5px 5px 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tc-chip__ico { display: grid; place-items: center; width: 34px; height: 34px; }
.tc-chip__ico img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.tc-chip__txt { display: grid; min-width: 0; line-height: 1.25; }
.tc-chip__txt b { overflow: hidden; font-size: 12.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tc-chip__txt small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.tc-chip button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: #eef2f7; color: var(--muted); }
.tc-chip button:hover { background: #fee2e2; color: #b91c1c; }
.tc-composer__box { display: flex; flex-direction: column; border: 1px solid var(--line); border-bottom: 2px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); transition: border-color .12s; }
.tc-composer__box:focus-within { border-bottom-color: var(--brand); }
.tc-composer textarea { width: 100%; min-height: 46px; max-height: 220px; padding: 12px 16px 4px; border: 0; outline: none; background: transparent; font: inherit; font-size: 14.5px; line-height: 1.45; resize: none; }
.tc-composer__tools { display: flex; align-items: center; gap: 2px; padding: 2px 8px 8px; }
.tc-send { display: grid; place-items: center; width: 38px; height: 34px; margin-left: auto; border: 0; border-radius: 9px; background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(31, 111, 224, .3); }
.tc-send:hover { background: #1a5fc2; }

/* Archivos */
/* Pestaña Archivos: agrupados por envío, filtro y ZIP por grupo */
.tc-files { max-width: 1000px; margin: 0 auto; }
.tc-files__hd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tc-files__hd h3 { margin: 0; font-size: 18px; }
.tc-files__hd span { color: var(--muted); font-size: 13px; }
.tc-files__empty { padding: 24px; color: var(--muted); text-align: center; }
.tc-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #e9eef6; }
.tc-seg__btn { padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.tc-seg__btn.is-active { background: #fff; color: var(--navy-2); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.tc-seg--full { display: flex; }
.tc-seg--full .tc-seg__btn { flex: 1; }
.tc-fgroup { margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tc-fgroup__hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tc-fgroup__who { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.tc-fgroup__who strong { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.tc-fgroup__who small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tc-fgroup__hd .tc-zip { flex: 0 0 auto; width: auto; }
.tc-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.tc-fthumb { position: relative; display: block; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #e2e8f0; cursor: zoom-in; }
.tc-fthumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.tc-fthumb:hover img { transform: scale(1.04); }
.tc-fdocs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.tc-fgrid + .tc-fdocs { margin-top: 8px; }

/* Búsqueda en la conversación (panel lateral) */
.tc-stage { position: relative; display: flex; flex: 1; min-height: 0; }
.tc-stage > .tc-body { flex: 1; min-width: 0; }
.tc-sp { display: flex; flex: 0 0 360px; flex-direction: column; width: 360px; min-height: 0; border-left: 1px solid var(--line); background: #fff; }
.tc-sp__hd { display: flex; align-items: center; gap: 6px; padding: 12px 12px 8px; }
.tc-sp__hd .tc-search { flex: 1; margin: 0; }
.tc-sp .tc-seg { margin: 0 12px 6px; }
.tc-sp__status { min-height: 18px; padding: 2px 14px 6px; color: var(--muted); font-size: 12px; }
.tc-sp__list { flex: 1; overflow-y: auto; padding: 0 6px 12px; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.tc-sp__hint { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; color: var(--muted); font-size: 13px; text-align: center; }
.tc-sp__hint strong { color: var(--text); font-size: 14px; }
.tc-sr { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; }
.tc-sr:hover { background: var(--hover); }
.tc-sr__body { display: grid; flex: 1; gap: 2px; min-width: 0; line-height: 1.35; }
.tc-sr__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tc-sr__top strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tc-sr__top time { flex: 0 0 auto; color: var(--muted); font-size: 11.5px; }
.tc-sr__text { display: -webkit-box; overflow: hidden; color: #334155; font-size: 13px; overflow-wrap: anywhere; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tc-sr mark, .tc-conv mark { padding: 0 1px; border-radius: 3px; background: #fde68a; color: inherit; }
.tc-sr--file { align-items: center; padding: 6px 6px 6px 8px; }
.tc-sr__fmain { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; }
.tc-sr__thumb { display: grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 8px; background: #f1f5f9; }
.tc-sr__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tc-sr__name { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tc-sr--file small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.tc-list__empty--sm { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; }

/* Visor a pantalla completa: compartido en core/mediaViewer.js (inyecta sus estilos) */

/* Aviso de versión nueva (service worker) */
.tc-update { position: fixed; left: 50%; top: 12px; z-index: 95; display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 999px; background: var(--navy-2); color: #fff; font-size: 13px; box-shadow: 0 10px 30px rgba(8, 23, 47, .3); transform: translateX(-50%); }
.tc-update b { color: #93c5fd; }

/* Capas: popovers y modales */
.tc-layer:empty { display: none; }
.tc-backdrop { position: fixed; inset: 0; z-index: 60; }
.tc-backdrop.is-dim { background: rgba(8, 23, 47, .45); }
.tc-pop { position: fixed; z-index: 61; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(8, 23, 47, .25); }
.tc-emo { display: flex; flex-direction: column; width: 352px; height: 400px; padding: 10px; }
.tc-emo__scroll { flex: 1; overflow-y: auto; padding-right: 2px; }
.tc-emo h5 { margin: 8px 2px 4px; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.tc-emo__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.tc-emo__grid button { display: grid; place-items: center; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 22px; transition: transform .08s; }
.tc-emo__grid button:hover { background: var(--hover); transform: scale(1.15); }
.tc-emo__none { color: var(--muted); text-align: center; }
.tc-emo__cats { display: flex; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--line); }
.tc-emo__cats button { width: 36px; height: 30px; border: 0; border-radius: 8px; background: transparent; font-size: 17px; }
.tc-emo__cats button:hover { background: var(--hover); }
.tc-menu { display: grid; min-width: 190px; padding: 6px; }
.tc-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; text-align: left; }
.tc-menu button:hover { background: var(--hover); }
.tc-menu .is-danger { color: var(--danger); }

/* Hoja de acciones al mantener presionado un mensaje (celular, estilo WhatsApp) */
.tc-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: #fff; box-shadow: 0 -12px 40px rgba(8, 23, 47, .25); animation: tc-sheet-in .18s ease-out; }
.tc-sheet::before { content: ""; display: block; width: 38px; height: 4px; margin: 2px auto 8px; border-radius: 2px; background: #cbd5e1; }
.tc-sheet__react { display: flex; justify-content: space-around; padding: 2px 0 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.tc-sheet__react button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1f5f9; font-size: 24px; }
.tc-sheet__react button:active { transform: scale(1.15); }
.tc-sheet .tc-menu { min-width: 0; padding: 0; }
.tc-sheet .tc-menu button { padding: 12px 10px; font-size: 15.5px; }
.tc-sheet .tc-menu button:active { background: var(--hover); }
@keyframes tc-sheet-in { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (pointer: coarse) {
  /* Táctil: la barra flotante de hover no sirve; las acciones van por la hoja */
  .tc-hover { display: none !important; }
  .tc-bubble, .tc-msg__meta { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  /* Todo campo de texto a 16px: con menos, iOS hace zoom al enfocarlo */
  input:not([type="checkbox"]):not([type="radio"]), textarea, select { font-size: 16px !important; }
}
.tc-modal { position: fixed; left: 50%; top: 50%; z-index: 61; display: flex; flex-direction: column; gap: 10px; width: min(520px, calc(100vw - 24px)); max-height: min(680px, calc(100vh - 40px)); padding: 18px; border-radius: 16px; background: #fff; box-shadow: 0 24px 60px rgba(8, 23, 47, .35); transform: translate(-50%, -50%); }
.tc-modal--sm { width: min(400px, calc(100vw - 24px)); }
.tc-modal h3 { margin: 0; font-size: 18px; }
.tc-modal p { margin: 0; color: var(--muted); }
.tc-modal__hd { display: flex; align-items: center; justify-content: space-between; }
.tc-modal__ft { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tc-modal__ft span { margin-right: auto; color: var(--muted); font-size: 13px; }
.tc-modal .tc-search { margin: 0; }
.tc-input { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; outline: none; }
.tc-input:focus { border-color: var(--brand); }
.tc-people { flex: 1; overflow-y: auto; display: grid; gap: 2px; min-height: 120px; }
.tc-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.tc-person:hover { background: var(--hover); }
.tc-person.is-on { background: var(--brand-soft); }
.tc-person > span:not(.tc-av):not(.tc-task-ico) { display: grid; flex: 1; min-width: 0; }
.tc-person small { color: var(--muted); font-size: 12px; }
.tc-check { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #cbd5e1; border-radius: 6px; color: #fff; font-style: normal; font-weight: 900; }
.tc-person.is-on .tc-check { border-color: var(--brand); background: var(--brand); }
.tc-task-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }

.tc-toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; padding: 10px 16px; border-radius: 10px; background: var(--navy-2); color: #fff; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 10px); transition: opacity .18s, transform .18s; pointer-events: none; }
.tc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Scrollbars finos */
.tc-convs, .tc-body, .tc-emo__scroll, .tc-people, .tc-sp__list { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }

/* ── Responsivo ── */
@media (max-width: 1100px) {
  .tc-app { grid-template-columns: 64px 290px minmax(0, 1fr); }
  .tc-body { padding: 14px 16px 8px; }
  .tc-msg__col { max-width: 85%; }
  .tc-sp { position: absolute; top: 0; right: 0; bottom: 0; z-index: 6; box-shadow: -12px 0 30px rgba(8, 23, 47, .12); }
}
@media (max-width: 760px) {
  /* Fijada al área visible real (--vvh/--vvt, ver src/core/viewportKeyboard.js):
     con el teclado abierto iOS panea la página y sin esto el chat queda cortado.
     La fila de la barra inferior es auto (60px + zona segura del iPhone). */
  .tc-app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* En reposo: 100dvh (en iPhone llega al borde; "bottom: 0" quedaba corto) */
    height: 100vh;
    height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    background: #fff;
  }
  /* Con teclado: alto y posición medidos por visualViewport (iOS panea la página) */
  :root.kb-open .tc-app { top: var(--vvt, 0px); height: var(--vvh, 100dvh); }
}
/* iPhone con la app instalada: iOS entrega un viewport de (pantalla − barra de
   estado) pero lo dibuja desde el borde superior. Medido en iPhone 17 Pro / iOS 18.7:
   screen 874, innerHeight/100dvh 812, safe-area-inset-top 62. Si la app parte en 0
   queda bajo la barra (borroso arriba) y deja 62 px vacíos abajo; desplazarla
   env(safe-area-inset-top) hacia abajo la deja exacta (62 → 874). */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 760px) and (display-mode: standalone) {
    /* Área visible real: desde la barra de estado hasta el fin del viewport
       (innerHeight), que iOS ya calculó descontando esa barra. */
    .tc-app { top: env(safe-area-inset-top); height: calc(100vh - env(safe-area-inset-top)); height: calc(100dvh - env(safe-area-inset-top)); }
    :root.kb-open .tc-app { top: calc(var(--vvt, 0px) + env(safe-area-inset-top)); height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top)); }
  }
  .tc-tabs { margin-left: 0; }
  .tc-tab { padding: 8px 6px; font-size: 13px; }
  .tc-head { gap: 8px; padding: 8px 10px; }
  .tc-head__id { flex: 1; }
  .tc-task { min-width: 0; }
  .tc-mfiles { width: min(300px, 100%); }
  .tc-bubble.has-files { min-width: 0; }
  .tc-sp { left: 0; width: auto; border-left: 0; box-shadow: none; }
  .tc-fdocs { grid-template-columns: minmax(0, 1fr); }
  .tc-fgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tc-fgroup { padding: 10px; }
  .tc-fgroup__hd .tc-zip em { display: none; }
  .tc-rail { grid-row: 2; flex-direction: row; justify-content: space-around; min-height: 56px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  /* Teclado abierto: la barra inferior se oculta para dejarle el alto al chat */
  :root.kb-open .tc-rail { display: none; }
  :root.kb-open .tc-app { grid-template-rows: minmax(0, 1fr); }
  .tc-rail__logo, .tc-rail__spacer, .tc-rail__me { display: none; }
  .tc-rail__btn { width: auto; padding: 6px 10px; }
  .tc-list, .tc-main { grid-row: 1; grid-column: 1; }
  .tc-main { display: none; }
  body.tc-has-active .tc-main { display: flex; }
  body.tc-has-active .tc-list { display: none; }
  /* Dentro de una conversación no hay barra inferior (estilo WhatsApp): el
     alto completo queda para encabezado + mensajes + composer. */
  body.tc-has-active .tc-app { grid-template-rows: minmax(0, 1fr); }
  body.tc-has-active .tc-rail { display: none; }
  .tc-head__back { display: inline-grid; }
  .tc-tabs { margin-left: auto; }
  .tc-head__actions { margin-left: 0; }
  .tc-composer { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  /* 16px mínimo: con menos, iOS hace zoom automático al enfocar el campo */
  .tc-composer textarea { font-size: 16px; }
  .tc-search input { font-size: 16px; }
  .tc-body { overscroll-behavior: contain; }
  .tc-emo { width: calc(100vw - 16px); }
}
@media (max-width: 420px) {
  .tc-head__pin { display: none; }
}

/* Ajustes: elementos ocultos y altura de columnas */
[hidden] { display: none !important; }
.tc-list, .tc-main { min-height: 0; overflow: hidden; }
.tc-body { min-height: 0; }
.tc-quote { min-width: 0; max-width: 100%; }
.tc-quote span { max-width: 100%; }
.tc-bubble { max-width: 100%; min-width: 0; }
.tc-emo__scroll { overflow-x: hidden; }
.tc-emo__grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.tc-main, .tc-body { max-width: 100vw; }

/* ══════════ Info del grupo / contacto (panel lateral estilo WhatsApp Web) ══════════ */
.tc-head__who { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 4px 8px 4px 4px; margin: -4px 0 -4px -4px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.tc-head__who:hover { background: var(--hover); }
.tc-head__id small { overflow: hidden; max-width: 46vw; text-overflow: ellipsis; white-space: nowrap; }
.tc-ibtn--sm { width: 28px; height: 28px; }
.tc-linkbtn { justify-self: start; padding: 2px 0; border: 0; background: none; color: var(--brand); font-size: 13px; font-weight: 700; }
.tc-linkbtn:hover { text-decoration: underline; }
.tc-input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; }
.tc-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 111, 224, .12); }

.tc-info { display: flex; flex: 0 0 380px; flex-direction: column; width: 380px; min-height: 0; border-left: 1px solid var(--line); background: #f6f8fb; animation: tc-info-in .16s ease-out; }
@keyframes tc-info-in { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.tc-info__hd { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.tc-info__hd h3 { margin: 0; font-size: 15px; font-weight: 800; }
.tc-info__scroll { flex: 1; overflow-y: auto; padding-bottom: 24px; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.tc-info__hero { display: grid; justify-items: center; gap: 4px; padding: 22px 18px 16px; background: var(--panel); text-align: center; }
.tc-info__photo { position: relative; margin-bottom: 8px; border-radius: 50%; }
.tc-info__photo .tc-av { box-shadow: 0 6px 20px rgba(16, 24, 40, .14); }
.tc-info__cam { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; border: 0; border-radius: 50%; background: rgba(8, 23, 47, .55); color: #fff; font-size: 11.5px; font-weight: 700; opacity: 0; transition: opacity .15s; }
.tc-info__photo:hover .tc-info__cam, .tc-info__cam:focus-visible { opacity: 1; }
.tc-info__name { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.tc-info__sub { margin: 0; color: var(--muted); font-size: 13.5px; }
.tc-info__presence { display: flex; align-items: center; margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.tc-info__edit { display: grid; gap: 8px; width: 100%; }
.tc-info__editbtns { display: flex; justify-content: flex-end; gap: 6px; }
.tc-info__editbtns .tc-btn { height: 34px; padding: 0 12px; font-size: 13px; }
.tc-info__ta { height: auto; min-height: 80px; padding: 9px 12px; line-height: 1.45; resize: vertical; }
.tc-info__quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; padding: 0 14px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tc-info__quick button { display: grid; justify-items: center; gap: 5px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--brand); font-size: 12px; font-weight: 700; }
.tc-info__quick button span { color: var(--text); }
.tc-info__quick button:hover { border-color: #c9d8f3; background: var(--brand-soft); }
.tc-info__quick button.is-on { border-color: #fcd34d; background: #fffbeb; color: #b45309; }
.tc-info__sec { display: grid; gap: 8px; margin-top: 8px; padding: 14px 16px; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tc-info__sechd { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tc-info__sechd .tc-ibtn { margin-left: auto; }
.tc-info__count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--hover); color: var(--text); font-size: 11.5px; }
.tc-info__desc { margin: 0; color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-info__empty { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tc-info__meta { color: var(--muted); font-size: 11.5px; }
.tc-info__note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.tc-info__row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 0; border: 0; background: transparent; color: var(--text); font-size: 14px; text-align: left; }
.tc-info__row:hover .tc-info__rowlbl { color: var(--brand); }
.tc-info__rowlbl { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.tc-info__rowlbl svg { flex: 0 0 auto; color: var(--muted); }
.tc-info__row > b { color: var(--muted); font-size: 13px; font-weight: 700; }
.tc-info__row > em { max-width: 48%; overflow: hidden; color: var(--muted); font-size: 12.5px; font-style: normal; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.tc-info__row > svg { flex: 0 0 auto; color: #94a3b8; }
.tc-info__row.is-danger, .tc-info__row.is-danger .tc-info__rowlbl svg { color: var(--danger); }
.tc-info__row.is-danger:hover .tc-info__rowlbl { color: #b91c1c; }
.tc-info__thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tc-info__thumbs button { aspect-ratio: 1; padding: 0; overflow: hidden; border: 0; border-radius: 10px; background: var(--hover); }
.tc-info__thumbs img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.tc-info__thumbs button:hover img { transform: scale(1.05); }
.tc-info__stars { display: grid; gap: 6px; }
.tc-info__star { display: grid; gap: 3px; padding: 9px 11px; border: 1px solid var(--line); border-left: 3px solid #f59e0b; border-radius: 10px; background: #fff; text-align: left; }
.tc-info__star:hover { background: #fffbeb; }
.tc-info__startop { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tc-info__startop strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.tc-info__startop time { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.tc-info__startxt { display: -webkit-box; overflow: hidden; color: #334155; font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.tc-info__startxt svg { vertical-align: -2px; }
.tc-info__opts { display: grid; gap: 2px; }
.tc-info__opts button { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; text-align: left; }
.tc-info__opts button:hover { background: var(--hover); }
.tc-info__opts i { width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid #cbd5e1; border-radius: 50%; }
.tc-info__opts button.is-on i { border: 5px solid var(--brand); }
.tc-info__themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
.tc-theme-sw { display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; }
.tc-theme-sw small { color: var(--muted); font-size: 11px; font-weight: 600; }
.tc-theme-sw.is-on small { color: var(--brand); font-weight: 800; }
.tc-theme-sw__img { position: relative; display: grid; align-content: center; gap: 4px; width: 100%; aspect-ratio: 1.15; padding: 0 8px; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.tc-theme-sw.is-on .tc-theme-sw__img { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 111, 224, .18); }
.tc-theme-sw__img i { display: block; height: 8px; border-radius: 6px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.tc-theme-sw__img i:first-child { width: 70%; }
.tc-theme-sw__img i:last-child { width: 60%; justify-self: end; background: var(--mine); }
.tc-info__msearch { margin: 0; }
.tc-info__members { display: grid; gap: 2px; margin: 0 -8px; }
.tc-info__member { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.tc-info__member:hover { background: var(--hover); }
.tc-info__member > span:not(.tc-av):not(.tc-info__addico) { display: grid; flex: 1; min-width: 0; }
.tc-info__member strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tc-info__member small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tc-info__badge { flex: 0 0 auto; padding: 2px 8px; border-radius: 6px; background: #dcfce7; color: #166534; font-size: 11px; font-style: normal; font-weight: 800; }
.tc-info__add { margin: 0 -8px; width: calc(100% + 16px); }
.tc-info__add strong { color: var(--brand); }
.tc-info__addico { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; background: var(--brand); color: #fff; }

/* Conversación silenciada en la lista */
.tc-conv__muted { flex: 0 0 auto; display: grid; color: #94a3b8; }
.tc-badge.is-muted { background: #94a3b8; }

/* Avisos del sistema dentro del chat */
.tc-sysmsg { display: flex; justify-content: center; margin: 10px 0; }
.tc-sysmsg span { max-width: 80%; padding: 5px 12px; border-radius: 8px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); color: #475569; font-size: 12.5px; text-align: center; }
.tc-sysmsg.is-flash span { background: #fde68a; }

/* Mensaje destacado */
.tc-starmark { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #fbbf24; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.tc-starmark svg { fill: currentColor; }
.tc-msg.is-mine .tc-starmark { right: auto; left: -6px; }

/* Estilo del chat (fondo por conversación) */
.tc-stage[data-theme] .tc-body { background-size: 22px 22px; }
.tc-stage[data-theme="blue"] .tc-body { background-color: #e6eefb; background-image: radial-gradient(rgba(16, 48, 94, .08) 1.2px, transparent 1.3px); }
.tc-stage[data-theme="mint"] .tc-body { background-color: #e3f4ec; background-image: radial-gradient(rgba(6, 95, 70, .08) 1.2px, transparent 1.3px); }
.tc-stage[data-theme="sand"] .tc-body { background-color: #f4ecdd; background-image: radial-gradient(rgba(120, 72, 20, .08) 1.2px, transparent 1.3px); }
.tc-stage[data-theme="lavender"] .tc-body { background-color: #ede8fb; background-image: radial-gradient(rgba(76, 29, 149, .08) 1.2px, transparent 1.3px); }
.tc-stage[data-theme="rose"] .tc-body { background-color: #fbe9ee; background-image: radial-gradient(rgba(157, 23, 77, .07) 1.2px, transparent 1.3px); }
.tc-stage[data-theme="dark"] .tc-body { background-color: #0e1a2b; background-image: radial-gradient(rgba(255, 255, 255, .05) 1.2px, transparent 1.3px); }
.tc-stage[data-theme="dark"] .tc-bubble { border-color: #22324a; background: #17253a; color: #e2e8f0; }
.tc-stage[data-theme="dark"] .tc-msg.is-mine .tc-bubble { border-color: #2b4c80; background: #22406e; color: #f1f5f9; }
.tc-stage[data-theme="dark"] .tc-msg__meta, .tc-stage[data-theme="dark"] .tc-day, .tc-stage[data-theme="dark"] .tc-seen, .tc-stage[data-theme="dark"] .tc-start { color: #94a3b8; }
.tc-stage[data-theme="dark"] .tc-msg__meta strong, .tc-stage[data-theme="dark"] .tc-start h3 { color: #e2e8f0; }
.tc-stage[data-theme="dark"] .tc-day::before, .tc-stage[data-theme="dark"] .tc-day::after { background: #22324a; }
.tc-stage[data-theme="dark"] .tc-text a { color: #93c5fd; }
.tc-stage[data-theme="dark"] .tc-sysmsg span { background: #17253a; color: #cbd5e1; }
.tc-theme-sw__img[data-sw="default"] { background: var(--bg); }
.tc-theme-sw__img[data-sw="blue"] { background: #e6eefb; }
.tc-theme-sw__img[data-sw="mint"] { background: #e3f4ec; }
.tc-theme-sw__img[data-sw="sand"] { background: #f4ecdd; }
.tc-theme-sw__img[data-sw="lavender"] { background: #ede8fb; }
.tc-theme-sw__img[data-sw="rose"] { background: #fbe9ee; }
.tc-theme-sw__img[data-sw="dark"] { background: #0e1a2b; }
.tc-theme-sw__img[data-sw="dark"] i { background: #17253a; }
.tc-theme-sw__img[data-sw="dark"] i:last-child { background: #22406e; }

/* ══════════ Mensajes de voz ══════════ */
.tc-mic:hover { color: var(--danger); }
.tc-rec { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px 8px 6px; border: 1px solid #fecaca; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.tc-composer.is-recording .tc-composer__box, .tc-composer.is-recording .tc-composer__files { display: none; }
.tc-rec__cancel { color: var(--muted); }
.tc-rec__cancel:hover { color: var(--danger); background: #fef2f2; }
.tc-rec__dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--danger); animation: tc-rec-blink 1s ease-in-out infinite; }
@keyframes tc-rec-blink { 50% { opacity: .25; } }
.tc-rec__time { min-width: 42px; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tc-rec__bars { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 2px; height: 30px; min-width: 0; overflow: hidden; }
.tc-rec__bars i { flex: 0 0 3px; width: 3px; border-radius: 3px; background: #f87171; }
.tc-rec__hint { color: var(--muted); font-size: 12.5px; }
.tc-rec__send { margin-left: 0; }

.tc-audio { display: flex; align-items: center; gap: 10px; width: min(300px, calc(100vw - 150px)); max-width: 100%; padding: 2px 0; }
.tc-audio:not(.is-voice) { padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tc-msg.is-mine .tc-audio:not(.is-voice) { border-color: var(--mine-border); background: #eef3fd; }
.tc-audio__av { position: relative; flex: 0 0 auto; }
.tc-audio__av i { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; background: var(--ok); color: #fff; }
.tc-audio.is-playing .tc-audio__av i { background: var(--brand); }
.tc-audio__ico { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: #fff7ed; color: #ea580c; }
.tc-audio__play { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(31, 111, 224, .3); }
.tc-audio__play:hover { background: #1a5fc2; }
.tc-audio__main { display: grid; flex: 1; gap: 4px; min-width: 0; }
.tc-audio__bar { position: relative; height: 18px; cursor: pointer; }
.tc-audio__track, .tc-audio__fill { position: absolute; left: 0; top: 50%; height: 4px; border-radius: 4px; transform: translateY(-50%); }
.tc-audio__track { right: 0; background: #d5deec; }
.tc-audio__fill { width: 0; background: var(--brand); }
.tc-audio__knob { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(31, 111, 224, .18); transform: translate(-50%, -50%); }
.tc-audio__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tc-audio__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-audio__speed { flex: 0 0 auto; min-width: 38px; height: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font-size: 11.5px; font-weight: 800; }
.tc-audio__speed:hover { border-color: var(--brand); color: var(--brand); }
.tc-stage[data-theme="dark"] .tc-audio:not(.is-voice) { border-color: #2b3d57; background: #1b2b43; }
.tc-stage[data-theme="dark"] .tc-audio__track { background: #3b5070; }

/* Responsivo del panel de info */
@media (max-width: 1100px) {
  .tc-info { position: absolute; top: 0; right: 0; bottom: 0; z-index: 7; box-shadow: -12px 0 30px rgba(8, 23, 47, .14); }
}
@media (max-width: 760px) {
  .tc-info { left: 0; width: auto; border-left: 0; box-shadow: none; }
  .tc-head__who { flex: 1; }
  .tc-head__id small { max-width: 60vw; }
  .tc-rec__hint { display: none; }
  .tc-main.has-info .tc-composer, .tc-main.has-info .tc-typing { display: none; }
  .tc-audio { gap: 8px; }
  .tc-audio__av { display: none; }
}

/* ══════════ Menciones @persona / @todos ══════════ */
.tc-composer { position: relative; }
.tc-at-btn { font-size: 17px; font-weight: 800; }
.tc-mention-pop { position: absolute; left: 24px; bottom: calc(100% - 10px); z-index: 30; display: grid; width: min(360px, calc(100% - 48px)); max-height: 300px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 44px rgba(8, 23, 47, .22); scrollbar-width: thin; }
.tc-mention-pop__hd { padding: 4px 8px 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.tc-mention-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.tc-mention-opt:hover, .tc-mention-opt.is-active { background: var(--brand-soft); }
.tc-mention-opt__txt { display: grid; min-width: 0; }
.tc-mention-opt__txt strong { overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tc-mention-opt__txt small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tc-mention-opt__all { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; background: #f59e0b; color: #fff; font-size: 16px; font-weight: 900; }
.tc-mention { padding: 0 3px; border-radius: 5px; background: rgba(31, 111, 224, .12); color: var(--brand); font-weight: 700; }
.tc-mention.is-me, .tc-mention.is-all { background: rgba(245, 158, 11, .2); color: #b45309; }
.tc-msg.is-mention .tc-bubble { border-left: 3px solid #f59e0b; }
.tc-badge--at { min-width: 20px; margin-right: 4px; background: #f59e0b; }
.tc-stage[data-theme="dark"] .tc-mention { background: rgba(147, 197, 253, .18); color: #93c5fd; }
@media (max-width: 760px) {
  .tc-mention-pop { left: 10px; width: calc(100% - 20px); }
}
