/* driver-messages.css — MESSAGING STAGE 4 (2026-11-13), the driver app's Messages tab. Every rule is scoped to dm-* classes or #chat-list. */
#chat-list.dm-on .bubble[data-mid]{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;touch-action:pan-y;transition:transform .15s ease}
#chat-list .bubble.dm-flash{animation:dmFlash 1.3s ease}
@keyframes dmFlash{0%,40%{box-shadow:0 0 0 3px rgba(230,57,70,.55)}100%{box-shadow:none}}
#chat-list .dm-fwd{font-size:13px;font-style:italic;color:#64748b;margin-bottom:3px}
#chat-list .bubble.me .dm-fwd{color:rgba(255,255,255,.75)}
#chat-list .dm-quote{display:block;width:100%;text-align:left;border:0;border-left:3px solid #e63946;border-radius:8px;background:rgba(15,23,42,.06);
  padding:6px 9px;margin:0 0 6px;font:inherit;font-size:13px;line-height:1.35;color:inherit;cursor:pointer;min-width:0}
#chat-list .dm-quote b{display:block;font-size:12.5px;color:#e63946}
#chat-list .dm-quote span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:.85}
#chat-list .bubble.me .dm-quote{background:rgba(255,255,255,.13);border-left-color:#fca5a5}
#chat-list .bubble.me .dm-quote b{color:#fecaca}
#chat-list .dm-voice{display:flex;align-items:center;gap:9px;min-width:190px;margin-top:2px}
#chat-list .dm-vplay{width:36px;height:36px;min-width:36px;border-radius:50%;border:0;background:#e63946;color:#fff;font-size:13px;cursor:pointer;display:flex;align-items:center;justify-content:center}
#chat-list .bubble.me .dm-vplay{background:#fff;color:#0f1923}
#chat-list .dm-voice.loading .dm-vplay{opacity:.6}
#chat-list .dm-vbar{flex:1;height:4px;border-radius:4px;background:rgba(100,116,139,.3);overflow:hidden;min-width:60px}
#chat-list .dm-vbar i{display:block;height:100%;width:0;background:#e63946}
#chat-list .bubble.me .dm-vbar{background:rgba(255,255,255,.3)}
#chat-list .bubble.me .dm-vbar i{background:#fff}
#chat-list .dm-vtime{font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap}
#chat-list .dm-vtime a{color:inherit;text-decoration:underline}
#chat-list .dm-sheet{display:inline-flex;align-items:center;gap:5px;margin-top:7px;padding:6px 10px;border-radius:10px;border:1px solid #e2e8f0;background:#f8fafc;
  color:#0f172a;font:inherit;font-size:13px;cursor:pointer;max-width:100%;text-align:left}
