/* V5.3 - account messaging. Logical properties keep both LTR and RTL aligned. */
.chat-workspace{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start;min-width:0;margin:16px 0 24px}.chat-workspace[data-role=admin]{grid-template-columns:minmax(230px,300px) minmax(0,1fr)}.chat-workspace>.panel{min-width:0;margin:0;padding:clamp(12px,2vw,22px)}.chat-inbox{min-height:240px}.chat-inbox h2,.chat-top h2{margin:0 0 8px;font-size:clamp(1rem,2vw,1.35rem);overflow-wrap:anywhere}.chat-inbox input{width:100%;min-width:0;margin:8px 0 12px}.chat-threads{display:flex;flex-direction:column;gap:6px;max-height:560px;overflow-y:auto;overscroll-behavior:contain}.chat-thread{display:flex;gap:8px;align-items:center;justify-content:space-between;border:1px solid #384054;border-radius:12px;padding:10px;color:inherit;text-decoration:none;min-width:0;overflow-wrap:anywhere}.chat-thread.selected,.chat-thread:hover{background:#30253e;border-color:#d5b47d}.chat-thread-main{min-width:0;flex:1;display:grid;gap:4px}.chat-thread-main small{font-size:.78rem;color:#b9c4d3}.chat-unread{font-size:.8rem;background:#dfbd80;color:#181424;border-radius:999px;padding:4px 8px;font-weight:bold;flex:none}.chat-inactive{font-size:.75rem;color:#ffd1b6}.chat-conversation{display:flex;flex-direction:column;gap:10px;min-width:0}.chat-top{display:flex;align-items:flex-start;gap:10px;justify-content:space-between;border-bottom:1px solid #384054;padding-bottom:8px}.chat-top>div{min-width:0}.chat-top p{margin:0;overflow-wrap:anywhere}.chat-connection{color:#a6d4c3;font-size:.8rem;text-align:end;max-width:35%;overflow-wrap:anywhere}.chat-history{display:flex;flex-direction:column;gap:10px;height:clamp(240px,50vh,560px);overflow-y:auto;overscroll-behavior:contain;padding:12px;background:#111722;border:1px solid #30394c;border-radius:14px;min-width:0;scrollbar-gutter:stable}.chat-message{flex:none;max-width:min(83%,580px);min-width:0;align-self:flex-start;background:#263448;border:1px solid #3d4b5c;border-radius:14px 14px 14px 4px;padding:10px 12px;overflow-wrap:anywhere;line-height:1.55}.chat-message.chat-mine{align-self:flex-end;background:#3b2844;border-color:#6d536c;border-radius:14px 14px 4px 14px}html[dir=rtl] .chat-message{border-radius:14px 14px 4px 14px}html[dir=rtl] .chat-message.chat-mine{border-radius:14px 14px 14px 4px}.chat-sender{color:#dfbd80;font-size:.76rem;font-weight:700;margin-bottom:4px}.chat-text{white-space:pre-wrap;font-size:1rem;overflow-wrap:anywhere;word-break:break-word}.chat-meta{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;align-items:center;font-size:.72rem;color:#bac7d4;margin-top:8px}.chat-tick{color:#a6d4c3}.chat-attachment{display:grid;gap:6px;min-width:0;margin-top:6px}.chat-attachment img,.chat-attachment video{max-width:100%;width:auto;max-height:260px;object-fit:contain;border-radius:8px}.chat-attachment audio{width:100%;min-width:0;max-width:100%}.chat-download{font-size:.86rem;color:#f0cc90;overflow-wrap:anywhere;text-decoration:underline}.chat-composer{margin:0;min-width:0;display:flex;flex-direction:column;gap:8px}.chat-composer textarea{width:100%;max-width:100%;min-height:64px;resize:vertical;font-size:16px}.chat-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}.chat-tools button,.chat-tools .chat-attach{min-height:44px;font-size:.88rem;padding:10px 14px;width:auto;max-width:100%;margin:0;cursor:pointer}.chat-tools .chat-send{margin-inline-start:auto;min-width:90px}.chat-attach{display:inline-flex!important;position:relative;align-items:center;justify-content:center;overflow:hidden}.chat-attach input{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0!important;cursor:pointer;margin:0!important}.chat-attach:focus-within{outline:2px solid #dfbd80;outline-offset:2px}.chat-file-preview{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;border-radius:8px;background:#263448;min-width:0}.chat-file-preview span{overflow-wrap:anywhere;min-width:0}.chat-file-preview button{flex:none}.chat-note,.chat-status{font-size:.82rem;overflow-wrap:anywhere;margin:0;color:#c1cbd9}.chat-status{min-height:1.2em;color:#dfbd80}.chat-empty,.chat-empty-text{text-align:center;color:#c1cbd9}.chat-empty img{max-width:100%;margin:10px auto}.chat-older{align-self:center;width:auto!important}.chat-workspace [hidden]{display:none!important}.chat-message audio{min-width:120px}.chat-message:has(audio){width:min(83%,370px)}
@media(max-width:800px){.chat-workspace[data-role=admin]{grid-template-columns:minmax(0,1fr)}.chat-inbox{min-height:0}.chat-threads{max-height:220px}.chat-history{height:clamp(240px,46vh,480px)}.chat-workspace>.panel{padding:12px}}@media(max-width:480px){.chat-message{max-width:92%;padding:8px}.chat-history{padding:8px;gap:8px}.chat-tools{gap:6px}.chat-tools button,.chat-tools .chat-attach{padding:9px 10px;min-height:44px}.chat-send{flex:1}.chat-top{flex-wrap:wrap}.chat-connection{max-width:100%}.chat-message:has(audio){width:92%}.chat-note{line-height:1.6}.chat-workspace{gap:12px}}
