.ch-root{max-width:1280px;width:100%;min-width:0}
.ch-toolbar,.ch-new-actions,.ch-send-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ch-toolbar>p{flex:1 1 260px;margin:0;color:var(--muted)}
.ch-toolbar{justify-content:space-between}
.ch-status{min-height:1.5em;max-height:4.5em;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:10px 0}
.ch-error,.ch-members-changed{color:var(--warn,#c28d46)}
.ch-layout{display:grid;grid-template-columns:minmax(220px,290px) minmax(0,1fr);gap:16px;height:min(720px,var(--ch-height,calc(100dvh - 170px)));min-height:150px;align-items:stretch}
.ch-inbox,.ch-thread{border:1px solid var(--line);border-radius:12px;background:var(--panel);min-width:0;padding:14px}
.ch-inbox>h2,.ch-thread-heading h2{font-size:17px;margin:0 0 10px;overflow-wrap:anywhere}
.ch-conversation{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;padding:12px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--text);text-align:start;cursor:pointer;font:inherit;margin-bottom:5px;min-height:48px}
.ch-conversation:hover,.ch-selected{border-color:var(--line);background:var(--panel-2)}
.ch-conversation-title{font-weight:650;overflow-wrap:anywhere}
.ch-preview,.ch-date{color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.ch-preview,.ch-conversation .ch-date{grid-column:1/-1}
.ch-unread{border-radius:12px;background:var(--purple);color:#fff;min-width:23px;padding:2px 6px;font-size:12px;text-align:center}
.ch-unread-total{font-size:12px;color:var(--muted)}
.ch-inbox{display:flex;flex-direction:column;gap:7px;overflow:hidden}
.ch-inbox #ch-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.ch-inbox>input{width:100%;max-width:100%;min-height:42px;flex:0 0 auto}
.ch-search-label{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.ch-thread{display:flex;flex-direction:column;overflow:hidden;gap:6px}
.ch-thread-heading{display:flex;align-items:flex-start;gap:10px;flex:0 0 auto}
.ch-room-title{flex:1;min-width:0}
.ch-thread-heading h2{margin-bottom:4px}
.ch-back{display:none}
.ch-room-details summary,.ch-file-help summary{cursor:pointer;color:var(--muted);font-size:12px;min-height:24px;padding:3px 0}
.ch-room-details[open]{max-height:135px;overflow:auto}
.ch-room-details .ch-members{margin-top:7px}
.ch-members{margin:0 0 6px;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.ch-task-controls{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:12px}
.ch-task-controls select{max-width:200px}
.ch-history-wrap{position:relative;flex:1;min-height:0;overflow:hidden}
.ch-history{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:9px;margin:0;padding:4px}
.ch-latest{position:absolute;bottom:8px;inset-inline-end:8px;box-shadow:0 3px 12px #0004;max-width:90%}
.ch-message{max-width:92%;align-self:flex-start;border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:var(--panel-2);min-width:0}
.ch-own{align-self:flex-end;border-color:var(--purple)}
.ch-message-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:11px;color:var(--muted)}
.ch-message p{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;margin:6px 0 0;font-size:14px;line-height:1.5}
.ch-composer{border-top:1px solid var(--line);padding-top:8px;flex:0 0 auto;min-width:0}
.ch-composer>label,.ch-create-form>label{display:block;font-weight:600;font-size:13px;margin-bottom:7px}
.ch-composer textarea{display:block;width:100%;max-width:100%;resize:vertical;max-height:120px;min-height:54px;font:inherit}
.ch-composer .ch-date{margin:7px 0}
.ch-send-actions{justify-content:flex-end}
.ch-composer .ch-send-actions{margin-top:6px}
.ch-file-help[open]{max-height:100px;overflow:auto}
.ch-status:empty{display:none}
.ch-empty{color:var(--muted);padding:12px 3px;overflow-wrap:anywhere}
.ch-create-form fieldset{border:1px solid var(--line);border-radius:9px;margin:14px 0;padding:10px;max-height:45vh;overflow-y:auto}
.ch-create-form legend{padding:0 6px;font-size:13px}
.ch-person{display:flex;align-items:center;gap:10px;min-height:46px;cursor:pointer;padding:6px;border-radius:6px}
.ch-person input{width:18px;height:18px;flex:0 0 auto;margin:0}
.ch-person span{overflow-wrap:anywhere;min-width:0}
.ch-person small{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.ch-create-form>input{width:100%;max-width:100%}
.ch-person:focus-within,.ch-conversation:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.ch-root [hidden],.ch-create-form [hidden]{display:none!important}
@media(max-width:820px){.ch-layout{grid-template-columns:minmax(0,1fr);gap:0;height:var(--ch-height,calc(100dvh - 180px))}.ch-inbox,.ch-thread{padding:9px}.ch-thread{display:none}.ch-root.ch-room-open .ch-inbox{display:none}.ch-root.ch-room-open .ch-thread{display:flex}.ch-back{display:inline-flex;max-width:130px;min-height:44px;font-size:12px;padding:8px}.ch-message{max-width:96%}.ch-toolbar{gap:7px}.ch-new-actions{width:100%}.ch-new-actions .btn{flex:1 1 auto;min-height:44px}.ch-task-controls{width:100%}.ch-task-controls select{flex:1 1 120px;max-width:100%}.ch-send-actions .btn{min-height:44px}.ch-message-meta{gap:5px}.ch-composer>label{font-size:12px;margin-bottom:4px}.ch-composer textarea{min-height:44px;max-height:95px;font-size:16px}.ch-composer #ch-compose-hint,.ch-composer #ch-length{position:absolute;width:1px;height:1px;margin:0;padding:0;overflow:hidden;clip:rect(0,0,0,0)}.ch-room-details[open]{max-height:105px}.ch-file-help summary{min-height:20px;padding:1px 0}.ch-status{font-size:12px;margin:5px 0}}
.ch-file-draft,.ch-message-file{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid var(--line);border-radius:8px;padding:9px 10px;min-width:0;flex-wrap:wrap}
.ch-file-draft{margin:10px 0;background:var(--panel-2)}
.ch-file-draft-meta,.ch-message-file>span{flex:1 1 150px;min-width:0;overflow-wrap:anywhere}
.ch-file-draft small,.ch-message-file small{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.ch-message-file{margin-top:8px;font-size:12px}
.ch-attachment-viewer{min-width:0;max-width:100%}
.ch-file-preview{display:block;max-width:100%;margin:0 auto 12px;border:0;object-fit:contain}
img.ch-file-preview{max-height:60vh;width:auto;height:auto}
iframe.ch-file-preview{width:100%;height:60vh}
@media(max-width:820px){.ch-file-draft .btn,.ch-message-file .btn{min-height:44px}.ch-message-file{padding:7px}.ch-file-preview{max-height:55vh}iframe.ch-file-preview{height:55vh}.ch-attachment-viewer .ch-send-actions{justify-content:stretch}.ch-attachment-viewer .ch-send-actions .btn{flex:1 1 auto}}
#modal-overlay.ch-attachment-active #modal-title{flex:1;min-width:0;overflow-wrap:anywhere}
#modal-overlay.ch-attachment-active #modal-close{flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px}
.ch-selected-people{display:flex;flex-wrap:wrap;gap:6px;max-height:120px;overflow:auto}
.ch-person-chip{display:inline-flex;align-items:center;min-height:36px;border:1px solid var(--line);border-radius:18px;background:var(--panel-2);color:var(--text);padding:7px 11px;max-width:100%;overflow-wrap:anywhere;text-align:start;cursor:pointer}
@media(max-width:820px){.ch-thread-heading{flex:0 1 auto;max-height:35%;min-height:44px;overflow-y:auto}.ch-composer{flex:0 1 auto;max-height:65%;min-height:92px;overflow-y:auto;overscroll-behavior:contain}.ch-composer .ch-send-actions{position:sticky;bottom:0;background:var(--panel);padding:4px 0;z-index:1}.ch-history-wrap{min-height:20px}}
