/* Чаты (модуль chat) — кнопка 💬 в колонке плавающих кнопок (layout.css), шторка снизу */
.slot-overlay > .cht-btn {   /* запасное место, если layout.js не загружен */
  position: absolute; right: calc(8px + var(--sar, 0px)); bottom: calc(var(--panel-h, 45vh) + 34px);
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.45); font-size: 20px; line-height: 1; padding: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.cht-badge { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red, #ff3b3b); color: #fff; font: 800 11px/18px system-ui, sans-serif; text-align: center; box-sizing: border-box; }
/* z: над панелью (20), FX-слоем купюр (30/40) и тостами (50), под модалками (57/58) */
.cht-back { position: fixed; inset: 0; z-index: 53; background: rgba(0,0,0,.55); touch-action: none; }
.cht-back[hidden], .cht-sheet[hidden] { display: none !important; }
.cht-sheet { position: fixed; left: 0; right: 0; top: 10vh; height: 90vh; z-index: 54; display: flex; flex-direction: column; box-sizing: border-box;
  max-width: 640px; margin: 0 auto; background: var(--bg1, #0d1a12); color: var(--text, #fff); transition: transform .18s ease-out;
  border-radius: 16px 16px 0 0; border-top: 1px solid rgba(255,255,255,.12); box-shadow: 0 -6px 24px rgba(0,0,0,.5);
  padding-bottom: env(safe-area-inset-bottom); animation: cht-up .18s ease-out; overflow: hidden; }
.cht-sheet.cht-lite { animation: none; }
@keyframes cht-up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.cht-grip { flex: none; height: 16px; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.cht-grip span { width: 42px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.cht-head { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 8px 8px 10px; touch-action: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.cht-tabs { flex: 1; display: flex; gap: 6px; min-width: 0; }
.cht-tabs button { position: relative; flex: 0 1 auto; min-width: 0; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 7px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: inherit; font: inherit; font-size: 14px; font-weight: 700; }
.cht-tabs button.on { background: var(--neon, #2bff88); color: #04100a; border-color: transparent; }
.cht-tabs i.dot { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--gold, #ffd34d); vertical-align: middle; }
.cht-x { position: relative; z-index: 3; width: 40px; height: 40px; cursor: pointer; touch-action: manipulation; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: inherit; font-size: 16px; flex: none; }
.cht-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.cht-empty { margin: auto; color: var(--muted, #8a9); font-size: 13px; text-align: center; padding: 20px; }
.cht-msg { align-self: flex-start; max-width: 82%; margin-top: 6px; }
.cht-msg.cont { margin-top: 0; }
.cht-msg.mine { align-self: flex-end; text-align: right; }
.cht-meta { display: flex; align-items: baseline; gap: 6px; font-size: 11px; margin: 0 4px 2px; min-width: 0; }
.cht-msg.mine .cht-meta { justify-content: flex-end; }
.cht-name { border: 0; background: none; padding: 0; color: var(--gold, #ffd34d); font: inherit; font-weight: 800; font-size: 12px;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cht-title { color: var(--neon, #2bff88); opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
.cht-time { color: var(--muted, #8a9); flex: none; }
.cht-text { display: inline-block; text-align: left; padding: 7px 10px; border-radius: 12px 12px 12px 4px; background: rgba(255,255,255,.07);
  font-size: 14px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.cht-msg.mine .cht-text { border-radius: 12px 12px 4px 12px; background: rgba(43,255,136,.16); }
.cht-new { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); z-index: 2; padding: 6px 12px; border-radius: 14px;
  border: 0; background: var(--gold, #ffd34d); color: #1b1406; font-weight: 800; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.cht-note { flex: none; padding: 10px 12px; font-size: 13px; color: var(--muted, #8a9); text-align: center; border-top: 1px solid rgba(255,255,255,.08); }
.cht-foot { flex: none; display: flex; gap: 6px; align-items: flex-end; padding: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.cht-foot[hidden] { display: none; }
.cht-foot textarea { flex: 1; min-width: 0; resize: none; max-height: 96px; padding: 9px 11px; border-radius: 12px; box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.35); color: inherit; font: inherit; font-size: 16px; line-height: 1.3; }
.cht-send { flex: none; width: 42px; height: 40px; border-radius: 12px; border: 0; background: var(--neon, #2bff88); color: #04100a; font-size: 18px; font-weight: 900; }
.cht-send:disabled { opacity: .5; }
