/* Studio Chat: WhatsApp-style look (layout, colours, bubbles, type). Own icon and name, so it never gets mixed up with WhatsApp itself. */
:root {
  --bg: #ffffff; --ink: #111b21; --muted: #667781; --line: #e9edef; --hover: #f5f6f6;
  --top: #ffffff; --top-ink: #111b21; --title: #008069; --accent: #008069; --green: #00a884; --badge: #25d366;
  --wall: #efeae2; --wall-dot: rgba(0,0,0,.045); --mine: #d9fdd3; --theirs: #ffffff; --chip: #ffffff; --chip-ink: #54656f;
  --input: #ffffff; --search: #f0f2f5; --fwd: #667781; --mention: #027eb5; --danger: #ea0038; --shadow: 0 1px .5px rgba(11,20,26,.13);
  --sbar: #fff8e1; --menu: #ffffff; --quote: rgba(11,20,26,.05); --chipon: #d8fdd2; --chipon-ink: #008069; --sel: rgba(0,168,132,.18);
  --hit: #fff4a8; --tick: #53bdeb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b141a; --ink: #e9edef; --muted: #8696a0; --line: #222d34; --hover: #202c33;
    --top: #0b141a; --top-ink: #e9edef; --title: #e9edef; --accent: #00a884; --green: #00a884; --badge: #21c063;
    --wall: #0b141a; --wall-dot: rgba(255,255,255,.035); --mine: #005c4b; --theirs: #202c33; --chip: #182229; --chip-ink: #8696a0;
    --input: #202c33; --search: #202c33; --fwd: #8696a0; --mention: #53bdeb; --danger: #f15c6d; --shadow: 0 1px .5px rgba(0,0,0,.25);
    --sbar: #1f2a1c; --menu: #233138; --quote: rgba(0,0,0,.22); --chipon: #0a332c; --chipon-ink: #00a884; --sel: rgba(0,168,132,.22);
    --hit: #5b5418;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* the same fonts WhatsApp uses: the phone's own system font (San Francisco on iPhone, Roboto on Android, Segoe UI on Windows) */
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, "Lucida Grande", Arial, sans-serif; overscroll-behavior: none; }
#app { height: 100dvh; display: flex; flex-direction: column; max-width: 820px; margin: 0 auto; background: var(--bg); position: relative; overflow: hidden; }
button { font: inherit; cursor: pointer; color: inherit; }
[hidden] { display: none !important; }
svg.i { width: 24px; height: 24px; fill: currentColor; display: block; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; outline: none; }
input:focus, textarea:focus { border-color: var(--green); }
.acc { color: var(--accent); } .red { color: var(--danger) !important; }

/* top bars */
.top { background: var(--top); color: var(--top-ink); display: flex; align-items: center; gap: 6px; padding: 8px 6px 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top)); min-height: 60px; position: relative; flex: none; z-index: 4; }
.top h1 { font-size: 22px; margin: 0; flex: 1; font-weight: 700; color: var(--title); letter-spacing: -.2px; }
.top h1.plain { font-size: 19px; font-weight: 500; color: var(--top-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top.chat { padding-left: 2px; gap: 2px; border-bottom: 1px solid var(--line); }
.top .t { flex: 1; min-width: 0; padding-left: 8px; cursor: pointer; }
.top .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .t .gn { font-size: 17px; font-weight: 500; }
.top .sub { font-size: 13px; color: var(--muted); }
#gav { cursor: pointer; }
.ib { background: none; border: 0; padding: 8px; border-radius: 50%; line-height: 0; color: inherit; display: inline-grid; place-items: center; text-decoration: none; }
.ib:active { background: var(--hover); }
/* selection / search bar laid over the chat header */
.selbar { position: absolute; inset: 0; background: var(--top); display: flex; align-items: center; gap: 2px; padding: 0 6px 0 2px; padding-top: env(safe-area-inset-top); color: var(--top-ink); }
.selbar.srch input { flex: 1; border: 0; background: none; padding: 8px 4px; }
.selbar .small { white-space: nowrap; }
.search { margin: 2px 14px 8px; display: flex; align-items: center; gap: 10px; background: var(--search); border-radius: 22px; padding: 0 14px; color: var(--muted); flex: none; }
.search svg.i { width: 20px; height: 20px; }
.search input { border: 0; background: none; padding: 9px 0; border-radius: 0; }
.chips { display: flex; gap: 8px; padding: 0 14px 8px; flex: none; overflow-x: auto; }
.chip { border: 0; background: var(--search); color: var(--muted); border-radius: 18px; padding: 6px 14px; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--chipon); color: var(--chipon-ink); font-weight: 500; }

.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; min-height: 0; overscroll-behavior: contain; }
.empty { color: var(--muted); text-align: center; padding: 40px 24px; font-size: 14px; }

