:root {
  --bg: #f3f1ec; --side: #ffffff; --card: #ffffff; --line: #e7e3da; --text: #1c2321; --muted: #6c7672; --hover: #f5f3ee;
  --accent: #0b7a6d; --accent-2: #0e9a88; --accent-soft: #dcefeb; --out: #d6efe9; --in: #ffffff; --chatbg: #ebe6dc;
  --blue: #2f8be0; --bad: #d23f3f; --warn: #c48a00; --shadow: 0 1px 2px rgba(0,0,0,.08); --shadow-lg: 0 12px 40px rgba(0,0,0,.22);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1615; --side: #141c1b; --card: #1b2523; --line: #26312f; --text: #e6ece9; --muted: #8fa09a; --hover: #1c2725;
    --accent: #2fb8a3; --accent-2: #36c9b2; --accent-soft: #173a35; --out: #12443d; --in: #1d2826; --chatbg: #0c1312; --shadow: 0 1px 2px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Bengali", sans-serif; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); }
svg { display: block; }
.grow { flex: 1; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border-radius: 22px; padding: 10px 20px; font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: .6; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.plain { background: var(--line); color: var(--text); }
.btn.danger { background: var(--bad); }
.btn.small { padding: 6px 14px; font-size: 13.5px; }
.btn.wide { width: 100%; padding: 12px; font-size: 16px; }
.link { color: var(--accent); font-weight: 600; }
.icon { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon:hover { background: var(--hover); }
.icon svg, .mi svg { width: 22px; height: 22px; fill: currentColor; }
.icon.sm { width: 32px; height: 32px; }
.icon.sm svg { width: 18px; height: 18px; }
.mi { display: inline-flex; color: var(--muted); }
.field { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); outline: none; }
.field:focus { border-color: var(--accent); }

.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.boot img { width: 72px; }

/* sign in */
.auth { height: 100%; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 26px 22px; text-align: center; }
.auth-logo { width: 64px; height: 64px; }
.auth h1 { margin: 6px 0 2px; font-size: 26px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 8px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.auth form { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.auth label, .auth summary { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.auth summary { display: list-item; cursor: pointer; }
.auth input { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); outline: none; }
.auth input:focus { border-color: var(--accent); }
.err { color: var(--bad); font-size: 14px; margin: 10px 0 0; }
.fine { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.get { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.get b { font-size: 12.5px; color: var(--muted); }
.get div { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* layout */
.app { position: fixed; inset: 0; display: flex; }
.side { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--side); position: relative; }
.chat, .panel { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--chatbg); z-index: 5; }
.panel { background: var(--side); z-index: 8; }
.emptypane { display: none; }
@media (min-width: 900px) {
  .side { width: 380px; flex: none; border-right: 1px solid var(--line); }
  .chat { position: static; flex: 1; min-width: 0; }
  .emptypane { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); background: var(--bg); border-bottom: 6px solid var(--accent); }
  .emptypane img { width: 90px; opacity: .85; }
  .emptypane h2 { color: var(--text); font-weight: 400; font-size: 30px; margin: 10px 0 6px; }
  .chat:not([hidden]) ~ .emptypane { display: none; }
  .panel { left: 0; right: auto; width: 380px; border-right: 1px solid var(--line); }
  .back { display: none; }
}

.bar { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; min-height: 58px; background: var(--side); border-bottom: 1px solid var(--line); flex: none; padding-top: max(8px, env(safe-area-inset-top)); }
.bar.dark { background: rgba(0,0,0,.6); color: #fff; border: 0; }
.bar .title { font-size: 20px; color: var(--accent); margin-left: 4px; }
.conn { font-size: 12px; color: var(--warn); }
.avbtn { flex: none; }
.searchrow { display: flex; align-items: center; gap: 8px; margin: 8px 12px; padding: 0 4px 0 12px; border-radius: 20px; background: var(--bg); }
.searchrow input { flex: 1; border: 0; background: none; padding: 9px 0; outline: none; }
.banner { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; background: var(--accent-soft); font-size: 14px; }
.banner span { flex: 1; }

.tabs { display: flex; border-top: 1px solid var(--line); background: var(--side); padding-bottom: env(safe-area-inset-bottom); flex: none; }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); position: relative; }
.tabs button .mi { padding: 3px 18px; border-radius: 16px; }
.tabs button.on { color: var(--text); }
.tabs button.on .mi { background: var(--accent-soft); color: var(--accent); }
.tabs i { position: absolute; top: 3px; left: calc(50% + 8px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-style: normal; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.tabs i:empty { display: none; }
.tabs i.dot:not(:empty) { min-width: 9px; width: 9px; height: 9px; padding: 0; font-size: 0; top: 6px; left: calc(50% + 12px); }
.fab { position: absolute; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 17px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.fab svg { width: 24px; height: 24px; fill: #fff; }

.list { flex: 1; overflow-y: auto; padding-bottom: 90px; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; width: 100%; text-align: left; position: relative; }
.row:hover, .row.on { background: var(--hover); }
.row .t { flex: 1; min-width: 0; border-bottom: 1px solid var(--line); padding: 4px 0 10px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.row:last-child .t { border-bottom: 0; }
.row .l1, .row .l2 { display: flex; align-items: center; gap: 6px; }
.row .l1 b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .l1 small { color: var(--muted); font-size: 12px; flex: none; }
.row .l1 small.new { color: var(--accent); font-weight: 600; }
.row .l2 { color: var(--muted); font-size: 14px; margin-top: 1px; }
.row .l2 span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .l2 span.typing { color: var(--accent); font-weight: 600; }
.row .badge { background: var(--accent); color: #fff; border-radius: 11px; min-width: 21px; height: 21px; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 6px; flex: none; }
.row .tick { flex: none; }
.row .mi.sm svg { width: 16px; height: 16px; }
.hdr { font-size: 13px; color: var(--accent); font-weight: 600; padding: 14px 16px 6px; }
.empty { color: var(--muted); text-align: center; padding: 40px 24px; font-size: 14px; }
.empty b { color: var(--text); display: block; font-size: 16px; margin-bottom: 4px; }

.av { width: 48px; height: 48px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px; background-size: cover; background-position: center; overflow: hidden; }
.av svg { width: 60%; height: 60%; fill: rgba(255,255,255,.95); }
.av.s { width: 40px; height: 40px; font-size: 15px; }
.av.xs { width: 32px; height: 32px; font-size: 13px; }
.av.l { width: 120px; height: 120px; font-size: 44px; }
.av.ring { box-shadow: 0 0 0 2px var(--side), 0 0 0 4px var(--accent); }
.av.ring.seen { box-shadow: 0 0 0 2px var(--side), 0 0 0 4px var(--line); }

/* chat */
.who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
.who-t { min-width: 0; display: flex; flex-direction: column; }
.who-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-t small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-t small.on { color: var(--accent); }
.msgs { flex: 1; overflow-y: auto; padding: 10px 6% 12px; overscroll-behavior: contain; }
@media (max-width: 600px) { .msgs { padding: 8px 10px 10px; } }
.day { text-align: center; margin: 12px 0 8px; }
.day span { background: var(--card); color: var(--muted); font-size: 12px; padding: 4px 12px; border-radius: 8px; box-shadow: var(--shadow); }
.sysm { text-align: center; margin: 8px auto; max-width: 80%; }
.sysm span { display: inline-block; background: var(--card); color: var(--muted); font-size: 12.5px; padding: 5px 12px; border-radius: 8px; box-shadow: var(--shadow); }
.sysm.e2e span { background: #fdf3d3; color: #6b5a1e; }
@media (prefers-color-scheme: dark) { .sysm.e2e span { background: #3a3218; color: #e6d48c; } }
.m { display: flex; margin: 2px 0; }
.m.out { justify-content: flex-end; }
.m.first { margin-top: 8px; }
.bub { max-width: min(78%, 560px); background: var(--in); border-radius: 10px; padding: 6px 8px 6px 9px; box-shadow: var(--shadow); position: relative; word-wrap: break-word; overflow-wrap: anywhere; user-select: text; }
.m.out .bub { background: var(--out); }
.m.first.in .bub { border-top-left-radius: 2px; }
.m.first.out .bub { border-top-right-radius: 2px; }
.m.sel .bub { outline: 2px solid var(--accent); }
.bub .from { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.bub .tx { white-space: pre-wrap; }
.bub .tx.big { font-size: 34px; line-height: 1.2; }
.bub .meta { float: right; margin: 6px 0 -4px 10px; font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; position: relative; top: 2px; }
.bub .meta svg { width: 16px; height: 16px; }
.tick svg { fill: var(--muted); }
.tick.read svg { fill: var(--blue); }
.tick.failed svg { fill: var(--bad); }
.bub .quote { border-left: 4px solid var(--accent); background: rgba(0,0,0,.05); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; font-size: 13px; cursor: pointer; }
.bub .quote b { color: var(--accent); display: block; font-size: 12.5px; }
.bub .quote span { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bub .fwd { font-size: 12px; color: var(--muted); font-style: italic; }
.bub.revoked .tx { color: var(--muted); font-style: italic; }
.bub .img { display: block; margin: -2px -4px 4px -5px; border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; background: #0002; min-width: 120px; }
.bub .img img, .bub .img .ph { display: block; width: 100%; max-width: 330px; max-height: 360px; object-fit: cover; }
.bub .img .ph { aspect-ratio: 4/3; background-size: cover; background-position: center; filter: blur(2px); }
.bub .img .over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bub .img .over span { background: rgba(0,0,0,.55); color: #fff; border-radius: 22px; padding: 7px 14px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.bub .img .over svg { width: 22px; height: 22px; fill: #fff; }
.bub .img .play { width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.bub .img .play svg { width: 30px; height: 30px; fill: #fff; }
.bub .img .vdur { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 12px; text-shadow: 0 1px 2px #000; }
.bub .file { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.05); border-radius: 8px; padding: 9px 10px; margin-bottom: 3px; min-width: 220px; cursor: pointer; }
.bub .file .fi { width: 36px; height: 42px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; flex: none; }
.bub .file span { flex: 1; min-width: 0; }
.bub .file b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.bub .file small { color: var(--muted); font-size: 12px; }
.bub .file .icon { width: 34px; height: 34px; border: 1.5px solid var(--muted); color: var(--muted); }
.bub .voice { display: flex; align-items: center; gap: 8px; min-width: 230px; padding: 2px 0 2px; }
.bub .voice .pp { width: 36px; height: 36px; border-radius: 50%; color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.bub .voice .pp svg { width: 30px; height: 30px; fill: currentColor; }
.bub .voice .track { flex: 1; height: 26px; display: flex; align-items: center; cursor: pointer; }
.bub .voice .track i { display: block; height: 4px; width: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--line) var(--p, 0%)); }
.bub .voice small { color: var(--muted); font-size: 11.5px; min-width: 34px; }
.bub .voice .av { width: 40px; height: 40px; font-size: 14px; }
.bub .prog { height: 3px; border-radius: 2px; background: var(--line); margin: 4px 0; overflow: hidden; }
.bub .prog i { display: block; height: 100%; background: var(--accent); }
.tobottom { position: absolute; right: 18px; bottom: 80px; width: 42px; height: 42px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; color: var(--muted); z-index: 2; }
.tobottom svg { width: 24px; height: 24px; fill: currentColor; }
@media (min-width: 900px) { .chat { position: relative; } }

.replybar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 0 12px; background: var(--side); }
.replybar > div { flex: 1; min-width: 0; border-left: 4px solid var(--accent); background: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.replybar b { color: var(--accent); display: block; }
.replybar span { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer, .recbar { display: flex; align-items: flex-end; gap: 6px; padding: 7px 8px; background: var(--side); flex: none; padding-bottom: max(7px, env(safe-area-inset-bottom)); }
.composer .inbox { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: var(--bg); border-radius: 22px; padding: 0 2px 0 14px; }
.composer textarea { flex: 1; min-width: 0; border: 0; background: none; outline: none; resize: none; padding: 10px 0; max-height: 140px; line-height: 1.35; }
.sendbtn { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.sendbtn svg { width: 22px; height: 22px; fill: #fff; }
.recbar { align-items: center; }
.recbar b { font-variant-numeric: tabular-nums; }
.recbar .grow { color: var(--muted); font-size: 14px; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.leftbar { padding: 14px; text-align: center; color: var(--muted); background: var(--side); font-size: 14px; }

/* panels */
.pbody { flex: 1; overflow-y: auto; padding-bottom: 30px; }
.sec { background: var(--card); margin: 0 0 8px; padding: 6px 0; }
.sec-h { font-size: 13px; color: var(--accent); font-weight: 600; padding: 10px 16px 4px; }
.prof { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px 16px; text-align: center; background: var(--card); margin-bottom: 8px; }
.prof h2 { margin: 6px 0 0; font-size: 22px; font-weight: 600; }
.prof .ph { color: var(--muted); font-size: 15px; }
.prof .acts { display: flex; gap: 12px; margin-top: 10px; }
.prof .acts button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); font-size: 13px; min-width: 76px; }
.prof .acts svg { width: 22px; height: 22px; fill: var(--accent); }
.avedit { position: relative; cursor: pointer; }
.avedit::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 15.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4zM9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9z'/%3E%3C/svg%3E") center/20px no-repeat; border: 3px solid var(--card); }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; width: 100%; text-align: left; }
.item:hover { background: var(--hover); }
.item > .mi svg { width: 22px; height: 22px; }
.item span.t { flex: 1; min-width: 0; }
.item b { display: block; font-weight: 500; }
.item small { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; }
.item.bad, .item.bad .mi { color: var(--bad); }
.item .role { font-size: 11.5px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 6px; font-weight: 600; }
.item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.switch { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 11px; background: var(--line); position: relative; flex: none; cursor: pointer; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 21px; }
.form { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.form label { font-size: 13px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); border-radius: 16px; padding: 3px 10px 3px 3px; font-size: 13px; }
.chip .av { width: 24px; height: 24px; font-size: 11px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 20px; letter-spacing: 1px; line-height: 1.7; text-align: center; padding: 16px; background: var(--bg); border-radius: 12px; margin: 10px 16px; word-spacing: 6px; }
.note { color: var(--muted); font-size: 13px; padding: 4px 16px 12px; }
.nextfab { position: fixed; right: 20px; bottom: calc(24px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 9; }
.nextfab svg { width: 24px; height: 24px; fill: #fff; }
@media (min-width: 900px) { .nextfab { left: 300px; right: auto; } }

/* status */
.scolors { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 16px; }
.scolors button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.scolors button.on { border-color: var(--text); }
.stext { margin: 10px 16px; min-height: 180px; border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: 20px; }
.stext textarea { width: 100%; background: none; border: 0; outline: none; color: #fff; font-size: 24px; text-align: center; resize: none; }
.stext textarea::placeholder { color: rgba(255,255,255,.7); }
.sview { position: fixed; inset: 0; z-index: 30; background: #000; color: #fff; display: flex; flex-direction: column; }
.sview .bars { display: flex; gap: 3px; padding: 10px 10px 0; padding-top: max(10px, env(safe-area-inset-top)); }
.sview .bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.sview .bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sview .top { display: flex; align-items: center; gap: 10px; padding: 10px 10px; }
.sview .top .icon svg { fill: #fff; }
.sview .top small { color: rgba(255,255,255,.75); display: block; font-size: 12.5px; }
.sview .body { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.sview .body img, .sview .body video { max-width: 100%; max-height: 100%; }
.sview .body .txt { font-size: 28px; padding: 30px; text-align: center; white-space: pre-wrap; word-break: break-word; }
.sview .cap { text-align: center; padding: 12px 16px; background: rgba(0,0,0,.5); }
.sview .tapl, .sview .tapr { position: absolute; top: 0; bottom: 0; width: 35%; }
.sview .tapl { left: 0; } .sview .tapr { right: 0; }
.sview .seen { text-align: center; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); font-size: 14px; }

/* viewer */
.viewer { position: fixed; inset: 0; z-index: 25; background: #000; display: flex; flex-direction: column; color: #fff; }
.viewer .icon svg { fill: #fff; }
.vbody { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; }
.vbody img, .vbody video { max-width: 100%; max-height: 100%; }
.vbody .msg { color: #ccc; }

/* calls */
.callscr, .ringscr { position: fixed; inset: 0; z-index: 40; background: #0e1b19; color: #fff; display: flex; flex-direction: column; }
.callscr .ctop { text-align: center; padding: 18px 16px 6px; padding-top: max(18px, env(safe-area-inset-top)); }
.callscr .ctop b { font-size: 20px; display: block; }
.callscr .ctop small { color: rgba(255,255,255,.75); }
.grid { flex: 1; display: grid; gap: 6px; padding: 6px; grid-auto-rows: 1fr; min-height: 0; }
.tile { position: relative; background: #1d2e2b; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .nm { position: absolute; left: 10px; bottom: 8px; font-size: 13px; text-shadow: 0 1px 3px #000; display: flex; gap: 5px; align-items: center; }
.tile .nm svg { width: 15px; height: 15px; fill: #fff; }
.tile .av { width: 96px; height: 96px; font-size: 36px; }
.tile.talk { box-shadow: inset 0 0 0 3px var(--accent-2); }
.self { position: absolute; right: 14px; bottom: 110px; width: 110px; height: 150px; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 4px 16px rgba(0,0,0,.5); z-index: 2; }
.self video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.self.back video { transform: none; }
.cbtns { display: flex; justify-content: center; gap: 16px; padding: 16px 12px; padding-bottom: max(18px, env(safe-area-inset-bottom)); background: rgba(0,0,0,.3); flex-wrap: wrap; }
.cbtns button { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; }
.cbtns button svg { width: 26px; height: 26px; fill: #fff; }
.cbtns button.off { background: #fff; }
.cbtns button.off svg { fill: #0e1b19; }
.cbtns button.end { background: var(--bad); }
.ringscr { align-items: center; justify-content: space-between; padding: 60px 20px 50px; text-align: center; background: linear-gradient(160deg, #0b5f55, #0e1b19); }
.ringscr .av { width: 120px; height: 120px; font-size: 44px; margin: 0 auto 16px; }
.ringscr b { font-size: 24px; display: block; }
.ringscr small { color: rgba(255,255,255,.8); font-size: 15px; }
.ringbtns { display: flex; gap: 70px; }
.ringbtns button { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ringbtns button svg { width: 30px; height: 30px; fill: #fff; }
.ringbtns .no { background: var(--bad); }
.ringbtns .yes { background: #1fa855; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(31,168,85,.2); } }
.ringbtns small { display: block; margin-top: 8px; }
.callbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--accent); color: #fff; font-size: 14px; cursor: pointer; }

/* menus */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
.sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 20px; z-index: 51; }
.sheet h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.sheet p { color: var(--muted); margin: 4px 0 12px; font-size: 14px; }
.sheet .acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.sheet .field { margin-bottom: 8px; }
.menu { position: fixed; z-index: 52; background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px 0; min-width: 200px; max-width: 280px; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 16px; font-size: 14.5px; }
.menu button:hover { background: var(--hover); }
.menu button svg { width: 20px; height: 20px; fill: var(--muted); }
.menu button.bad { color: var(--bad); }
.menu .emo { display: flex; justify-content: space-around; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #26302e; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); font-size: 14px; }
.attmenu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 6px; }
.attmenu button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.attmenu button span { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.attmenu button svg { width: 26px; height: 26px; fill: #fff; }
.typingdots { display: inline-flex; gap: 3px; }
.tick { display: inline-flex; flex: none; }
.tick svg { width: 17px; height: 17px; }
.row .l2 .tick svg { width: 17px; height: 17px; }
