.taf-chat{grid-column:1/-1;min-width:0;display:grid;grid-template-columns:minmax(220px,32%) minmax(0,1fr);height:clamp(390px,68dvh,780px);border:1px solid var(--line-c);border-radius:20px;overflow:hidden;background:var(--surface);color:var(--text)}
.taf-chat [hidden]{display:none!important}
.taf-chat button,.taf-chat input,.taf-chat textarea{font:inherit;color:inherit}
.tc-inbox,.tc-thread{display:flex;flex-direction:column;min-height:0;min-width:0}
.tc-inbox{border-right:1px solid var(--line-c)}
.tc-top,.tc-heading{padding:16px;display:flex;align-items:center;gap:12px}
.tc-top h2,.tc-heading h3{font:800 20px/1.25 var(--body);margin:0;color:inherit}
.tc-search,.tc-field{background:var(--surface2);border:1px solid var(--line-c);color:var(--text);border-radius:16px}
.tc-search{margin:0 12px 10px;padding:10px 14px;width:calc(100% - 24px)}
.tc-rooms,.tc-history{overflow:auto;overscroll-behavior:contain}
.tc-room{width:100%;display:flex;align-items:center;gap:10px;padding:12px 14px;text-align:left;border:0;border-bottom:1px solid var(--line-c);background:transparent;cursor:pointer}
.tc-room:hover,.tc-room[aria-current="true"]{background:var(--surface2)}
.tc-symbol{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-weight:800;color:#234f47;background:#cce8db}
.tc-symbol[data-tipo="familia"]{background:#e4dbfb;color:#52396f}
.tc-symbol[data-tipo="aluno"]{background:#ffe2bb;color:#73471c}
.tc-details{min-width:0;flex:1}
.tc-details b,.tc-details small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tc-details small,.tc-stamp{color:var(--muted);font-size:13px}
.tc-stamp{align-self:flex-start;white-space:nowrap}
.tc-heading{border-bottom:1px solid var(--line-c);min-height:64px}
.tc-heading h3{font-size:17px}
.tc-back{display:none;border:0;background:transparent;cursor:pointer;width:44px;height:44px}
.tc-back svg,.tc-send svg{width:22px;height:22px;vertical-align:middle}
.tc-history{flex:1;min-height:0;background:var(--bg);padding:14px clamp(12px,3vw,32px)}
.tc-messages{display:flex;flex-direction:column;gap:7px}
.tc-bubble{max-width:85%;width:fit-content;align-self:flex-start;padding:8px 12px;border:1px solid var(--line-c);border-radius:3px 15px 15px 15px;background:var(--surface);color:var(--text);overflow-wrap:anywhere}
.tc-bubble.mine{align-self:flex-end;border-radius:15px 3px 15px 15px;color:#163b30;background:#d6f2e3;border-color:#bddccf}
.app[data-mode="noite"]:not([data-theme="adu"]) .tc-bubble.mine,.app[data-theme="adu"]:not([data-mode="noite"]) .tc-bubble.mine{background:#21483c;color:#f1fff5;border-color:#396052}
.tc-bubble b{font-size:13px}.tc-bubble p{white-space:pre-wrap;margin:0;line-height:1.45}.tc-bubble time{display:block;text-align:right;font-size:12px;opacity:.8}
.tc-state,.tc-empty{padding:8px 12px;color:var(--muted);text-align:center;font-size:14px}.tc-state:empty{display:none}
.tc-compose{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--line-c);background:var(--surface)}
.tc-field{resize:none;min-height:44px;max-height:100px;padding:10px 14px;flex:1;min-width:0;line-height:1.4}
.tc-send{width:44px;height:44px;border:0;border-radius:50%;background:#246b54;color:white!important;cursor:pointer}.tc-send:disabled{opacity:.5}
.tc-earlier{display:block;margin:0 auto 12px;padding:8px 14px;border:1px solid var(--line-c);border-radius:20px;background:var(--surface);cursor:pointer}
@media(max-width:760px){
.taf-chat{display:flex;height:clamp(300px,58dvh,680px)}
.tc-inbox,.tc-thread{width:100%}.tc-inbox{border:0}.tc-thread{display:none}
.taf-chat.thread-open{position:fixed;inset:0;z-index:1500;height:100dvh;border:0;border-radius:0}
.thread-open .tc-inbox{display:none}.thread-open .tc-thread{display:flex;background:var(--surface)}
.tc-back{display:block}.tc-heading{padding:calc(8px + env(safe-area-inset-top)) 12px 8px 4px}.tc-compose{padding-bottom:max(10px,env(safe-area-inset-bottom))}
}