/* chat list */
.row { display: flex; gap: 14px; align-items: center; padding: 0 16px; cursor: pointer; }
.row:active, .row:hover { background: var(--hover); }
.av { width: 50px; height: 50px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 18px; flex: none; position: relative; }
.av svg.i { width: 55%; height: 55%; }
.row .mid { flex: 1; min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row:last-child .mid { border-bottom: 0; }
.row .nm { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row .nm b { font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .nm span { font-size: 12px; color: var(--muted); flex: none; }
.row .nm span.new { color: var(--badge); font-weight: 600; }
.row .pv { color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.row .pv > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; min-width: 0; flex: 1; }
.row .pv .tk { display: inline-block; vertical-align: -4px; margin-right: 2px; }
.row .pv .tk svg.i { width: 18px; height: 18px; color: var(--muted); }
.row .pv .nl { font-weight: 500; color: var(--accent); }
.badge { background: var(--badge); color: #fff; border-radius: 12px; font-size: 12px; font-weight: 600; padding: 2px 7px; min-width: 21px; text-align: center; flex: none; }
.fab { position: absolute; right: 18px; bottom: max(20px, env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 16px; border: 0;
  background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0,0,0,.25); z-index: 3; }

/* chat screen */
.wall { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; background-color: var(--wall);
  background-image: radial-gradient(var(--wall-dot) 1.2px, transparent 1.3px), radial-gradient(var(--wall-dot) 1.2px, transparent 1.3px);
  background-size: 28px 28px; background-position: 0 0, 14px 14px; }
.msgs { padding: 6px 4% 10px; display: flex; flex-direction: column; }
.day { align-self: center; font-size: 12.5px; color: var(--chip-ink); background: var(--chip); border-radius: 8px; padding: 5px 12px; margin: 10px 0 6px; box-shadow: var(--shadow); }
.unread { align-self: stretch; text-align: center; margin: 10px -4%; background: rgba(255,255,255,.35); padding: 4px 0; }
.unread span { display: inline-block; background: var(--chip); color: var(--chip-ink); border-radius: 8px; padding: 4px 12px; font-size: 12.5px; box-shadow: var(--shadow); }
.m { position: relative; max-width: 82%; min-width: 86px; padding: 6px 7px 8px 9px; border-radius: 8px; background: var(--theirs); box-shadow: var(--shadow);
  align-self: flex-start; word-wrap: break-word; overflow-wrap: anywhere; margin-top: 2px; transition: background-color .2s; }
.m.first { margin-top: 10px; border-top-left-radius: 0; }
.m.first::before { content: ""; position: absolute; top: 0; left: -8px; width: 8px; height: 13px; background: inherit; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.m.mine { align-self: flex-end; background: var(--mine); }
.m.mine.first { border-top-left-radius: 8px; border-top-right-radius: 0; }
.m.mine.first::before { left: auto; right: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.m.system { align-self: center; background: var(--chip); color: var(--chip-ink); font-size: 12.5px; text-align: center; min-width: 0; margin: 8px 0; padding: 5px 12px; max-width: 90%; }
.m.system::before { display: none; }
.m.sel { box-shadow: 0 0 0 100vmax var(--sel); clip-path: inset(-6px -100vmax); }
.m.hit .tx { background: var(--hit); }
.m.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 100vmax var(--sel); clip-path: inset(-6px -100vmax); } }
.m .who { font-size: 12.8px; font-weight: 500; margin-bottom: 2px; }
.m .fwd { font-size: 13px; font-style: italic; color: var(--fwd); display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.m .fwd svg.i { width: 15px; height: 15px; }
.m .fwd b { font-style: normal; font-weight: 600; color: var(--ink); opacity: .85; }
.m .tx { white-space: pre-wrap; font-size: 15.5px; line-height: 1.33; }
.m .sp { display: inline-block; width: 62px; height: 1px; }
.m.mine .sp { width: 78px; }
.m.wide .sp { width: 150px; }
.m .tm { position: absolute; right: 7px; bottom: 4px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.m .tm svg.i { width: 16px; height: 16px; color: var(--tick); }
.m .tm .fail svg.i { color: var(--danger); }
.m .tm .tag { color: var(--mention); font-weight: 600; }
.m .tm.onimg { right: 10px; bottom: 8px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); background: linear-gradient(transparent, rgba(0,0,0,.35)); border-radius: 0 0 6px 0; padding: 10px 2px 0 20px; }
.m .tm.onimg svg.i { color: #fff; }
.m .noTx { height: 14px; }
.m .failtxt { color: var(--danger); font-size: 12.5px; margin-top: 4px; cursor: pointer; }
.mention { color: var(--mention); font-weight: 500; }
.m a { color: var(--mention); }
.m .lnk { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 6px 0 2px; display: block; }
/* photos: edge to edge in the bubble like WhatsApp, time drawn on the photo */
.m.media { padding: 3px 3px 8px; }
.m.media .who, .m.media .fwd, .m.media .tx, .m.media .quote, .m.media .fchip, .m.media .vn, .m.media .vt { margin-left: 6px; margin-right: 6px; }
.m.media .who { margin-top: 3px; }
.m.bare { padding-bottom: 3px; }
.phs { width: min(300px, 68vw); }
.phs.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.ph { display: block; position: relative; border: 0; padding: 0; background: rgba(0,0,0,.08); border-radius: 6px; overflow: hidden; width: 100%; }
.phs.one .ph img { width: 100%; max-height: 380px; min-height: 120px; object-fit: cover; display: block; }
.phs.grid .ph { aspect-ratio: 1; } .phs.grid .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .more { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 28px; display: grid; place-items: center; }
.m.media .phs + .tx, .m.media .phs + .fchip { margin-top: 5px; }
.ring { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: conic-gradient(#fff calc(var(--p, 0) * 1%), rgba(255,255,255,.25) 0); -webkit-mask: radial-gradient(circle, transparent 21px, #000 22px); mask: radial-gradient(circle, transparent 21px, #000 22px); }
.ring::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: rgba(0,0,0,.35); z-index: -1; }
.vid { max-width: min(300px, 68vw); border-radius: 6px; display: block; margin-bottom: 4px; }
/* documents */
.fchip { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 6px; background: var(--quote); margin: 0 0 4px; color: var(--ink) !important; text-decoration: none; font-size: 14px; min-width: min(220px, 58vw); }
.fchip > svg.i { color: var(--muted); flex: none; width: 22px; height: 22px; }
.fic { position: relative; flex: none; color: #e9573f; }
.fic svg.i { width: 34px; height: 34px; }
.fic::after { content: attr(data-x); position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font-size: 7.5px; font-weight: 700; color: #fff; }
.fn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fn b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* voice notes: WhatsApp's player (photo with mic, play, bar, length) */
.vn { display: flex; align-items: center; gap: 8px; width: min(260px, 64vw); padding: 2px 0 12px; }
.vav { width: 46px; height: 46px; font-size: 16px; }
.vav .mic { position: absolute; right: -4px; bottom: -2px; color: var(--tick); line-height: 0; }
.vav .mic svg.i { width: 18px; height: 18px; }
.vp { border: 0; background: none; color: var(--muted); padding: 0; line-height: 0; }
.vp svg.i { width: 34px; height: 34px; }
.vbar { flex: 1; position: relative; }
.vr { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; padding: 0; border: 0; border-radius: 2px; background: var(--muted); opacity: .8; margin: 10px 0; }
.vr::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--tick); }
.vr::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--tick); }
.vd { position: absolute; left: 0; top: 22px; font-size: 11px; color: var(--muted); }
.m .vt { font-style: italic; margin: 2px 0 4px; white-space: pre-wrap; font-size: 14px; }
/* quoted message (reply), in the bubble and above the message box */
.quote { display: flex; align-items: stretch; gap: 8px; background: var(--quote); border-left: 4px solid var(--accent); border-radius: 6px; margin: 0 0 4px; overflow: hidden; cursor: pointer; font-size: 13.5px; }
.quote .qt { flex: 1; min-width: 0; padding: 5px 8px 6px 4px; }
.quote .qt b { font-weight: 500; font-size: 12.8px; }
.quote .qt div { color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.quote img { width: 56px; height: 56px; object-fit: cover; flex: none; }
.quote.qin { margin: 6px 6px 0 -8px; cursor: default; }
.quote.qin .ib { align-self: flex-start; color: var(--muted); padding: 4px; }
.quote.qin .ib svg.i { width: 18px; height: 18px; }
/* scroll to newest */
.downb { position: absolute; right: 12px; bottom: 74px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--chip); color: var(--muted);
  box-shadow: 0 1px 4px rgba(0,0,0,.25); display: grid; place-items: center; z-index: 3; }
.downb .badge { position: absolute; top: -8px; left: -6px; }

/* compose */
.compose { display: flex; gap: 6px; align-items: flex-end; padding: 6px 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); flex: none; }
.pill { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--input); border-radius: 24px; box-shadow: var(--shadow); min-height: 48px; padding: 0 4px 0 16px; }
.prow2 { display: flex; align-items: flex-end; }
.pill textarea { border: 0; background: none; resize: none; max-height: 140px; min-height: 48px; padding: 13px 0; border-radius: 0; font-size: 16.5px; line-height: 22px; }
.pill .ib { color: var(--muted); margin-bottom: 4px; padding: 8px 6px; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; }
.round:disabled { opacity: .6; }
.rec { flex: 1; display: flex; align-items: center; gap: 12px; background: var(--input); border-radius: 24px; box-shadow: var(--shadow); min-height: 48px; padding: 0 8px 0 16px; }
.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s ease-in-out infinite; }
.rec .tmr { font-variant-numeric: tabular-nums; }
.rec .small { flex: 1; }
.rec .ib { color: var(--muted); }

/* Studio working banner, LINK banner */
.sbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--sbar); font-size: 13.5px; flex: none; border-bottom: 1px solid var(--line); }
.sbar .st { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; animation: pulse 1.2s ease-in-out infinite; }
.sbar .lnk { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 4px 6px; }
.sbar .lnk.red { color: var(--danger); }
@keyframes pulse { 50% { opacity: .25; } }