#chat-list .dm-reacts{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
#chat-list .dm-rc{display:inline-flex;align-items:center;gap:4px;border:1px solid #e2e8f0;background:#fff;color:#334155;border-radius:999px;padding:2px 8px;font:inherit;font-size:13px;cursor:pointer;min-height:28px}
#chat-list .dm-rc span{font-size:12px;color:#64748b}
#chat-list .dm-rc.mine{border-color:#e63946;background:#fff1f2}
#chat-list .bubble.me .dm-rc{background:rgba(255,255,255,.95)}
.dm-typing{font-size:13px;color:#64748b;padding:4px 16px 6px;display:flex;align-items:center;gap:7px;font-style:italic}
.dm-typing[hidden],.dm-note[hidden],.dm-replybar[hidden],.dm-mic[hidden]{display:none!important}
.dm-tdots{display:inline-flex;gap:3px}
.dm-tdots i{width:5px;height:5px;border-radius:50%;background:#94a3b8;animation:dmDot 1.2s infinite}
.dm-tdots i:nth-child(2){animation-delay:.15s}.dm-tdots i:nth-child(3){animation-delay:.3s}
@keyframes dmDot{0%,60%,100%{opacity:.3;transform:none}30%{opacity:1;transform:translateY(-2px)}}
.dm-note{font-size:13px;color:#92400e;background:#fffbeb;border-top:1px solid #fde68a;padding:8px 14px;line-height:1.4}
.dm-replybar{display:flex;align-items:center;gap:8px;padding:8px 13px;border-top:1px solid #eef2f7;background:#f8fafc}
.dm-rbtxt{flex:1;min-width:0;border-left:3px solid #e63946;padding-left:9px}
.dm-rbtxt b{display:block;font-size:13px;color:#e63946}
.dm-rbtxt span{display:block;font-size:13px;color:#475569;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dm-rbx{border:0;background:none;font-size:16px;color:#64748b;width:36px;height:36px;cursor:pointer}
.chat-input.dm-recording>*:not(.dm-recbar){display:none!important}
.dm-recbar{display:flex;align-items:center;gap:9px;flex:1;min-width:0}
.dm-recx{width:42px;height:42px;min-width:42px;border-radius:50%;border:1.5px solid #e4eaf2;background:#fff;color:#64748b;font-size:15px;cursor:pointer}
.dm-dot{width:10px;height:10px;border-radius:50%;background:#dc2626;animation:dmRec 1s infinite;flex-shrink:0}
@keyframes dmRec{50%{opacity:.25}}
.dm-rect{font-size:14px;font-weight:700;font-variant-numeric:tabular-nums;color:#0f172a}
.dm-recl{flex:1;min-width:0;font-size:13px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dm-menu{position:fixed;inset:0;z-index:9000}
.dm-mback{position:absolute;inset:0;background:rgba(15,23,42,.35)}
.dm-msheet{position:absolute;left:0;right:0;bottom:0;background:#fff;border-radius:18px 18px 0 0;padding:14px 14px calc(14px + env(safe-area-inset-bottom));
  box-shadow:0 -10px 30px rgba(15,23,42,.2);max-width:520px;margin:0 auto}
.dm-mprev{font-size:13px;color:#475569;padding:0 4px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dm-emo{display:flex;justify-content:space-between;gap:4px;padding:6px 0 10px;border-bottom:1px solid #eef2f7}
.dm-emo button{width:48px;height:48px;border-radius:50%;border:0;background:#f1f5f9;font-size:24px;cursor:pointer}
.dm-emo button.on{background:#ffe4e6;box-shadow:0 0 0 2px #e63946 inset}
.dm-mi{display:block;width:100%;text-align:left;border:0;background:none;padding:13px 6px;font:inherit;font-size:15px;color:#0f172a;cursor:pointer;border-bottom:1px solid #f1f5f9}
.dm-mcancel{text-align:center;color:#64748b;border-bottom:0}
/* the mic makes the input row four controls wide: let the text box shrink so Send stays inside the card on a 360–390 px phone */
#tab-messages .chat-input.dm-has-mic{gap:7px}
#tab-messages .chat-input.dm-has-mic #chat-text{min-width:0;width:0}
/* ── Phone notifications (2026-11-16): the invitation row above the box, the slim line it becomes, and its sheets. ADDED AT THE END;
   every rule above is unchanged. #dmPush only exists once a driver or broker can use notifications (driver-messages.js draws it);
   while it is absent none of these rules matches anything. ── */
#dmPush{border-top:1px solid #eef2f7}
#dmPush+.chat-input{border-top:0}
.dmp-row{margin:10px 13px 0;padding:10px 6px 10px 13px;border-radius:14px;border:1.5px solid #e1e8f0;background:#f5f8fc;display:flex;align-items:center;gap:9px;animation:dmpUp .22s ease-out both}
.dmp-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:13px;font-weight:600;line-height:1.3;color:#0f172a}
.dmp-txt small{font-size:11.5px;font-weight:400;color:#64748b}
.dmp-go{flex:0 0 auto;min-height:42px;padding:0 16px;border-radius:100px;border:0;background:#0f1923;color:#fff;font:inherit;font-size:13.5px;font-weight:700;cursor:pointer;white-space:nowrap}
.dmp-go:active{transform:scale(.97)}
.dmp-x{flex:0 0 34px;width:34px;height:42px;padding:0;border:0;background:none;color:#8b98aa;font-size:22px;line-height:1;cursor:pointer}
.dmp-line{width:calc(100% - 26px);margin:6px 13px 0;min-height:38px;padding:0 4px;border:0;background:none;display:flex;align-items:center;gap:7px;font:inherit;font-size:12px;color:#64748b;cursor:pointer;text-align:left;animation:dmpUp .22s ease-out both}
.dmp-line svg{flex:0 0 auto}
.dmp-line b{font-weight:700;color:#0f172a}
.dmp-line u{margin-left:auto;padding-left:8px;font-weight:700;color:#1d4ed8;text-decoration:none;white-space:nowrap}
.dmp-line.on svg{color:#15803d}
.dmp-line.blocked,.dmp-line.blocked b,.dmp-line.blocked u{color:#92400e}
@keyframes dmpUp{from{transform:translateY(8px);opacity:0}to{transform:none;opacity:1}}
.dmp-sheet{display:flex;flex-direction:column;gap:11px;padding-top:18px}
.dmp-sheet h3{margin:0 0 2px;font-size:15.5px;font-weight:700;line-height:1.3;color:#0f172a}
.dmp-fine{margin:0;font-size:12.5px;line-height:1.4;color:#64748b}
.dmp-steps{margin:0;padding:0;list-style:none;counter-reset:dmp;display:flex;flex-direction:column;gap:9px}
.dmp-steps li{counter-increment:dmp;display:flex;gap:11px;align-items:flex-start;font-size:13.5px;line-height:1.4;color:#0f172a}
.dmp-steps li::before{content:counter(dmp);flex:0 0 24px;width:24px;height:24px;border-radius:50%;background:#0f1923;color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}
.dmp-btn{min-height:48px;padding:0 12px;border-radius:13px;border:1.5px solid #0f1923;background:#0f1923;color:#fff;font:inherit;font-size:14.5px;font-weight:600;cursor:pointer}
.dmp-swrow{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:54px;font-size:14px;font-weight:600;line-height:1.3;color:#0f172a}
.dmp-swrow small{display:block;font-size:11.5px;font-weight:400;color:#64748b}
.dmp-sw{position:relative;flex:0 0 50px;width:50px;height:30px;padding:0;border-radius:100px;border:0;background:#cbd5e1;cursor:pointer;transition:background .18s}
.dmp-sw::after{content:'';position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;transition:transform .18s}
.dmp-sw[aria-checked="true"]{background:#15803d}
.dmp-sw[aria-checked="true"]::after{transform:translateX(20px)}
