.chat-workspace { display: grid; height: calc(100vh - var(--hub-nav-height)); min-height: 520px; grid-template-columns: 330px minmax(0, 1fr); overflow: hidden; background: #fff; }
.chat-sidebar { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--hub-border); background: #fff; }
.chat-sidebar-header, .chat-panel-header { display: flex; min-height: 66px; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--hub-border); }
.chat-sidebar-header h1, .chat-panel-header h2 { margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: -.02em; }
.chat-sidebar-header .portal-eyebrow { margin-bottom: 2px !important; }
.icon-button { display: grid; width: 34px; height: 34px; margin-left: auto; place-items: center; border: 1px solid var(--hub-border); border-radius: 6px; color: #59615b; background: #fff; font-size: 1rem; }
.icon-button:hover { border-color: var(--hub-border-strong); background: var(--hub-subtle); }
.back-button { display: none; margin-left: 0; }
.chat-search-wrap { position: relative; margin: 12px 12px 8px; }
.chat-search-icon { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); color: #8b928c; font-size: .75rem; }
.chat-search { width: 100%; height: 36px; padding: 0 10px 0 31px; border: 1px solid var(--hub-border); border-radius: 6px; outline: 0; background: #f7f8f7; font-size: .8rem; }
.chat-search:focus { border-color: var(--hub-green); background: #fff; box-shadow: 0 0 0 3px rgba(22,134,79,.08); }
.chat-filters { display: flex; gap: 3px; padding: 0 12px 10px; border-bottom: 1px solid var(--hub-border); }
.chat-filter { padding: 5px 8px; border: 0; border-radius: 5px; color: var(--hub-muted); background: transparent; font-size: .7rem; font-weight: 600; }
.chat-filter span { margin-left: 2px; color: #959b96; }
.chat-filter:hover { background: var(--hub-subtle); }
.chat-filter.active { color: var(--hub-green-dark); background: var(--hub-green-soft); }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; }
.conversation-item { display: flex; width: 100%; gap: 10px; padding: 11px 12px; border: 0; border-bottom: 1px solid #f0f2f0; text-align: left; background: #fff; }
.conversation-item:hover { background: #f7f9f7; }
.conversation-item.active { background: #edf4ef; box-shadow: inset 3px 0 var(--hub-green); }
.conversation-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 8px; color: #315441; background: #dcebe2; font-size: .78rem; font-weight: 700; }
.conversation-avatar.group-avatar { color: #55496a; background: #e8e2ef; }
.conversation-avatar-large { width: 38px; height: 38px; flex-basis: 38px; }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-line { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.conversation-line strong { overflow: hidden; color: #252b27; font-size: .8rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.conversation-line time { color: #9aa09b; font-size: .63rem; }
.conversation-preview { margin-top: 4px; color: var(--hub-muted); font-size: .69rem; }
.conversation-preview > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-preview em { color: #8a918b; font-size: .6rem; font-style: normal; }
.conversation-empty { padding: 36px 18px; color: var(--hub-muted); text-align: center; font-size: .8rem; }
.chat-sidebar-footer { display: flex; min-height: 45px; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--hub-border); color: var(--hub-muted); font-size: .64rem; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hub-green); }
.manage-groups-button { border: 0; color: var(--hub-green-dark); background: transparent; font-size: .68rem; font-weight: 600; }
.chat-panel { min-width: 0; min-height: 0; overflow: hidden; background: #f4f5f4; }
.active-conversation { display: flex; height: 100%; min-height: 0; flex-direction: column; overflow: hidden; }
.chat-panel-header { flex: 0 0 auto; background: #fff; }
.conversation-heading { min-width: 0; }
.conversation-heading h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-heading span { color: var(--hub-muted); font-size: .69rem; }
.chat-empty-state { display: grid; height: 100%; padding: 30px; place-content: center; justify-items: center; text-align: center; }
.chat-empty-state h2 { margin: 14px 0 4px; font-size: 1rem; font-weight: 650; }
.chat-empty-state p { max-width: 360px; color: var(--hub-muted); font-size: .8rem; }
.empty-chat-icon { display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid var(--hub-border); border-radius: 12px; color: var(--hub-green-dark); background: #fff; font-size: 1.35rem; }
.message-stream { min-height: 0; flex: 1 1 0; overflow-y: auto; padding: 24px clamp(20px, 4vw, 60px); }
.bubble { max-width: min(72%, 650px); padding: 9px 11px; border: 1px solid #e0e4e1; border-radius: 4px 10px 10px 10px; color: #2a302c; background: #fff; font-size: .82rem; line-height: 1.45; box-shadow: 0 1px 2px rgba(20,30,23,.04); }
.bubble-outgoing { border-color: #cfe5d8; border-radius: 10px 4px 10px 10px; background: #eaf6ef; }
.bubble small:first-child { color: #3d4540; font-size: .67rem; }
.bubble small:last-child { display: block; margin-top: 4px; color: #89908a !important; font-size: .6rem; }
.attachment-preview { margin-top: 6px; }
.message-image { max-width: min(280px, 100%); border-radius: 6px; }
.message-media { width: min(300px, 100%); }
.message-composer { flex: 0 0 auto; padding: 10px 14px; border-top: 1px solid var(--hub-border); background: #fff; }
.composer-row { display: flex; align-items: flex-end; gap: 7px; }
.composer-type { height: 40px; padding: 0 8px; border: 1px solid var(--hub-border-strong); border-radius: 6px; color: var(--hub-muted); background: #fff; font-size: .72rem; }
.composer-input { min-height: 40px; max-height: 120px; flex: 1; resize: vertical; padding: 9px 11px; border: 1px solid var(--hub-border-strong); border-radius: 6px; outline: none; font-size: .82rem; }
.composer-input:focus { border-color: var(--hub-green); box-shadow: 0 0 0 3px rgba(22,134,79,.08); }
.send-button { height: 40px; padding: 0 14px; border: 0; border-radius: 6px; color: #fff; background: var(--hub-green); font-size: .78rem; font-weight: 600; }
.send-button:hover { background: var(--hub-green-dark); }
.attachment-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 7px; margin-bottom: 7px; }
.group-members-select { min-height: 110px; max-height: 180px; }
.group-tool-form h3 { font-size: .9rem; font-weight: 650; }
.chat-alert { position: fixed; right: 14px; bottom: 14px; z-index: 1090; max-width: min(420px, calc(100vw - 28px)); margin: 0; }

@media (max-width: 767px) {
    .chat-workspace { display: block; }
    .chat-sidebar, .chat-panel { height: 100%; }
    .chat-panel { display: none; }
    .chat-workspace.conversation-open .chat-sidebar { display: none; }
    .chat-workspace.conversation-open .chat-panel { display: block; }
    .back-button { display: grid; }
    .bubble { max-width: 88%; }
    .composer-type { width: 70px; }
}