/* attach sheet */
.sheetw { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.25); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--menu); border-radius: 18px; margin: 0 10px max(80px, calc(env(safe-area-inset-bottom) + 70px)); padding: 22px 12px 14px; display: flex; justify-content: space-around; width: min(400px, calc(100% - 20px)); box-shadow: 0 4px 20px rgba(0,0,0,.25); animation: up .18s ease-out; }
.sheet button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); width: 86px; }
.sheet button span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* full-screen layers: photo viewer, attach preview */
.ov { position: fixed; inset: 0; z-index: 30; background: #0b141a; color: #e9edef; display: flex; flex-direction: column; outline: none; animation: fade .15s; }
.ovtop { display: flex; align-items: center; gap: 6px; padding: 8px 6px; padding-top: max(8px, env(safe-area-inset-top)); flex: none; }
.ovt { flex: 1; min-width: 0; padding-left: 6px; } .ovt .small { color: #aebac1; }
.ovmain { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px; overflow: hidden; }
.ovmain img, .ovmain video { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.bigdoc { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 30px; }
.bigdoc svg.i { width: 90px; height: 90px; color: #aebac1; } .bigdoc span { color: #aebac1; font-size: 13px; }
.vcount { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: 13px; color: #aebac1; }
.vnav { position: absolute; top: 50%; margin-top: -26px; width: 44px; height: 52px; border: 0; background: rgba(0,0,0,.35); color: #fff; font-size: 34px; line-height: 1; border-radius: 8px; }
.vnav.l { left: 8px; } .vnav.r { right: 8px; }
@media (pointer: coarse) { .vnav { display: none; } }
.apb { flex: none; padding: 0 8px max(8px, env(safe-area-inset-bottom)); }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 10px; }
.th { width: 54px; height: 54px; flex: none; border-radius: 6px; border: 2px solid transparent; background: #202c33; padding: 0; overflow: hidden; color: #aebac1; display: grid; place-items: center; }
.th.on { border-color: var(--green); } .th img { width: 100%; height: 100%; object-fit: cover; }
.th.add { border: 1px dashed #54656f; }
.apc { display: flex; gap: 6px; align-items: flex-end; }
.apc .pill { background: #2a3942; box-shadow: none; } .apc textarea { color: #e9edef; }

/* WhatsApp-style dialog and toast */
.dlgw { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 24px; animation: fade .12s; }
.dlg { background: var(--menu); color: var(--ink); border-radius: 12px; padding: 22px 22px 10px; width: min(340px, 100%); box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.dlg h3 { margin: 0 0 10px; font-size: 18px; font-weight: 500; }
.dlg p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; }
.dlg input { margin: 4px 0 8px; border: 0; border-bottom: 2px solid var(--green); border-radius: 0; background: none; padding: 8px 2px; }
.dlgb { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.tb { background: none; border: 0; color: var(--accent); font-weight: 500; padding: 10px 14px; border-radius: 20px; font-size: 14.5px; }
.tb:active { background: var(--hover); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: #3b4a54; color: #fff;
  padding: 10px 18px; border-radius: 20px; font-size: 14px; z-index: 50; max-width: calc(100% - 40px); text-align: center; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* group info */
.info { background: var(--search); }
.info .card { margin-bottom: 8px; border-bottom: 0; }
.ihead { text-align: center; padding-top: 22px !important; }
.iname { font-size: 22px; font-weight: 500; }
.ih { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.irow { display: flex; align-items: center; gap: 18px; padding: 10px 0; width: 100%; text-align: left; color: var(--ink); }
.irow > svg.i { color: var(--muted); flex: none; }
.irow b { font-weight: 400; font-size: 16px; }
.btnrow { background: none; border: 0; }
.btnrow:active { background: var(--hover); }
.mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-bottom: 8px; }
.mgrid .ph { aspect-ratio: 1; border-radius: 4px; } .mgrid .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info .fchip { min-width: 0; }
.pill2 { font-size: 11px; color: var(--accent); border: 1px solid var(--accent); border-radius: 10px; padding: 1px 7px; white-space: nowrap; }
.pill2.o { color: var(--muted); border-color: var(--line); }

/* forms (login, admin, share) */
.card { background: var(--bg); padding: 16px; margin: 0; border-bottom: 8px solid var(--search); }
.card h2 { margin: 0 0 10px; font-size: 14px; font-weight: 500; color: var(--accent); }
.card label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.btn { background: var(--green); color: #fff; border: 0; border-radius: 22px; padding: 10px 22px; margin-top: 14px; font-weight: 500; }
.btn:disabled { opacity: .5; }
.btn.ghost { background: none; color: var(--accent); border: 1px solid var(--line); }
.btn.danger { background: none; color: var(--danger); border: 1px solid var(--line); }
.btn.sm { padding: 6px 12px; margin: 0; font-size: 13px; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 1em; }
.login { margin: auto; width: min(360px, calc(100% - 32px)); border: 0; text-align: center; }
.login .logo img { width: 84px; height: 84px; border-radius: 22px; }
.login h2 { font-size: 22px; color: var(--title); font-weight: 700; margin: 10px 0 2px; }
.login label, .login input { text-align: left; }
.menu { position: absolute; right: 8px; top: 52px; background: var(--menu); color: var(--ink); border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.22); z-index: 6; min-width: 210px; padding: 6px 0; animation: fade .12s; }
.menu button { display: block; width: 100%; text-align: left; padding: 12px 20px; background: none; border: 0; font-size: 15px; }
.menu button:active, .menu button:hover { background: var(--hover); }
.urow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.urow .n { flex: 1; min-width: 140px; }
.urow.off .n { color: var(--muted); text-decoration: line-through; }
.small { font-size: 12.5px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.check input { width: auto; accent-color: var(--green); }
.prow { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prow:last-child { border-bottom: 0; }
.prow.pick { cursor: pointer; }
.prow.sel { font-weight: 600; color: var(--accent); }
.preview { white-space: pre-wrap; background: var(--wall); border-radius: 8px; padding: 10px; font-size: 13.5px; max-height: 180px; overflow: auto; }
/* @ mention suggestions, above the message box */
.mpop { position: absolute; left: 8px; right: 8px; bottom: 64px; background: var(--menu); border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.2); max-height: 260px; overflow-y: auto; z-index: 5; }
.mpop button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 14px; }
.mpop button:active, .mpop button:hover { background: var(--hover); }
.mpop b { font-weight: 500; }

/* team commands: references, task list */
.m .ref { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.task input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
.task.done b { text-decoration: line-through; opacity: .6; }
#tl label.task { display: flex; flex-direction: row; margin: 0; font-size: 14.5px; color: inherit; }
#tl label.task input { width: 20px; height: 20px; padding: 0; margin: 2px 0 0; border: 0; }
#tl label.task > span { flex: 1; min-width: 0; }

/* computer screens: WhatsApp Web sizes */
@media (pointer: fine) and (min-width: 700px) {
  .m .tx { font-size: 14.2px; } .pill textarea { font-size: 15px; }
  .msgs { padding: 6px 7% 10px; } .m { max-width: 65%; }
}

/* Send to client */
.m .acts { display: flex; gap: 18px; flex-wrap: wrap; padding-right: 64px; }
.m .acts .lnk { display: inline-block; }
.m .s2c { color: var(--accent); }
.s2cst { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); margin: 4px 0 2px; padding-right: 60px; }
.s2cst svg.i { width: 16px; height: 16px; flex: none; }
.s2cst.ok { color: var(--accent); } .s2cst.ok svg.i { color: var(--tick); }
.s2cst.bad { color: var(--danger); }
.ov.page { background: var(--bg); color: var(--ink); }
.ov.page .scroll { flex: 1; }
.s2f { display: flex !important; align-items: center; gap: 10px; padding: 6px 0; color: var(--ink) !important; font-size: 14px !important; }
.s2f input { width: 20px; height: 20px; flex: none; accent-color: var(--green); }
.s2f img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.warn { margin-top: 14px; background: var(--sbar); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }

/* Send to WhatsApp: the arrow beside every message, selection, client mode in the message bar */
.m .wab { position: absolute; top: 50%; margin-top: -15px; right: -40px; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
  background: var(--chip); color: var(--muted); box-shadow: var(--shadow); display: grid; place-items: center; opacity: .85; }
.m.mine .wab { right: auto; left: -40px; }
.m .wab svg.i { width: 17px; height: 17px; }
.m .wab.done { background: var(--green); color: #fff; opacity: 1; }
.m.sel .wab, .m.system .wab { display: none; }
.seln { flex: 1; font-size: 19px; font-weight: 500; padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selbar .wasel { background: var(--green); color: #fff; margin-left: 4px; }
.pill .wat.on { color: var(--green); }
.pill.tocl { box-shadow: 0 0 0 2px var(--green); }
.round.tocl { background: #128c7e; }
.toclbar { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); padding: 8px 4px 0 0; }
.toclbar svg.i { width: 16px; height: 16px; flex: none; }
.toclbar span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toclbar .lnk { background: none; border: 0; color: var(--muted); font-weight: 600; font-size: 12px; padding: 2px 6px; }
.s2item { border-top: 1px solid var(--line); padding: 10px 0 4px; margin-top: 8px; }
.s2item textarea { margin-top: 4px; }
/* the last button row or "sent" line must not sit under the time */
.m .acts:not(:empty):has(+ .tm), .m .s2cst:has(+ .tm) { padding-bottom: 17px; }
