/* The inbox owns its viewport. Each column scrolls independently. */
.chat-workspace .workspace {display:grid;grid-template-rows:auto minmax(0,1fr);height:100vh;height:100dvh}
.chat-workspace .main {width:100%;max-width:none;min-height:0;margin:0;padding:clamp(12px,1.7vw,26px);background:#eaf0ed}
.chat-workspace .topbar {min-height:54px}
.chat-workspace.chat-focus {grid-template-columns:minmax(0,1fr)}
.chat-workspace.chat-focus>.sidebar,.chat-workspace.chat-focus .topbar {display:none}
.chat-workspace.chat-focus .workspace {grid-template-rows:minmax(0,1fr)}
.chat-workspace.chat-focus .main {padding:0}
.chat-workspace.chat-focus .team-chat {border:0;border-radius:0}
@media(min-width:1024px) {
 .chat-workspace:not(.chat-focus){grid-template-columns:78px minmax(0,1fr)}
 .chat-workspace .sidebar {align-items:center;padding:18px 8px 10px}
 .chat-workspace .sidebar .brand {padding:0;margin:0 0 24px}
 .chat-workspace .sidebar :is(.logo-copy,.nav-group-label,.profile-name,.nav-caption){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .chat-workspace .sidebar nav {width:100%}
 .chat-workspace .nav-group {margin:0 0 10px;padding-bottom:8px;border-bottom:1px solid #31524a}
 .chat-workspace .nav-group:last-child {border:0}
 .chat-workspace .nav-link {min-height:40px;padding:0;justify-content:center;margin:2px auto;width:46px;border-radius:12px}
 .chat-workspace .nav-link .icon {width:20px;height:20px}
 .chat-workspace .nav-link em {position:absolute;inset-inline-end:-3px;top:-2px;font-size:.6rem;line-height:1.4;padding:0 4px}
 .chat-workspace .profile {width:100%;flex-direction:column;padding:12px 0 0;gap:3px}
}
.team-chat {--pine:#134c40;--deep:#112f2b;--text:#152e2b;--dim:#556965;--line:#d9e5df;--mint:#d8efdf;
 display:grid;grid-template-columns:clamp(248px,25vw,328px) minmax(0,1fr);height:100%;min-height:0;overflow:hidden;
 border:1px solid #d1ded6;border-radius:22px;background:#fff;color:var(--text);box-shadow:0 16px 42px -26px #204d40;
 font-family:Inter,"Segoe UI",Arial,sans-serif}
[dir=rtl] .team-chat {font-family:"Segoe UI",Tahoma,Arial,sans-serif}
.team-chat [hidden],[data-chat-count][hidden] {display:none!important}
.chat-shortcut.btn {display:none}
.team-chat :focus-visible {outline:3px solid #ce8c2a;outline-offset:2px}
.team-chat button {font-family:inherit}
.chat-list,.chat-thread,.chat-scroll,.thread-identity,.chat-room-copy {min-width:0;min-height:0}
.chat-list {display:flex;flex-direction:column;padding:24px 16px 12px;background:#fff;border-inline-end:1px solid var(--line)}
.chat-list-head,.thread-actions,.chat-filters,.chat-search-box,.chat-room,.chat-header,.chat-tools,.chat-compose-row,.chat-quote-draft,.chat-file-info {display:flex;align-items:center}
.chat-list-head {gap:7px;margin:0 3px 20px}
.chat-list h1 {flex:1;margin:0;font-size:clamp(1.48rem,2.2vw,2rem);line-height:1.12;font-weight:720;letter-spacing:-.055em}
[dir=rtl] .team-chat :is(h1,h2,h3) {letter-spacing:normal}
.chat-icon,.chat-send,.chat-reply,.chat-latest {display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:12px;cursor:pointer}
.chat-icon {width:38px;height:38px;padding:0;flex:none;color:var(--pine);background:transparent}
.chat-icon:hover {background:#e8f0eb}
.chat-list #chat-new {background:var(--pine);color:#fff;box-shadow:0 3px 8px #174d4126}
.chat-list #chat-new:hover,.chat-list #chat-new[aria-pressed=true] {background:#226a56}
.chat-search-box {gap:9px;min-height:43px;margin:0 2px;background:#f3f6f4;border:1px solid #dee7e1;border-radius:12px;padding:0 12px;color:var(--dim)}
.chat-search-box:focus-within {outline:2px solid #387e68;outline-offset:1px}
#chat-search {width:100%;border:0;outline:none;background:transparent;color:var(--text);font:inherit;font-size:.89rem;height:40px;padding:0;box-shadow:none}
#chat-search::placeholder,#chat-text::placeholder {color:#64756f;opacity:1}
.chat-filters {gap:3px;padding:3px;margin:12px 2px 11px;background:#f1f4f1;border-radius:11px}
.chat-filters button {display:flex;align-items:center;justify-content:center;gap:6px;flex:1;border:0;border-radius:8px;min-height:33px;background:transparent;font:inherit;font-size:.81rem;font-weight:650;color:var(--dim)}
.chat-filters button[aria-pressed=true] {background:#fff;color:var(--pine);box-shadow:0 1px 4px #19362b20}
#chat-unread-total {background:#dceae2;color:#154933;border-radius:12px;font-size:.7rem;padding:0 6px}
#chat-rooms {overflow:auto;scrollbar-width:thin;overscroll-behavior:contain;padding:0 2px 10px}
#chat-rooms h3 {margin:17px 7px 5px;color:#546760;font-size:.69rem;font-weight:750;letter-spacing:.065em;text-transform:uppercase}
.chat-room {position:relative;gap:10px;padding:9px 9px;min-height:61px;color:inherit;border-radius:13px;text-decoration:none}
.chat-room:hover {background:#f3f7f4}
.chat-room[aria-current=true] {color:#123e32;background:#e2f2e7}
.chat-room[aria-current=true]::before {content:"";position:absolute;inset-inline-start:0;inset-block:17px;border-inline-start:3px solid #237356;border-radius:3px}
.chat-avatar {display:inline-grid;place-items:center;width:37px;height:37px;flex:none;border-radius:50%;font-size:.83rem;font-weight:730;line-height:1;background:#d7eee2;color:#254b3b}
.chat-avatar.channel-general,.chat-avatar.channel-area {border-radius:12px}
.channel-general {background:#cbe7d7;color:#16513b}.channel-area {background:#e0e8f2;color:#335172}
.tone-0 {background:#e1e2f6;color:#514582}.tone-1 {background:#f6dfcc;color:#793e23}
.tone-2 {background:#cce7e8;color:#1b575e}.tone-3 {background:#f1dce4;color:#783e59}
.tone-4 {background:#f2e7bb;color:#705517}.tone-5 {background:#dbebce;color:#3a612d}
.chat-room-copy {flex:1;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:3px 5px}
.chat-room-copy bdi,.chat-room-copy small {display:block;text-align:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-room-copy bdi {font-size:.91rem;font-weight:680}
.chat-room-copy small {grid-column:1/-1;color:var(--dim);font-size:.78rem;font-weight:420}
.chat-room-copy time {font-size:.65rem;color:var(--dim);font-variant-numeric:tabular-nums}
.chat-count {flex:none;min-width:20px;height:20px;display:grid;place-items:center;padding:0 5px;border-radius:12px;background:#19624c;color:#fff;font-size:.7rem}
.chat-thread {position:relative;display:flex;flex-direction:column;overflow:hidden;background:#f5f7f3}
.chat-header {position:relative;isolation:isolate;overflow:hidden;gap:13px;padding:17px clamp(16px,2.3vw,37px);min-height:78px;background:linear-gradient(110deg,#153e34,#174c3d 68%,#1e5846);color:white}
.chat-header::after {content:"";position:absolute;z-index:-1;inset-block-start:-124px;inset-inline-end:8%;width:248px;height:248px;border:1px solid #ffffff11;border-radius:50%;box-shadow:0 0 0 18px #ffffff06,0 0 0 40px #ffffff04;pointer-events:none}
.chat-head-avatar {width:45px;height:45px;font-size:1.05rem;box-shadow:inset 0 0 0 1px #ffffff30}
.chat-head-avatar.channel-general,.chat-head-avatar.channel-area {color:#eaffed;background:#ffffff17}
.thread-identity {flex:1}
.chat-header h2 {margin:0;font-size:clamp(1.08rem,1.65vw,1.47rem);line-height:1.18;letter-spacing:-.025em;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-header p {font-size:.8rem;color:#c8e2d2;margin:3px 0 0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.thread-actions {gap:5px}
.chat-header .chat-icon {color:#e5f5ec;background:#ffffff12;border:1px solid #ffffff26}
.chat-header .chat-icon:hover,.chat-header .chat-icon[aria-pressed=true] {background:#d0edda;color:#163d30}
.chat-highlights {width:auto;padding:0 11px;font-size:.78rem;font-weight:630}
.chat-header .chat-back,.chat-back,.chat-choose {display:none}
.chat-status {padding:7px 18px;color:#604717;background:#fff1d0;font-size:.82rem}
.chat-status:empty {display:none}
.chat-scroll {flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;overflow-anchor:none;padding:16px clamp(14px,3.5vw,66px);
 background-color:#f3f6f1;background-image:radial-gradient(circle,#48735420 .72px,transparent .9px);background-size:15px 15px}
#chat-log {display:flex;flex-direction:column;gap:7px;min-height:100%;max-width:920px;margin:0 auto}
.chat-older,.chat-latest {margin:0 auto 8px}
.chat-date {align-self:center;margin:3px 0 9px;padding:4px 14px;border:1px solid #dce4dc;border-radius:20px;background:#fcfdfb;color:#4d6259;font-size:.74rem;font-weight:650}
.chat-unread-line {display:flex;align-items:center;gap:10px;color:#35604c;font-size:.74rem;font-weight:650;margin:5px 0}
.chat-unread-line::before,.chat-unread-line::after {content:"";flex:1;border-block-start:1px solid #c2d4c4}
.chat-message {align-self:flex-start;display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:9px;min-width:0;max-width:min(84%,635px)}
.chat-message.mine {align-self:flex-end;grid-template-columns:minmax(0,1fr);max-width:min(80%,600px)}
.chat-message.continued {margin-block-start:-4px}
.chat-identity {grid-column:1;grid-row:1/-1;display:flex;flex-direction:column;align-items:center;align-self:flex-end;gap:2px;min-width:0;min-height:0}
.chat-identity .sender-mark {margin:0}
.continued .chat-identity {visibility:hidden}
.chat-body {grid-column:2;display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.chat-message.mine .chat-body {grid-column:1;align-items:flex-end}
.chat-byline {display:flex;align-items:baseline;gap:7px;margin:0 2px 3px;min-width:0}
.chat-byline .bubble-sender {font-size:.78rem;font-weight:720;color:#2a5946;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-byline time {font-size:.66rem;color:#667b72;font-variant-numeric:tabular-nums;white-space:nowrap}
.continued .chat-byline {display:none}
.chat-bubble {min-width:0;max-width:100%;position:relative;padding:9px 13px 7px;border-radius:16px 16px 16px 5px;background:#fff;border:1px solid #dce5dc;box-shadow:0 2px 6px #14392708;overflow-wrap:anywhere;text-align:start}
.chat-message.mine .chat-bubble {border-radius:16px 16px 5px 16px;background:#d8eedb;border-color:#bfdcc7}
[dir=rtl] .chat-bubble {border-radius:16px 16px 16px 5px}
[dir=rtl] .chat-message.mine .chat-bubble {border-radius:16px 16px 5px 16px}
.chat-receipt {font-size:.7rem;letter-spacing:-.18em;color:#126444;font-weight:700}
.bubble-sender {font-size:.76rem;font-weight:720;color:#2a5946;margin-bottom:2px}
.chat-bubble>p,.chat-insight details p {margin:0;white-space:pre-wrap;font-size:.96rem;line-height:1.46;text-align:start}
.chat-tools {justify-content:flex-end;gap:5px;color:#55695e;min-height:22px;font-size:.65rem;font-variant-numeric:tabular-nums}
.chat-tools time {white-space:nowrap}
.chat-reply {margin-inline-end:auto;color:#385e4d;background:transparent;padding:2px 4px;min-width:27px;min-height:23px}
.chat-reply .icon,.chat-options .icon {height:15px;width:15px}
.chat-reply:hover,.chat-reply:focus-visible {background:#1d594412}
.chat-receipt {font-size:.72rem;letter-spacing:-.18em}.chat-receipt.read {color:#126444;font-weight:750}
.read-only .chat-reply {visibility:hidden}
.chat-empty {align-self:center;margin:auto;text-align:center;color:var(--dim);font-size:.87rem;padding:24px}
.chat-empty strong,.chat-empty>span {display:block}
.chat-empty strong {color:#244e3e;font-size:1.1rem;margin:10px 0 3px}
.chat-empty .empty-chat-icon {display:grid;place-items:center;margin:auto;width:54px;height:54px;border-radius:18px;background:#dcebe0;color:#316b50}
.empty-chat-icon .icon {width:27px;height:27px}
.chat-latest {position:absolute;inset-inline-end:20px;inset-block-end:94px;z-index:1;min-height:38px;border:1px solid #b9cec0;background:white;color:var(--pine);box-shadow:0 4px 14px #183e2420;font:inherit;font-size:.78rem;padding:0 11px}
.chat-latest .icon {transform:rotate(90deg);width:15px}
.chat-insight {display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin-top:5px;font-size:.74rem;color:#455f51}
.chat-insight:empty {display:none}
.chat-insight details:not(.chat-options) {width:100%;background:#193e2609;border-radius:8px;padding:4px 7px}
.chat-insight summary {cursor:pointer;font-weight:650}
.chat-insight details p {font-size:.84rem;margin-top:3px}
.chat-topic {display:inline-flex;align-items:center;gap:4px;border-radius:6px;padding:3px 6px;background:#f6edcd;color:#644c14;font-weight:680}
.chat-topic .icon {width:12px;height:12px}
.chat-review {border:0;background:transparent;padding:4px;font:inherit;font-weight:625;color:#285a43;text-decoration:underline;text-underline-offset:2px}
.chat-options summary {list-style:none;display:grid;place-items:center;color:#466456;min-width:25px;min-height:21px}
.chat-options summary::-webkit-details-marker {display:none}
.chat-insight:has(>.chat-options:only-child) {position:relative;float:inline-start;margin:-1px 4px 0 -2px}
.chat-options[open] {padding:3px}.chat-options[open] summary {justify-content:start}
.chat-download,.chat-quote {max-width:100%}
.chat-download {display:flex;align-items:center;gap:10px;margin:6px 0 3px;padding:8px 9px;border-radius:11px;border:1px solid #cddfd3;background:#eef5f0;color:#21513e;text-decoration:none}
.chat-download:hover,.chat-download:focus-visible {background:#dfede3;border-color:#97bba1}
.chat-file-icon {display:grid;place-items:center;flex:none;width:33px;height:37px;color:#2c7051;border-radius:8px;background:#d3e9d9}
.chat-file-icon .icon {width:20px;height:20px}
.chat-file-label {flex:1;min-width:0;display:grid;gap:2px}
.chat-file-label bdi {font-size:.82rem;font-weight:650;overflow-wrap:anywhere}.chat-file-label small {font-size:.67rem;color:#4c6858}
.chat-download>.icon {flex:none;width:16px;height:16px;margin-inline-start:6px}
.chat-photo {display:block;max-width:100%;padding:0;border:0;border-radius:12px;background:#dbe3da;overflow:hidden;cursor:zoom-in;margin:4px 0}
.chat-photo img {display:block;max-width:min(360px,55vw);max-height:310px;min-width:42px;min-height:30px;object-fit:contain}
.chat-photo-full {display:block;max-width:100%;max-height:70dvh;object-fit:contain;margin:auto}
.chat-player:not(:empty){width:min(270px,48vw)}
.chat-player audio,#voice-preview {width:100%;height:39px;margin:3px 0}
.chat-quote,.chat-quote-draft {text-align:start;border:0;border-inline-start:3px solid #55856a;border-radius:6px;background:#386a4c12;padding:6px 9px;color:#244735}
.chat-quote {cursor:pointer;display:block;margin:4px 0 6px}
.chat-quote strong,.chat-quote small,.chat-quote-draft strong,.chat-quote-draft small {display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
.chat-quote small {max-width:min(46vw,350px);font-size:.78rem}
.chat-quote-draft,.chat-file-info {margin-bottom:8px;gap:10px;font-size:.8rem}
.chat-file-info bdi,.chat-quote-draft>div {min-width:0;flex:1}
.chat-file-info bdi {overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#chat-image-preview {width:58px;height:49px;object-fit:cover;border-radius:8px}
.chat-compose {padding:12px clamp(12px,2vw,30px) max(13px,env(safe-area-inset-bottom));background:#fbfcfa;border-top:1px solid #d9e3d8}
.chat-compose-row {align-items:flex-end;gap:5px;background:#fff;border:1px solid #c9d8cb;border-radius:17px;padding:5px 6px;box-shadow:0 3px 12px #15351f09}
.chat-compose-row:focus-within {border-color:#63967b;box-shadow:0 0 0 2px #6f9d7e21}
.chat-compose-row .chat-icon {width:38px;height:38px}
#chat-text {field-sizing:content;flex:1;width:0;border:0;resize:none;border-radius:6px;outline:0;min-height:38px;max-height:120px;font:inherit;font-size:.94rem;line-height:22px;padding:8px 4px;color:var(--text);background:transparent}
#chat-text:focus-visible {outline:none}
.chat-send {min-height:38px;background:#1a5842;color:white;font:inherit;font-size:.8rem;font-weight:650;padding:0 13px}
.chat-send:hover {background:#124632}
.chat-send:disabled {background:#e1eae2;color:#51685b;opacity:1;cursor:default}
#chat-mic.recording {color:#932d36;background:#fce0df}
#voice-bar {display:flex;flex-wrap:wrap;align-items:center;gap:0 9px}
#voice-service,#voice-time {font-size:.79rem;color:#536258}
#voice-bar audio {max-width:260px}
.chat-thread.drag-file .chat-compose {outline:3px dashed #377a55;outline-offset:-4px}
.chat-hit {padding:12px 0;border-bottom:1px solid #dce5df}.chat-hit small{display:block;color:#4d675a}
[dir=rtl] :is(#chat-send,#chat-back,#chat-choose,.chat-reply) .icon {transform:scaleX(-1)}
@media(max-width:1023px) and (min-width:761px){.team-chat {grid-template-columns:224px minmax(0,1fr)}.chat-list{padding-inline:10px}.chat-highlights span{display:none}.chat-scroll{padding-inline:16px}.chat-header{gap:9px;padding-inline:14px}.chat-highlights{width:38px}}
@media(max-width:760px) {
 .chat-shortcut.btn {display:inline-flex}
 .chat-workspace .main {padding:0}
 .team-chat {display:flex;border:0;border-radius:0;box-shadow:none}
 .chat-list {display:none;width:100%;padding:max(16px,env(safe-area-inset-top)) 16px 15px;border:0}
 .chat-list-head {margin-bottom:14px}
 .chat-list h1 {font-size:1.75rem}
 .chat-list #chat-new,.chat-back,.chat-choose {display:inline-flex}
 .team-chat.choosing .chat-list {display:flex}
 .team-chat.choosing .chat-thread {display:none}
 .chat-thread {width:100%}
 .chat-header {min-height:66px;padding:9px 10px;gap:8px}
 .chat-header .chat-choose {background:transparent;border-color:transparent}
 .chat-header .chat-icon {width:37px;height:40px;padding:0}
 .chat-header p {font-size:.71rem;margin-top:3px}
 .chat-head-avatar {width:36px;height:36px;font-size:.85rem}
 .chat-highlights span {display:none}
 .thread-actions {gap:3px}
 .chat-scroll {padding:13px 11px}
 .chat-message {max-width:91%;gap:5px}
 .chat-identity {grid-column:1;grid-row:1;align-self:flex-start;justify-self:center}
 .chat-body {grid-column:1;grid-row:1}
 .chat-bubble {padding:8px 11px 4px}
 .chat-tools {min-height:25px}
 .chat-compose {padding:8px 9px max(9px,env(safe-area-inset-bottom))}
 .chat-compose-row {gap:1px}
 #chat-text {font-size:16px}
 .chat-send {width:40px;padding:0}
 .chat-icon,.chat-filters button {min-height:39px}
 #chat-rooms h3 {margin-top:16px}
 .chat-search-box {min-height:45px}
}
@media(max-width:370px) {.chat-head-avatar{display:none}.chat-header{gap:3px}.chat-header .chat-icon{width:34px}}
@media(pointer:fine) {
 .chat-reply,.chat-options:not([open]) summary {opacity:.55}
 .chat-message:hover .chat-reply,.chat-message:focus-within .chat-reply,.chat-message:hover .chat-options summary,.chat-message:focus-within .chat-options summary{opacity:1}
}
@media(prefers-reduced-motion:no-preference){.chat-room,.chat-icon,.chat-reply,.chat-compose-row {transition:background-color .13s ease,box-shadow .14s ease}}
@media print {.chat-latest,.chat-compose,.chat-tools {display:none}}