/* Buyer ↔ seller chat (static/assets/chat.js): the side panel on a client listing page and the thread in the cabinet. */
.achat{position:fixed;right:20px;bottom:20px;z-index:90;width:400px;max-width:calc(100vw - 32px);max-height:min(640px,calc(100vh - 110px));
  display:none;flex-direction:column;background:#fff;border:1px solid var(--line,#e2e2e2);border-radius:12px;box-shadow:0 18px 50px rgba(0,0,0,.22);overflow:hidden}
.achat.open{display:flex}
body.achat-on .fab{display:none}
.achat-top{display:flex;align-items:center;gap:8px;padding:14px 18px;background:var(--green,#0d6a2c);color:#fff}
.achat-top b{font:500 17px Oswald,sans-serif;flex:1}
.achat-x{background:none;border:0;color:#fff;font-size:28px;line-height:1;cursor:pointer;padding:0 4px}
.achat-body{flex:1;display:flex;flex-direction:column;min-height:0;padding:18px 18px 16px;gap:14px;overflow:auto}
.achat-body>.achat-thread{flex:1;min-height:0}
.achat-body .achat-list{min-height:200px}
.achat-info{margin:0;font-size:15px;line-height:1.45;color:var(--ink,#2b2b2b)}
.achat-info.small{font-size:13px;color:var(--muted,#666);background:#f2f6f3;padding:6px 10px;border-radius:8px}
.achat-as{margin:-4px 0 -4px;font-size:13px;color:var(--muted,#666)}
.achat-fields{display:grid;gap:10px}
.achat-fields input,.achat-form textarea{width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #cfd3d0;border-radius:8px;font:inherit;font-size:16px}
.achat-note{margin:0;padding-top:12px;border-top:1px solid var(--line,#e2e2e2);font-size:12px;line-height:1.5;color:var(--muted,#666)}
.achat-status{margin:0;padding:8px 10px;border-radius:8px;background:#fbe3e1;color:#9a2a22;font-size:14px}
.achat-all{font-size:13.5px;color:var(--green,#0d6a2c);font-weight:500}
.achat-ts:empty{display:none}

.achat-thread{display:flex;flex-direction:column;gap:8px;min-height:0}
.achat-head{display:flex;gap:10px;align-items:center;padding-bottom:10px;border-bottom:1px solid var(--line,#e2e2e2)}
.achat-head>div{display:grid;gap:2px;min-width:0}
.achat-head a{color:inherit}
.achat-head small{color:var(--muted,#666);font-size:13px}
.achat-online{margin-left:8px;color:var(--green,#0d6a2c);font-weight:500}
.achat-online::before{content:"";display:inline-block;width:8px;height:8px;margin-right:4px;border-radius:50%;background:#2bb24c;vertical-align:1px}
.achat-pic{flex:0 0 72px;width:72px;height:48px;border-radius:6px;overflow:hidden;background:#e4e8e5;display:grid;place-items:center}
.achat-pic img{width:100%;height:100%;object-fit:cover;display:block}
.achat-list{flex:1;min-height:120px;overflow-y:auto;display:flex;flex-direction:column;gap:3px;padding:4px 2px}
.achat-empty{margin:auto;color:var(--muted,#666);font-size:14px}
.achat-msg{max-width:75%;align-self:flex-start;background:#eef1ef;border-radius:12px 12px 12px 4px;padding:5px 10px;display:flow-root}
.achat-msg.mine+.achat-msg:not(.mine),.achat-msg:not(.mine)+.achat-msg.mine{margin-top:6px}
.achat-msg.mine{align-self:flex-end;background:#dcefe2;border-radius:12px 12px 4px 12px}
.achat-text{display:inline;white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.35}
.achat-msg small{float:right;margin:5px 0 -2px 10px;font-size:11px;line-height:1.2;color:var(--muted,#666);white-space:nowrap}
.achat-msg small.achat-by{float:none;display:block;margin:0 0 1px;font-weight:600;color:var(--green,#0d6a2c)}
.achat-form{display:flex;gap:8px;align-items:flex-end}
.achat-form textarea{resize:none;min-height:44px;max-height:130px;line-height:1.4;overflow-y:hidden}
.achat-form.first{gap:10px}
.achat-form.first textarea{min-height:92px}
.achat-send{flex:0 0 44px;width:44px;height:44px;border-radius:50%;border:0;background:var(--green,#0d6a2c);color:#fff;display:grid;place-items:center;cursor:pointer}
.achat-send:disabled{opacity:.5;cursor:default}

/* in the cabinet the thread is the box itself (.kbox.kchat.achat-thread) and fills the screen; the messages
   scroll inside it, the page does not grow (Galina, 2026-10-24) */
.kchat.achat-thread{height:calc(100vh - 200px);height:calc(100dvh - 200px);min-height:340px;box-sizing:border-box}

@media (max-width:640px){
  .achat-msg{max-width:85%}
  .achat{right:0;bottom:0;left:0;top:0;width:auto;max-width:none;max-height:none;height:auto;border-radius:0;border:0}
}
