/* Web Chat — WhatsApp-style messages and composer. Used by the customer chat and the staff Inbox. */
:root {
  --wa-bg: #efeae2;
  --wa-in: #ffffff;
  --wa-out: #d9fdd3;
  --wa-text: #111b21;
  --wa-meta: #667781;
  --wa-green: #00a884;
  --wa-green-dark: #008069;
  --wa-tick: #53bdeb;
  --wa-bar: #f0f2f5;
  --wa-shadow: 0 1px .5px rgba(11, 20, 26, .13);
  --wa-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Segoe UI", Tahoma, serif;
}

.chat-scroll {
  flex: 1; overflow-y: auto; padding: 10px 4% 12px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background-color: var(--wa-bg);
  background-image: radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px);
  background-size: 18px 18px;
}
.chat-list { display: flex; flex-direction: column; gap: 2px; }
.chat-list .day { align-self: center; background: #fff; color: #54656f; font-size: 12.5px; padding: 5px 12px; border-radius: 8px; margin: 10px 0 8px; box-shadow: var(--wa-shadow); }
.chat-list .notice { align-self: center; background: #ffeecd; color: #54656f; font-size: 12.5px; padding: 6px 12px; border-radius: 8px; text-align: center; max-width: 90%; margin: 6px 0; box-shadow: var(--wa-shadow); }

/* Bubbles */
.msg { position: relative; max-width: min(85%, 460px); padding: 6px 8px 8px 9px; border-radius: 7.5px; background: var(--wa-in); color: var(--wa-text); box-shadow: var(--wa-shadow); align-self: flex-start; font-size: 14.2px; line-height: 19px; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--wa-out); }
.msg.first { margin-top: 8px; }
.msg.first::before { content: ""; position: absolute; top: 0; left: -8px; border: 0 solid transparent; border-top: 0; border-right: 8px solid var(--wa-in); border-bottom: 13px solid transparent; }
.msg.me.first::before { left: auto; right: -8px; border-right: 0; border-left: 8px solid var(--wa-out); }
.msg.first { border-top-left-radius: 0; }
.msg.me.first { border-top-left-radius: 7.5px; border-top-right-radius: 0; }
.msg .who { display: flex; align-items: center; gap: 6px; font-size: 12.8px; font-weight: 600; color: var(--wa-green-dark); margin-bottom: 2px; }
.msg .who img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.msg .body { white-space: pre-wrap; }
.chat-link { color: #027eb5; text-decoration: none; overflow-wrap: anywhere; }
.chat-link:hover { text-decoration: underline; }
.lc-link a, .lc-foot a { color: inherit; text-decoration: none; }
.lc-link a:hover, .lc-foot a:hover { text-decoration: underline; }
.msg .body .ur, .msg .ln.ur { font-family: var(--wa-urdu); direction: rtl; text-align: right; line-height: 2; display: block; }
.msg .time { float: right; margin: 6px 0 -4px 10px; font-size: 11px; line-height: 15px; color: var(--wa-meta); white-space: nowrap; }
.msg .time .ticks { color: var(--wa-tick); margin-left: 3px; letter-spacing: -3px; }
.msg::after { content: ""; display: block; clear: both; }
.msg.wide { max-width: min(92%, 400px); width: 100%; }
.msg.media { padding: 3px 3px 5px; }
.msg.media .who, .msg.media .body { padding: 2px 6px 0; }
.msg.media .time { margin-right: 5px; }

/* Photos, video, files */
.chat-img { display: block; width: 100%; max-width: 300px; max-height: 330px; object-fit: cover; border-radius: 6px; cursor: zoom-in; background: #d1d7db; }
.chat-video { display: block; width: 300px; max-width: 100%; max-height: 360px; border-radius: 6px; background: #000; }
.file-chip { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; background: rgba(11, 20, 26, .05); text-decoration: none; color: var(--wa-text); min-width: 210px; }
.file-chip .ext { width: 34px; height: 40px; border-radius: 4px; background: #e2574c; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.file-chip .nm { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .small { font-size: 12px; color: var(--wa-meta); }
.slip-tag { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--wa-green-dark); padding: 2px 4px 4px; }
.slip-tag svg { width: 15px; height: 15px; }
.use-slip { margin: 6px 4px 0; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: grid; place-items: center; z-index: 50; cursor: zoom-out; padding: 12px; }
.lightbox img { max-width: 100%; max-height: 100%; }

/* Voice notes */
.vplayer { display: flex; align-items: center; gap: 8px; min-width: 240px; padding: 2px 0 0; }
.vplayer .face { position: relative; flex: none; }
.vplayer .face img, .vplayer .face span { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #dfe5e7; color: #fff; font-weight: 700; }
.vplayer .face i { position: absolute; right: -3px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--wa-in); display: grid; place-items: center; color: var(--wa-green); font-style: normal; }
.msg.me .vplayer .face i { background: var(--wa-out); }
.vplayer .face i svg { width: 13px; height: 13px; }
.vplayer .play { width: 34px; height: 34px; border: 0; background: none; color: #54656f; display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.vplayer .play svg { width: 24px; height: 24px; }
.vplayer .track { flex: 1; height: 28px; display: flex; align-items: center; cursor: pointer; }
.vplayer .bars { width: 100%; height: 24px; display: flex; align-items: center; gap: 2px; }
.vplayer .bars span { flex: 1; background: #b4bdc2; border-radius: 2px; min-height: 3px; }
.vplayer .bars span.on { background: #00a884; }
.vwrap .len { position: absolute; left: 96px; bottom: 0; font-size: 11px; color: var(--wa-meta); font-variant-numeric: tabular-nums; }
.msg .vwrap { position: relative; padding-bottom: 14px; }
details.transcript summary { cursor: pointer; font-size: 12.5px; color: var(--wa-green-dark); font-weight: 600; margin-top: 2px; }
details.transcript div { font-size: 13.5px; white-space: pre-wrap; margin-top: 4px; }

/* Text cards: payment account and ID package */
.pay-card { margin: 2px -4px 0; border-radius: 6px; overflow: hidden; background: #fff; border: 1px solid #e3e8eb; }
.pay-logo { display: block; width: 100%; height: 84px; object-fit: contain; background: #fff; border-bottom: 1px solid #eef1f3; }
.pay-lines { padding: 8px 10px; font-size: 13.8px; }
.pay-lines .ln { font-weight: 500; }
.pay-lines .ln.head { font-weight: 700; text-align: center; }
.pay-lines .ln.warn { color: #d93025; font-weight: 700; }
.pay-lines .gap { height: 8px; }
.pay-foot { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; padding: 6px 10px; background: #e7fce3; font-size: 12px; font-weight: 600; color: #0b6e4f; }
.pay-note { padding: 6px 10px; font-size: 12px; color: var(--wa-meta); border-top: 1px solid #eef1f3; }
.pkg-lines .ln { min-height: 19px; }
.pkg-lines .ln.head { font-weight: 700; }
.copy { border: 1px solid #d1d7db; background: #fff; border-radius: 6px; font: inherit; font-size: 11px; font-weight: 600; padding: 0 6px; margin-left: 6px; cursor: pointer; color: var(--wa-green-dark); line-height: 18px; vertical-align: 1px; }
.kv { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13.5px; }
.kv span:first-child { color: var(--wa-meta); }
.id-card { border: 1.5px solid #25d366; border-radius: 8px; padding: 8px 10px; background: #f6fff8; margin-top: 4px; display: grid; gap: 4px; }

/* Deposit / withdrawal link card (customer step 3) */
.link-card { margin: 2px -4px 0; border-radius: 12px; overflow: hidden; background: #13234a; color: #fff; border: 2px solid #86e57f; }
.lc-head { display: flex; align-items: center; gap: 10px; background: #86e57f; color: #10213f; padding: 10px 12px; }
.lc-head .lc-ico { width: 40px; height: 40px; border-radius: 50%; background: #13234a; color: #fff; display: grid; place-items: center; flex: none; }
.lc-head .lc-ico svg { width: 22px; height: 22px; }
.lc-head b { display: block; font-size: 17px; line-height: 1.15; }
.lc-head small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.lc-badge { margin-left: auto; background: #13234a; color: #fff; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 4px 9px; white-space: nowrap; text-transform: uppercase; }
.lc-badge::before { content: "● "; color: #86e57f; }
.lc-body { padding: 10px; display: grid; gap: 8px; }
.lc-text { background: #1c2f5c; border: 1px solid #2c4277; border-radius: 10px; padding: 8px 12px; font-family: var(--wa-urdu); direction: rtl; text-align: right; line-height: 2.1; font-size: 14.5px; }
.lc-text em { color: #86e57f; font-style: normal; font-weight: 700; }
.lc-link { display: flex; align-items: center; gap: 8px; background: #1c2f5c; border: 1px solid #2c4277; border-radius: 10px; padding: 8px 12px; }
.lc-link small { display: block; color: #86e57f; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lc-link b { font-size: 15px; overflow-wrap: anywhere; }
.lc-btn { display: flex; align-items: stretch; border-radius: 999px; overflow: hidden; border: 2px solid #86e57f; text-decoration: none; color: #fff; background: #13234a; }
.lc-btn .l { background: #86e57f; color: #13234a; width: 52px; display: grid; place-items: center; flex: none; }
.lc-btn .l svg { width: 24px; height: 24px; }
.lc-btn .m { padding: 7px 12px; flex: 1; min-width: 0; }
.lc-btn .m small { display: block; color: #86e57f; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.lc-btn .m b { font-size: 17px; }
.lc-btn .r { background: #86e57f; color: #13234a; width: 34px; display: grid; place-items: center; font-weight: 800; flex: none; }
.lc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid #2c4277; font-size: 11.5px; color: #86e57f; }
.lc-foot .copy { background: transparent; color: #86e57f; border-color: #3d5b3c; margin: 0; }

/* Composer */
.composer { background: var(--wa-bar); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); position: relative; }
.cmp-row { display: flex; gap: 6px; align-items: flex-end; }
.cmp-pill { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: #fff; border-radius: 24px; padding: 0 4px 0 14px; box-shadow: var(--wa-shadow); }
.cmp-pill textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 15px; line-height: 20px; padding: 11px 0; max-height: 120px; color: var(--wa-text); }
.cmp-pill textarea:focus { outline: 0; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: #54656f; display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.go { width: 46px; height: 46px; background: var(--wa-green); color: #fff; }
.icon-btn:disabled { opacity: .5; cursor: wait; }
.attach-menu { position: absolute; bottom: calc(100% + 4px); right: 60px; background: #fff; border-radius: 14px; box-shadow: 0 8px 28px rgba(11, 20, 26, .2); padding: 6px; display: grid; gap: 2px; z-index: 5; min-width: 210px; }
.attach-menu button { display: flex; gap: 12px; align-items: center; border: 0; background: none; padding: 9px 10px; border-radius: 10px; font: inherit; font-size: 14.5px; cursor: pointer; text-align: left; color: var(--wa-text); }
.attach-menu button:hover { background: var(--wa-bar); }
.attach-menu .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.attach-menu .ico svg { width: 18px; height: 18px; }
.rec-bar { display: flex; align-items: center; gap: 8px; min-height: 46px; background: #fff; border-radius: 24px; padding: 0 4px 0 6px; box-shadow: var(--wa-shadow); }
.rec-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #ea0038; animation: wa-blink 1s infinite; }
.rec-bar .t { font-variant-numeric: tabular-nums; font-size: 15px; }
.rec-bar .grow { flex: 1; font-size: 13px; color: var(--wa-meta); }
@keyframes wa-blink { 50% { opacity: .2; } }
.pending { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 6px 8px; margin-bottom: 6px; box-shadow: var(--wa-shadow); }
.pending img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.pending .grow { flex: 1; min-width: 0; }
.pending .nm { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending .small { font-size: 12px; color: var(--wa-meta); }
.progressbar { height: 3px; background: #d1d7db; border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.progressbar span { display: block; height: 100%; width: 0; background: var(--wa-green); transition: width .2s; }
.cmp-error { color: #d93025; font-size: 13px; padding: 2px 6px 0; }
.cmp-error:empty { display: none; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.chip { flex: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid #c7e9d9; background: #fff; color: var(--wa-green-dark); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.hidden { display: none !important; }
