/* ===== Messages section additions (list sheet + chat screen) =====
   Prefixes: .msgx- (list page extras), .mchat- (chat screen). No global selectors. */

/* ---------- new-message sheet ---------- */
.msgx-sheet{position:absolute;inset:0;z-index:60;display:none}
.msgx-sheet.open{display:block}
.msgx-back{position:absolute;inset:0;background:rgba(4,3,7,.62);animation:fadeIn .25s ease both}
.msgx-panel{position:absolute;left:0;right:0;bottom:0;max-height:70%;display:flex;flex-direction:column;
 border-radius:24px 24px 0 0;padding:14px 16px 22px;
 background:linear-gradient(180deg,#16121d,#0b0910 60%);border-top:1px solid rgba(232,196,106,.35);
 animation:msgxUp .32s cubic-bezier(.2,.9,.25,1) both}
@keyframes msgxUp{from{transform:translateY(60%)}to{transform:translateY(0)}}
.msgx-grip{width:44px;height:4px;border-radius:4px;background:rgba(232,196,106,.3);margin:2px auto 12px}
.msgx-title{font-family:Amiri;font-weight:700;font-size:17px;text-align:center;margin-bottom:10px}
.msgx-panel .list{position:static;overflow-y:auto;max-height:46vh;gap:6px}
.msgx-panel .row{cursor:pointer}
.msgx-close{position:absolute;top:12px;inset-inline-start:12px;width:32px;height:32px;border-radius:50%;
 display:grid;place-items:center;background:rgba(255,255,255,.05);border:1px solid rgba(214,178,94,.28);cursor:pointer}

/* tappable affordances on the list page */
.top .icb{cursor:pointer;transition:transform .18s,border-color .25s}
.top .icb:active{transform:scale(.9)}
.top .icb:hover{border-color:rgba(232,196,106,.5)}
.list .row{cursor:pointer}

/* ---------- chat screen ---------- */
.mchat-top{position:absolute;z-index:7;top:22px;left:16px;right:16px;display:flex;align-items:center;gap:12px}
.mchat-icb{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;cursor:pointer;
 background:rgba(255,255,255,.05);border:1px solid rgba(214,178,94,.28);text-decoration:none;
 transition:transform .18s,border-color .25s}
.mchat-icb:active{transform:scale(.9)}
.mchat-icb:hover{border-color:rgba(232,196,106,.5)}
.mchat-peer{flex:1;min-width:0;display:flex;align-items:center;gap:10px;text-decoration:none}
.mchat-pav{position:relative;width:42px;height:42px;border-radius:50%;padding:1.5px;flex:0 0 auto;
 background:linear-gradient(160deg,#e8cd8e,#8f6d20)}
.mchat-pav img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}
.mchat-pav i{position:absolute;bottom:0;left:0;width:10px;height:10px;border-radius:50%;background:#3fbf7f;border:2px solid #0a090d}
.mchat-pn{display:flex;align-items:center;gap:6px;font-family:Tajawal;font-weight:700;font-size:15px;color:#f4e8cf}
.mchat-ps{font-size:9.5px;color:#8f8571;margin-top:2px}
.mchat-ps .on{color:#5fce96}

.mchat-flow{position:absolute;z-index:6;top:84px;left:0;right:0;bottom:88px;overflow-y:auto;overscroll-behavior:contain;
 display:flex;flex-direction:column;gap:7px;padding:10px 16px 14px;scrollbar-width:none}
.mchat-flow::-webkit-scrollbar{display:none}
.mchat-b{max-width:76%;padding:9px 13px;border-radius:16px;font-size:12.5px;line-height:1.65;color:#efe6d4;
 animation:fadeUp .35s ease both;word-break:break-word}
.mchat-b.them{align-self:flex-start;background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.02));
 border:1px solid rgba(214,178,94,.18);border-start-start-radius:5px}
.mchat-b.me{align-self:flex-end;background:linear-gradient(160deg,#f4dd9d,#d9b45e 55%,#b98f2e);color:#241a05;
 font-weight:600;border-start-end-radius:5px;box-shadow:0 6px 16px rgba(201,162,39,.22)}
.mchat-b .t{display:block;font-size:8.5px;margin-top:3px;opacity:.62;text-align:left;direction:ltr}
.mchat-b.pop{animation:pop .35s ease}

/* voice bubble */
.mchat-voice{display:flex;align-items:center;gap:9px;min-width:150px;cursor:pointer}
.mchat-vplay{width:30px;height:30px;border-radius:50%;flex:0 0 auto;display:grid;place-items:center;
 background:linear-gradient(160deg,#f8e6b4,#cfa535 58%,#a67c1b);border:0;cursor:pointer}
.mchat-vbars{display:flex;align-items:center;gap:2.5px;height:22px}
.mchat-vbars i{width:2.5px;border-radius:2px;background:#c9a86b;height:30%}
.mchat-vbars i:nth-child(2){height:55%}.mchat-vbars i:nth-child(3){height:85%}
.mchat-vbars i:nth-child(4){height:60%}.mchat-vbars i:nth-child(5){height:95%}
.mchat-vbars i:nth-child(6){height:50%}.mchat-vbars i:nth-child(7){height:35%}
.playing .mchat-vbars i{animation:mchatWave .7s ease-in-out infinite alternate}
.playing .mchat-vbars i:nth-child(2){animation-delay:.1s}.playing .mchat-vbars i:nth-child(3){animation-delay:.2s}
.playing .mchat-vbars i:nth-child(4){animation-delay:.3s}.playing .mchat-vbars i:nth-child(5){animation-delay:.15s}
.playing .mchat-vbars i:nth-child(6){animation-delay:.25s}.playing .mchat-vbars i:nth-child(7){animation-delay:.05s}
@keyframes mchatWave{from{transform:scaleY(.35)}to{transform:scaleY(1)}}
.mchat-vdur{font-size:10px;color:#b6ab93}

/* gift bubble */
.mchat-gift{width:190px;text-align:center;padding:14px 12px;
 background:linear-gradient(180deg,rgba(201,162,39,.14),rgba(201,162,39,.04));
 border:1px solid rgba(232,196,106,.42);animation:fadeUp .35s ease both,glowPulse 3.6s ease-in-out infinite 1s}
.mchat-gift img{width:110px;height:110px;object-fit:contain;mix-blend-mode:screen}
.mchat-gift b{display:block;font-family:Tajawal;font-weight:700;font-size:12.5px;color:#f0dcaa;margin-top:4px}

/* typing indicator */
.mchat-typing{align-self:flex-start;display:flex;gap:5px;padding:12px 15px;border-radius:16px;border-start-start-radius:5px;
 background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.02));border:1px solid rgba(214,178,94,.18)}
.mchat-typing i{width:6px;height:6px;border-radius:50%;background:#c9a86b;animation:pulseDot 1.1s ease-in-out infinite}
.mchat-typing i:nth-child(2){animation-delay:.18s}.mchat-typing i:nth-child(3){animation-delay:.36s}

/* composer */
.mchat-in{position:absolute;z-index:8;bottom:18px;left:16px;right:16px;display:flex;align-items:center;gap:10px}
.mchat-field{flex:1;height:48px;border-radius:24px;border:1px solid rgba(214,178,94,.22);outline:0;
 background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.018));
 color:#efe6d4;font-family:Tajawal;font-weight:500;font-size:12.5px;text-align:right;direction:rtl;padding:0 18px;
 transition:border-color .25s,box-shadow .25s}
.mchat-field::placeholder{color:#9a8f78}
.mchat-field:focus{border-color:rgba(232,196,106,.5);box-shadow:0 0 0 1px rgba(232,196,106,.18),0 0 18px rgba(201,162,39,.16)}
.mchat-send{width:48px;height:48px;border-radius:50%;flex:0 0 auto;display:grid;place-items:center;border:0;cursor:pointer;
 background:linear-gradient(180deg,#fbeec8,#e2bd6c 46%,#c9a02f);box-shadow:0 8px 20px rgba(201,162,39,.35);
 transition:transform .15s}
.mchat-send:active{transform:scale(.88)}
