/* ================= Messages ================= */
.ms { display: flex; background: var(--bg); color: var(--label); height: 100%; position: relative; overflow: hidden; }
.ms-listpane { display: flex; flex-direction: column; flex: 1; min-width: 0; background: var(--bg); }
.ms-lhead { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 6px 16px; } .ms-lhead h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.ms-compose { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--tint); background: var(--fill); transition: transform .12s; } .ms-compose:active { transform: scale(.9); }
.ms-search { margin: 6px 14px 8px; height: 36px; border-radius: 10px; background: var(--fill); display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--label2); } .ms-search input { flex: 1; font-size: 16px; color: var(--label); } .ms-search input::placeholder { color: var(--label2); }
.ms-rows { flex: 1; min-height: 0; overflow: auto; padding: 0 0 20px; }
.ms-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px 9px 6px; text-align: left; position: relative; transition: background .12s; }
.ms-row:active, .ms-row.on { background: var(--fill); } .ms-row::after { content: ""; position: absolute; left: 74px; right: 0; bottom: 0; height: .5px; background: var(--sep); }
.ms-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-left: 2px; } .ms-dot.on { background: var(--tint); }
.ms-av { width: 50px; height: 50px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 19px; text-shadow: 0 1px 2px rgba(0,0,0,.2); } .ms-av.big { width: 48px; height: 48px; font-size: 17px; }
.ms-rb { flex: 1; min-width: 0; } .ms-rt { display: flex; justify-content: space-between; align-items: baseline; } .ms-rt b { font-size: 16.5px; font-weight: 600; } .ms-rt small { font-size: 14px; color: var(--label2); } .ms-rb > small { color: var(--label2); font-size: 14px; }
.ms-rp { font-size: 15px; color: var(--label2); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .ms-rp.u { color: var(--label); font-weight: 500; }
.ms-none { padding: 40px; text-align: center; color: var(--label2); }

.ms-threadpane { position: absolute; inset: 0; z-index: 3; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .42s cubic-bezier(.2,.9,.25,1); }
.ms[data-view="thread"] .ms-threadpane { transform: none; } .ms[data-view="thread"] .ms-listpane { transform: translateX(-22%); transition: transform .42s cubic-bezier(.2,.9,.25,1); } .ms-listpane { transition: transform .42s cubic-bezier(.2,.9,.25,1); }
.ms-thead { position: relative; height: 92px; flex: none; display: flex; align-items: flex-end; justify-content: center; padding: 0 calc(12px + var(--safe-r)) 8px 8px; background: var(--blur-bg); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); border-bottom: .5px solid var(--sep); z-index: 2; }
.ms-back { position: absolute; left: 6px; top: 26px; display: flex; align-items: center; color: var(--tint); font-size: 17px; } .ms-hc { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-right: 0; }
.ms-hn { display: flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 500; } .ms-call { position: absolute; right: calc(16px + var(--safe-r)); bottom: 22px; color: var(--tint); display: none; }
.ms-thread { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.ms-time { align-self: center; font-size: 12px; color: var(--label2); margin: 10px 0 6px; text-align: center; }
.ms-b { position: relative; max-width: 72%; padding: 7px 13px; border-radius: 19px; font-size: 16.5px; line-height: 1.25; word-wrap: break-word; white-space: pre-wrap; animation: msIn .28s cubic-bezier(.2,1.3,.4,1); user-select: text; }
@keyframes msIn { from { opacity: 0; transform: scale(.85) translateY(8px); } }
.ms-b.me { align-self: flex-end; background: linear-gradient(180deg, #2b9bff, #0a7cff); color: #fff; } .ms-b.them { align-self: flex-start; background: var(--fill2); color: var(--label); }
.ms-b.me.tail { margin-bottom: 6px; border-bottom-right-radius: 5px; } .ms-b.them.tail { margin-bottom: 6px; border-bottom-left-radius: 5px; }
.ms-b.emoji { background: none; font-size: 54px; padding: 0 4px; line-height: 1.1; } .ms-b.img { padding: 3px; background: none; } .ms-b.img img { display: block; max-width: 230px; max-height: 250px; border-radius: 17px; } .ms-b.img span { display: block; padding: 6px 10px; }
.ms-tb { position: absolute; top: -13px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-style: normal; font-size: 15px; box-shadow: 0 0 0 2px var(--bg), 0 1px 4px rgba(0,0,0,.2); animation: msIn .3s cubic-bezier(.2,1.6,.4,1); } .ms-tb.l { left: -12px; } .ms-tb.r { right: -12px; }
.ms-b.typing { display: flex; gap: 4px; padding: 13px 15px; } .ms-b.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--label3); animation: msDot 1.2s infinite; } .ms-b.typing i:nth-child(2) { animation-delay: .18s; } .ms-b.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes msDot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.ms-rcpt { align-self: flex-end; font-size: 11.5px; color: var(--label2); margin: -3px 4px 4px; }
.ms-comp { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(10px + var(--safe-b, 0px) * .4); padding-bottom: calc(10px + max(var(--kb, 0px), var(--safe-b, 0px) * .4)); background: var(--bg); transition: padding .3s; }
.ms-plus { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--label2); flex: none; }
.ms-pill { flex: 1; min-height: 36px; border-radius: 19px; border: 1px solid var(--sep); display: flex; align-items: center; padding: 0 4px 0 14px; gap: 6px; } .ms-pill input { flex: 1; font-size: 16.5px; height: 34px; color: var(--label); } .ms-pill input::placeholder { color: var(--label3); }
.ms-send { width: 28px; height: 28px; border-radius: 50%; background: var(--fill2); color: #fff; display: grid; place-items: center; transition: background .2s, transform .15s; flex: none; } .ms-send.on { background: #0a7cff; } .ms-send:active { transform: scale(.88); }
.ms-attach { display: none; position: relative; } .ms-attach.on { display: block; } .ms-attach img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; display: block; } .ms-attach button { position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; border-radius: 50%; background: #555; color: #fff; display: grid; place-items: center; }
.ms-empty { position: absolute; inset: 0; z-index: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--label3); font-size: 18px; font-weight: 500; background: var(--bg); }
.ms-menu { position: absolute; z-index: 30; display: flex; gap: 2px; padding: 6px 8px; border-radius: 26px; background: var(--blur-bg); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); box-shadow: 0 8px 30px rgba(0,0,0,.25), 0 0 0 .5px var(--sep); animation: msIn .25s cubic-bezier(.2,1.4,.4,1); } .ms-menu button { font-size: 22px; width: 40px; height: 38px; border-radius: 19px; transition: transform .12s; } .ms-menu button:hover { transform: scale(1.25); background: var(--fill); }
.ms-picker, .ms-newmsg { position: absolute; left: 0; right: 0; bottom: 0; top: 60px; z-index: 12; background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.3); transform: translateY(105%); transition: transform .42s cubic-bezier(.2,.9,.25,1); display: flex; flex-direction: column; }
.ms-picker.on, .ms-newmsg.on { transform: none; }
.ms-phead { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 17px; border-bottom: .5px solid var(--sep); } .ms-phead button { color: var(--tint); }
.ms-pgrid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 2px; align-content: start; } .ms-pc { aspect-ratio: 1; overflow: hidden; } .ms-pc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-to { padding: 8px 18px; border-bottom: .5px solid var(--sep); } .ms-to input { width: 100%; height: 34px; font-size: 17px; color: var(--label); } .ms-cres { flex: 1; overflow: auto; }

@container win (max-width: 699px) { .ms-call { display: block; } }
@container win (min-width: 700px) {
  .ms-listpane { flex: none; width: 340px; border-right: .5px solid var(--sep); transform: none !important; }
  .ms-threadpane { position: relative; inset: auto; flex: 1; transform: none !important; z-index: 1; }
  .ms-back { display: none; } .ms-call { display: block; }
  .ms:not(.has-thread) .ms-empty { display: flex; z-index: 6; }
  .ms-thead { height: 82px; padding-right: calc(12px + var(--safe-r)); }
  .ms-picker, .ms-newmsg { left: 340px; }
  .ms[data-view="list"] .ms-threadpane { transform: none; }
}
