/* ==========================================================================
   PeerLink — WhatsApp-style UI. Dark theme (default) + light theme.
   Structure mirrors WhatsApp Web: icon rail · chat list · conversation panel
   ========================================================================== */

:root {
  /* ---- dark (default) ---- */
  --bg-app:      #0b141a;
  --bg-panel:    #111b21;
  --bg-header:   #202c33;
  --bg-hover:    #202c33;
  --bg-active:   #2a3942;
  --rail-bg:     #1f2c34;
  --chat-bg:     #0b141a;
  --bubble-in:   #202c33;
  --bubble-out:  #005c4b;
  --bubble-text: #e9edef;
  --accent:      #00a884;
  --accent-rgb:  0,168,132;
  --accent-hi:   #12c08f;
  --accent-lo:   #019875;
  --on-accent:   #07231d;
  --accent-soft: rgba(var(--accent-rgb),.14);
  --text:        #e9edef;
  --text-2:      #8696a0;
  --text-3:      #667781;
  --line:        #222d34;
  --tick:        #53bdeb;
  --danger:      #ea4335;
  --warn-bg:     #182229;
  --warn-border: #2a3942;
  --shadow:      0 8px 30px rgba(0,0,0,.45);
  --wallpaper:   url('/wallpaper-dark.svg');
  --radius:      10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Arial, "Noto Sans Bengali", "Noto Sans", sans-serif;
}

body.light {
  --bg-app:      #efeae2;
  --bg-panel:    #ffffff;
  --bg-header:   #f0f2f5;
  --bg-hover:    #f5f6f6;
  --bg-active:   #f0f2f5;
  --rail-bg:     #f0f2f5;
  --chat-bg:     #efeae2;
  --bubble-in:   #ffffff;
  --bubble-out:  #d9fdd3;
  --bubble-text: #111b21;
  --text:        #111b21;
  --text-2:      #667781;
  --text-3:      #8696a0;
  --line:        #e9edef;
  --tick:        #53bdeb;
  --warn-bg:     #fdf4db;
  --warn-border: #f3e2b3;
  --shadow:      0 6px 24px rgba(11,20,26,.16);
  --wallpaper:   url('/wallpaper-light.svg');
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-app);
  color: var(--text);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--text-3); opacity: .5; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------- splash */
#splash {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: var(--bg-app);
  transition: opacity .45s ease, visibility .45s;
}
#splash.gone { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; padding: 24px; }
.splash-logo {
  width: 92px; height: 92px; margin: 0 auto 20px;
  display: grid; place-items: center; border-radius: 50%; color: var(--accent);
  background: radial-gradient(circle at 50% 40%, var(--accent-soft), transparent 70%);
  box-shadow: 0 0 0 1px var(--accent-soft) inset;
}
.splash-inner h1 { font-size: 28px; font-weight: 600; letter-spacing: .4px; margin: 0 0 8px; }
.splash-inner p { color: var(--text-2); font-size: 13.5px; margin: 0 0 22px; }
.splash-bar { width: 190px; height: 3px; margin: 0 auto; background: var(--bg-header); border-radius: 3px; overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 3px; background: var(--accent); animation: slide 1.15s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }

/* --------------------------------------------------------------- app */
#app { display: flex; height: 100%; }
#app.hidden { display: none; }

/* --------------------------------------------------------- icon rail */
#rail {
  flex: 0 0 64px; width: 64px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 0 12px;
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
}
.rail-btn {
  position: relative; width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: none; color: var(--text-2); display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.rail-btn:hover { background: rgba(134,150,160,.16); color: var(--text); }
.rail-btn.active { color: var(--accent); background: var(--accent-soft); }
.rail-spacer { flex: 1; }
.rail-badge {
  position: absolute; top: 2px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--accent); color: var(--on-accent); border-radius: 10px;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.rail-badge.danger { background: #f15c4b; color: #fff; }
.rail-profile { border: 0; background: none; padding: 4px; border-radius: 50%; }
.rail-profile:hover { background: rgba(134,150,160,.16); }
.rail-profile.active { background: rgba(var(--accent-rgb),.18); box-shadow: inset 0 0 0 2px var(--accent); }

/* ----------------------------------------------------------- sidebar */
#sidebar {
  width: min(430px, 34vw); min-width: 300px;
  display: flex; flex-direction: column;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
}
.side-head {
  height: 60px; flex: 0 0 60px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 20px;
  background: var(--bg-header);
}
.brand { font-size: 22px; font-weight: 700; color: var(--accent); margin: 0; letter-spacing: .2px; flex: 1; }
.side-actions { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  background: none; border: 0; color: var(--text-2);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(134,150,160,.15); color: var(--text); }
.icon-btn:active { background: rgba(134,150,160,.25); }
.fab-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; margin-left: 6px;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .1s, background .15s;
}
.fab-btn:hover { background: #06b489; }
.fab-btn:active { transform: scale(.94); }

.search-wrap { position: relative; padding: 8px 12px; background: var(--bg-panel); }
.search-ico { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); color: var(--text-3); display: grid; }
.search-wrap input {
  width: 100%; height: 38px; padding: 0 12px 0 42px;
  background: var(--bg-header); color: var(--text);
  border: 1px solid transparent; border-radius: 19px; outline: none;
}
.search-wrap input::placeholder { color: var(--text-3); }
.search-wrap input:focus { border-color: var(--accent-soft); }

/* ---- filter chips (All / Unread / Favourites / Online) ---- */
.chips {
  display: flex; gap: 8px; padding: 2px 14px 10px; background: var(--bg-panel);
  overflow-x: auto; overflow-y: hidden;
}
.chips::-webkit-scrollbar { height: 0; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: none; color: var(--text-2);
  padding: 5px 14px; border-radius: 16px; font-size: 13px; transition: background .15s, color .15s;
}
.chip b { font-weight: 700; margin-left: 3px; }
.chip:hover { background: var(--bg-hover); }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.active b { color: inherit; }

.archived-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  color: var(--text-2); cursor: pointer; border-bottom: 1px solid var(--line);
}
.archived-row:hover { background: var(--bg-hover); }
.archived-row b { margin-left: auto; font-size: 12px; color: var(--accent); }

.chat-list, .calls-list, .status-pane { flex: 1; overflow-y: auto; overflow-x: hidden; }
.sec-label {
  padding: 12px 16px 6px; font-size: 12px; letter-spacing: .6px;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.chat-row { display: flex; align-items: center; gap: 13px; padding: 10px 16px; cursor: pointer; transition: background .12s; }
.chat-row:hover { background: var(--bg-hover); }
.chat-row.active { background: var(--bg-active); }
.chat-row .avatar { flex: 0 0 auto; }
.chat-main { flex: 1; min-width: 0; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.chat-row:last-child .chat-main { border-bottom: 0; }
.chat-line1 { display: flex; align-items: baseline; gap: 8px; }
.chat-line1 strong { flex: 1; min-width: 0; font-weight: 500; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-line1 time { font-size: 11.5px; color: var(--text-3); flex: 0 0 auto; }
.pin-ico { color: var(--text-3); display: inline-grid; flex: 0 0 auto; }
.chat-line2 { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--text-2); font-size: 13.5px; }
.chat-line2 .preview { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-line2 .preview.draft { color: var(--accent); }
.chat-line2 .preview.missed { color: #f15c4b; }
.chat-line2 .preview.missed svg { vertical-align: -2px; margin-right: 4px; }
.star-ico { color: var(--text-3); flex: 0 0 auto; display: inline-grid; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center; flex: 0 0 auto;
}
.mini-ticks { color: var(--tick); display: inline-grid; flex: 0 0 auto; }
.mini-ticks.pending { color: var(--text-3); }

/* ---- calls tab ---- */
.call-row { display: flex; align-items: center; gap: 14px; padding: 11px 18px; cursor: pointer; }
.call-row:hover { background: var(--bg-hover); }
.call-row .cr-main { flex: 1; min-width: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.call-row:last-child .cr-main { border-bottom: 0; }
.cr-name { font-size: 15.5px; margin-bottom: 3px; }
.cr-sub { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.cr-sub.missed { color: #f15c4b; }
.cr-actions { color: var(--text-2); display: flex; gap: 2px; }

.side-foot {
  flex: 0 0 34px; height: 34px; display: flex; align-items: center; gap: 7px;
  padding: 0 14px; background: var(--bg-header); color: var(--text-3); font-size: 11.5px;
}
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: #f0b429; }
.conn-dot.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.conn-dot.off { background: var(--danger); }
.mini-btn { background: rgba(134,150,160,.15); color: var(--text-2); border: 0; border-radius: 12px; padding: 4px 11px; font-size: 11.5px; }
.mini-btn:hover { background: rgba(134,150,160,.28); color: var(--text); }
body.light .mini-btn { background: rgba(11,20,26,.06); }
body.light .mini-btn:hover { background: rgba(11,20,26,.12); }
.net-line {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 5px 12px 7px; background: var(--bg-header); color: var(--text-3);
  font-size: 11px; font-family: ui-monospace, Menlo, Consolas, monospace;
  border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden;
}
.net-line span { overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------- chat panel */
#chatPanel { flex: 1; position: relative; display: flex; flex-direction: column; background: var(--chat-bg); }
.empty-state {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 30px;
  background: var(--bg-app); gap: 4px;
}
.empty-logo { color: var(--text-3); margin-bottom: 14px; }
.empty-state h2 { font-weight: 400; font-size: 30px; margin: 0 0 10px; color: var(--text); }
.empty-state p { color: var(--text-2); font-size: 14px; line-height: 1.7; margin: 6px 0; max-width: 540px; }
.empty-state .tiny { font-size: 12.5px; color: var(--text-3); margin-top: 18px; }
.btn-primary {
  margin-top: 16px; background: var(--accent); color: var(--on-accent); font-weight: 600;
  border: 0; border-radius: 22px; padding: 11px 26px; font-size: 14px;
  transition: background .15s, transform .1s;
}
.btn-primary:hover { background: #06b489; }
.btn-primary:active { transform: scale(.97); }
.btn-ghost {
  background: none; border: 0; color: var(--accent); font-weight: 500;
  padding: 10px 16px; border-radius: 18px;
}
.btn-ghost:hover { background: var(--accent-soft); }

#chatView { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head {
  flex: 0 0 60px; height: 60px; display: flex; align-items: center; gap: 10px;
  padding: 0 10px 0 16px; background: var(--bg-header); border-bottom: 1px solid var(--line);
  z-index: 3;
}
.back-btn { display: none; }
.chat-head-txt { flex: 1; min-width: 0; cursor: pointer; }
.chat-head-txt strong { display: block; font-size: 15.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-txt small { display: block; color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-actions { display: flex; gap: 2px; }
#btnVideoCall.disabled { opacity: .45; }
#btnPin.on { color: var(--accent); }

/* ---- end-to-end notice ---- */
.e2e-banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 10px auto 2px; max-width: min(92%, 760px);
  padding: 10px 12px; border-radius: 10px;
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  color: var(--text-2); font-size: 12.8px; line-height: 1.6;
  box-shadow: var(--shadow);
}
.e2e-banner svg { color: var(--text-3); flex: 0 0 auto; margin-top: 2px; }
.e2e-txt b { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; }
.e2e-banner .icon-btn { width: 26px; height: 26px; font-size: 13px; }

/* ------------------------------------------------------------- messages */
.msgs {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px 6% 12px;
  background-color: var(--chat-bg);
  background-image: var(--wallpaper);
  background-size: 440px 440px;
  display: flex; flex-direction: column; gap: 2px;
}
.day-sep { align-self: center; margin: 12px 0; }
.day-sep span {
  background: var(--bg-header); color: var(--text-2); font-size: 12.5px;
  padding: 6px 13px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.14);
}
.sys-note { align-self: center; color: var(--text-3); font-size: 12.5px; text-align: center; margin: 10px 12%; line-height: 1.6; }
.msg { display: flex; margin-bottom: 2px; }
.msg.out { justify-content: flex-end; }
.msg.flash .bubble { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.bubble { max-width: min(78%, 620px);
  background: var(--bubble-in); color: var(--bubble-text);
  border-radius: 8px; padding: 7px 9px 6px;
  box-shadow: 0 1px .5px rgba(11,20,26,.13);
  font-size: 14.5px; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.out .bubble { background: var(--bubble-out); }
.bubble .txt { white-space: pre-wrap; }
.bubble .meta {
  float: right; display: inline-flex; align-items: center; gap: 4px;
  margin: 6px 0 -3px 10px; font-size: 11px; color: var(--text-2);
  position: relative; top: 3px;
}
.bubble .meta .ticks { display: inline-grid; color: var(--text-2); }
.bubble .meta .ticks.read { color: var(--tick); }
/* --- the WhatsApp tail: only on the first bubble of a run -------------- */
.bubble { position: relative; }
.msg:not(.grouped) .bubble::after {
  content: ''; position: absolute; top: 0; width: 0; height: 0;
}
.msg.out:not(.grouped) .bubble::after {
  right: -7px;
  border-bottom: 10px solid var(--bubble-out);
  border-left: 7px solid transparent;
}
.msg.in:not(.grouped) .bubble::after {
  left: -7px;
  border-bottom: 10px solid var(--bubble-in);
  border-right: 7px solid transparent;
}
.msg.out:not(.grouped) .bubble { border-top-right-radius: 0; }
.msg.in:not(.grouped)  .bubble { border-top-left-radius: 0; }
/* consecutive bubbles from the same sender sit tighter together */
.msg.grouped { margin-top: -1px; }
.msg.grouped .bubble { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.typing-bubble .dots { display: inline-flex; gap: 4px; padding: 6px 4px 8px; }
.typing-bubble .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: blink 1.2s infinite; }
.typing-bubble .dots i:nth-child(2) { animation-delay: .18s; }
.typing-bubble .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* ---- call event card (like WhatsApp's "Voice call / Accepted on ...") ---- */
.call-card {
  display: flex; align-items: center; gap: 12px;
  min-width: 230px; padding: 4px 2px 2px;
}
.call-card .cc-ico {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(134,150,160,.18); color: var(--text-2);
  display: grid; place-items: center;
}
.call-card.missed .cc-ico { color: #f15c4b; }
.call-card .cc-body { flex: 1; min-width: 0; }
.call-card .cc-title { font-weight: 500; font-size: 14.5px; margin-bottom: 2px; }
.call-card .cc-sub { color: var(--text-2); font-size: 12.8px; }
.call-card.missed .cc-sub { color: #f15c4b; }

/* ------------------------------------------------------------- composer */
.composer {
  flex: 0 0 auto; display: flex;
  padding: 8px 14px calc(9px + env(safe-area-inset-bottom));
  background: var(--bg-header);
}
.composer-plus { color: var(--text-2); margin-bottom: 3px; }
.composer-pill {
  flex: 1; display: flex; align-items: center; gap: 4px;
  background: var(--bg-panel);
}
body.light .composer-pill { box-shadow: 0 1px 1px rgba(11,20,26,.08); }
.composer-pill input {
  flex: 1; height: 34px; padding: 0 6px; background: none; color: var(--text);
  border: 0; outline: none; font-size: 15px;
}
.composer-pill input::placeholder { color: var(--text-3); }
.send-btn { border-radius: 50%; border: 0; flex: 0 0 auto; display: grid; place-items: center;
  transition: transform .1s, background .15s;
}
.send-btn:hover { background: #06b489; }
.send-btn:active { transform: scale(.92); }
.send-btn .ico-send { display: none; }
.send-btn .ico-mic { display: block; }
.send-btn.text .ico-send { display: block; }
.send-btn.text .ico-mic { display: none; }

/* -------------------------------------------------------------- avatars */
.avatar {
  border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 600; user-select: none;
  background: #6a7175; font-size: 15px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset;
}
.av-32 { width: 34px; height: 34px; font-size: 14px; }
.av-40 { width: 40px; height: 40px; font-size: 15px; }
.av-48 { width: 48px; height: 48px; font-size: 18px; }
.av-64 { width: 64px; height: 64px; font-size: 24px; }
.av-96 { width: 96px; height: 96px; font-size: 34px; }
.av-110 { width: 110px; height: 110px; font-size: 40px; }
.av-130 { width: 132px; height: 132px; font-size: 48px; }

/* --------------------------------------------------------------- calls */
.call-overlay, .incoming-overlay, .modal-overlay { position: fixed; inset: 0; z-index: 120; }
.call-overlay { background: #0b141a; color: #e9edef; display: flex; flex-direction: column; overflow: hidden; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0b141a; z-index: 1; }
.call-audio-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  position: relative; z-index: 10; pointer-events: none; transition: opacity .25s ease;
}
.call-overlay.video.has-remote-video .call-audio-stage { opacity: 0; }
.call-overlay.audio .call-remote { visibility: hidden; width: 1px; height: 1px; }
.call-sub-status {
  font-size: 14.5px; color: #8696a0; font-weight: 500;
  background: rgba(17, 27, 33, 0.65); padding: 4px 14px; border-radius: 999px;
}
.audio-rings::before, .audio-rings::after {
  content: ""; position: absolute; inset: -18px; border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb),.5); animation: pulse 2.2s ease-out infinite;
}
.audio-rings::after { animation-delay: 1.1s; }
@keyframes pulse { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }
.call-audio-stage .avatar { position: relative; }
.call-audio-name { font-size: 25px; font-weight: 600; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.call-top {
  position: absolute; top: 0; left: 0; right: 0; padding: 16px 20px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
  background: linear-gradient(rgba(11,20,26,.82), transparent); z-index: 25;
}
.call-win-actions {
  position: absolute; top: 14px; right: 16px; display: flex; gap: 8px; pointer-events: auto;
}
.call-win-btn {
  background: rgba(32,44,51,.85); backdrop-filter: blur(8px);
  color: #e9edef; border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: background .15s, transform .12s;
}
.call-win-btn:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-1px); }
.call-pill {
  background: rgba(32,44,51,.78); backdrop-filter: blur(6px);
  border-radius: 20px; padding: 7px 16px; font-size: 13.5px; color: #e9edef;
  display: flex; gap: 8px; align-items: center; pointer-events: auto;
}
.dot-sep { color: #8696a0; }
.call-route {
  font-size: 11.5px; color: #8696a0; font-family: ui-monospace, Menlo, Consolas, monospace;
  background: rgba(32,44,51,.55); border-radius: 12px; padding: 4px 10px; max-width: 92vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.call-local {
  position: absolute; right: 18px; bottom: 118px; width: 148px; height: 200px;
  border-radius: 14px; object-fit: cover; background: #111b21;
  box-shadow: 0 10px 30px rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.18);
  transform: scaleX(-1); z-index: 22; cursor: grab; touch-action: none;
}
.call-local:active { cursor: grabbing; }
.call-controls {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px;
  margin: auto auto calc(18px + env(safe-area-inset-bottom)) auto;
  padding: 12px 18px; max-width: 95vw;
  background: rgba(24, 34, 41, 0.9); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 36px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  position: relative; z-index: 30;
}
.call-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: #2a3942; color: #e9edef; display: grid; place-items: center;
  transition: background .15s, transform .1s; flex: 0 0 auto; cursor: pointer;
}
.call-btn:hover { background: #37454c; }
.call-btn:active { transform: scale(.94); }
.call-btn.on { background: #e9edef; color: #0b141a; }
.call-btn.end { background: #ea4335; color: #fff; width: 58px; height: 58px; box-shadow: 0 4px 16px rgba(234,67,53,.5); }
.call-btn.end:hover { background: #d33426; }
.call-btn.accept { background: var(--accent); color: #fff; }
.call-btn.accept:hover { background: #06b489; }
.call-btn.big { width: 62px; height: 62px; }

.incoming-overlay { place-items: center; color: #e9edef; }
.incoming-card { text-align: center; }
.incoming-card .avatar { margin-bottom: 10px; position: relative; }
.in-name { font-size: 27px; font-weight: 500; }
.in-sub { color: #8696a0; font-size: 14.5px; margin-bottom: 34px; }
.in-actions { display: flex; gap: 70px; }

/* --------------------------------------------------------------- modal */
.modal-overlay { background: rgba(11,20,26,.72); display: grid; place-items: center; padding: 18px; }
.modal {
  background: var(--bg-panel); color: var(--text); border-radius: 12px;
  box-shadow: var(--shadow); width: min(460px, 96vw); max-height: 86vh; overflow: auto;
  padding: 22px 24px; animation: pop .16s ease-out;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 { margin: 0 0 16px; font-size: 17.5px; font-weight: 600; }
.modal label { display: block; font-size: 12.5px; color: var(--text-2); margin: 14px 0 6px; }
.modal input {
  width: 100%; height: 42px; padding: 0 12px; background: var(--bg-header);
  color: var(--text); border: 1px solid transparent; border-radius: 8px; outline: none;
}
.modal input:focus { border-color: var(--accent); }
.modal .row { display: flex; gap: 10px; align-items: center; }
.modal .hint { color: var(--text-2); font-size: 12.5px; line-height: 1.7; margin-top: 8px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal-list { margin: 4px 0 0; }
.modal-item { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.modal-item:hover { background: var(--bg-header); }
.modal-item .mi-main { flex: 1; min-width: 0; }
.modal-item strong { display: block; font-weight: 500; }
.modal-item small { color: var(--text-2); font-size: 12.5px; display: block; }
.code-box { display: flex; gap: 8px; align-items: center; background: var(--bg-header); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.code-box code { flex: 1; overflow-wrap: anywhere; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; }
.presence-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.presence-dot.online { background: #31a24c; box-shadow: 0 0 0 2px rgba(49,162,76,.2); }
.theme-row { display: flex; gap: 10px; margin-top: 10px; }
.theme-pick {
  flex: 1; border: 1px solid var(--line); background: none; color: var(--text);
  border-radius: 10px; padding: 12px; text-align: center; font-size: 13.5px;
}
.theme-pick.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* -------------------------------------------------------------- toasts */
.toasts {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: #233138; color: #e9edef; font-size: 13.5px;
  padding: 11px 18px; border-radius: 8px; box-shadow: var(--shadow);
  animation: toastIn .2s ease-out; max-width: 88vw;
}
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --------------------------------------------------------- mobile tabs */
.mobile-tabs { display: none; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 860px) {
  #rail { display: none; }
  #app { flex-direction: column; }
  #sidebar { min-width: 0; border-right: 0; width: 100%; flex: 1 1 auto; min-height: 0; }
  #chatPanel { position: fixed; inset: 0; background: var(--chat-bg); transform: translateX(100%); transition: transform .22s ease; z-index: 40; }
  body.chat-open #chatPanel { transform: translateX(0); }
  body.chat-open #mobileTabs { display: none; }
  .back-btn { display: grid; }
  /* #mobileTabs is a sibling of #app, so "below it" means below the viewport:
     pin it to the bottom of the screen and let the chat list end above it */
  .mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    flex: 0 0 56px; height: 56px; background: var(--bg-header);
    border-top: 1px solid var(--line); z-index: 50;
  }
  body:not(.auth-open) #app { padding-bottom: 56px; }
  .toasts { bottom: 70px; }            /* clear of the bottom tab bar */
  .rail-foot, #sidebar footer { padding-bottom: 4px; }
  .mobile-tabs button {
    flex: 1; background: none; border: 0; color: var(--text-3);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px;
  }
  .mobile-tabs button.active { color: var(--accent); }
  .call-local { width: 110px; height: 150px; bottom: 120px; right: 12px; }
  .empty-state h2 { font-size: 23px; }
  .msgs { background-size: 340px 340px; }
  .brand { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Groups · media · status   (added with the group-chat release)
   ========================================================================== */

/* ---- group avatars: rounded square with a group glyph, like WhatsApp ---- */
.avatar.grp { border-radius: 22%; position: relative; }
.avatar.grp .grp-initials {
  position: absolute; bottom: 2%; right: 4%;
  font-size: .42em; font-weight: 600; letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}
.sender { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }

/* ---- media bubbles ---- */
.bubble .media-image {
  position: relative; margin: -1px -3px 4px; border-radius: 7px; overflow: hidden;
  max-width: min(330px, 62vw); background: rgba(0,0,0,.18); min-height: 60px;
}
.bubble .media-image img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.bubble .media-image.uploading img { opacity: .55; filter: blur(1px); }
.media-spinner {
  position: absolute; inset: auto 8px 8px auto; background: rgba(11,20,26,.72); color: #e9edef;
  font-size: 11.5px; padding: 3px 9px; border-radius: 10px;
}
.voice.playing .v-play { background: var(--accent); color: var(--on-accent); }
.v-bars { flex: 1; display: flex; align-items: center; gap: 2px; height: 26px; }
.v-bars i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--text-2); opacity: .55; height: 6px; }
.v-bars i.done { background: var(--accent); opacity: .95; }
.v-time { font-size: 11.5px; color: var(--text-2); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.file-row {
  display: flex; align-items: center; gap: 11px; min-width: 220px;
  padding: 8px 10px; margin: 1px 0 4px; border-radius: 8px;
  background: rgba(134,150,160,.14); cursor: pointer;
}
.file-row:hover { background: rgba(134,150,160,.22); }
.f-ico { color: var(--text-2); display: grid; flex: 0 0 auto; }
.f-body { flex: 1; min-width: 0; }
.f-body b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-body small { color: var(--text-2); font-size: 12px; }
.f-dl { color: var(--text-2); display: grid; flex: 0 0 auto; }

/* ---- recorder bar (replaces the composer while recording) ---- */
.rec-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px calc(11px + env(safe-area-inset-bottom));
  background: var(--bg-header); color: var(--text);
  font-size: 14px;
}
.composer.recording { display: none !important; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #f15c4b; animation: recPulse 1.1s infinite; }
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-hint { color: var(--text-2); flex: 1; }
.rec-send { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(5,10,13,.96); display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 8px; }
.lb-bar { position: absolute; top: 14px; right: 16px; display: flex; gap: 6px; }
.lb-bar .icon-btn { color: #e9edef; background: rgba(32,44,51,.7); }

/* ---- status tab ---- */
.status-pane { flex: 1; overflow-y: auto; }
.status-row { display: flex; align-items: center; gap: 14px; padding: 11px 18px; cursor: pointer; }
.status-row:hover { background: var(--bg-hover); }
.status-row .sr-main { flex: 1; min-width: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.status-row:last-child .sr-main { border-bottom: 0; }
.sr-name { display: block; font-size: 15.5px; margin-bottom: 3px; color: var(--text); }
.sr-sub { display: block; color: var(--text-2); font-size: 13px; }
.status-ring {
  width: 52px; height: 52px; border-radius: 50%; padding: 2.5px; flex: 0 0 auto;
  background: conic-gradient(var(--accent) 0 100%, var(--line) 0);
  display: grid; place-items: center;
}
.status-ring.seen { background: conic-gradient(var(--text-3) 0 100%, var(--line) 0); }
.status-ring .avatar { width: 46px; height: 46px; font-size: 17px; }
.status-ring.mine { background: none; position: relative; }
.status-ring.mine::after {
  content: '+'; position: absolute; right: 0; bottom: 0;
  width: 19px; height: 19px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-size: 14px; font-weight: 700; display: grid; place-items: center; line-height: 1;
}
.status-viewer { position: fixed; inset: 0; z-index: 160; background: #05090c; display: flex; flex-direction: column; }
.sv-bars { display: flex; gap: 4px; padding: 12px 14px 6px; }
.sv-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(233,237,239,.3); overflow: hidden; }
.sv-bars i.done { background: #e9edef; }
.sv-bars i.active::after { content: ''; display: block; height: 100%; background: #e9edef; animation: svFill 5s linear forwards; }
@keyframes svFill { from { width: 0; } to { width: 100%; } }
.sv-head { display: flex; align-items: center; gap: 11px; padding: 6px 14px 12px; color: #e9edef; }
.sv-who { flex: 1; min-width: 0; }
.sv-who b { display: block; font-size: 15px; font-weight: 500; }
.sv-who small { color: #8696a0; font-size: 12.5px; }
.sv-head .icon-btn { color: #e9edef; }
.sv-body { flex: 1; display: grid; place-items: center; padding: 0 22px 40px; text-align: center; }
.sv-text { font-size: 26px; line-height: 1.5; color: #fff; max-width: 720px; padding: 34px; border-radius: 14px; }
.sv-body img { max-width: min(92vw, 900px); max-height: 74vh; border-radius: 10px; }
.sv-caption { position: absolute; bottom: 46px; left: 0; right: 0; text-align: center; color: #e9edef; font-size: 15px; padding: 0 20px; }
.status-compose { display: flex; flex-direction: column; gap: 12px; }
.sc-preview {
  min-height: 130px; border-radius: 10px; display: grid; place-items: center;
  padding: 18px; color: #fff; text-align: center; font-size: 19px; line-height: 1.45;
}
.sc-bgs { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-bg { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.sc-bg.active { border-color: var(--text); }
.mi-ico { font-size: 22px; width: 30px; text-align: center; }

/* ---- member picker (new group / add members) ---- */
.picker-search { margin-bottom: 6px; }
.member-pick { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.member-pick:hover { background: var(--bg-header); }
.member-pick .mp-name { flex: 1; min-width: 0; }
.member-pick .mp-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--text-3);
  display: grid; place-items: center; color: transparent; flex: 0 0 auto;
}
.member-pick.selected .mp-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.chip-sm {
  background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 14px;
  padding: 4px 10px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px;
}

/* ---- boot failure card (never show a blank page) ---- */
.boot-error {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: var(--bg); padding: 22px;
}
.be-card {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 26px 22px; max-width: 430px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.be-ico { color: #f0b429; display: inline-grid; place-items: center; margin-bottom: 10px; }
.be-card h2 { font-size: 18px; margin: 0 0 8px; }
.be-card p { color: var(--text-2); font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.be-detail { font-size: 12.5px !important; }
.be-detail code { font-family: ui-monospace, monospace; color: var(--text-3, #8696a0); word-break: break-all; }

/* --------------------------------------------------------------------------
   The signed-out front door. Layout follows WhatsApp Web's home page: brand
   top-left, a promo strip, one tall card (text + wizard left, art right) and
   the small print underneath. The front door is always light, like theirs —
   the theme you pick inside the app does not repaint it.
   -------------------------------------------------------------------------- */
body.auth-open {
  --bg-app: #f7f5f3; --bg-panel: #ffffff; --bg-header: #f0f2f5; --bg-hover: #f5f6f6;
  --bg-active: #f0f2f5; --chat-bg: #f7f5f3; --text: #111b21; --text-2: #667781;
  --text-3: #8696a0; --line: #e7e3de;
  --bubble-text: #111b21; --shadow: 0 4px 14px rgba(11,20,26,.06);
}
body.auth-open #app, body.auth-open #splash, body.auth-open #mobileTabs, body.auth-open .mobile-tabs { display: none !important; }

.auth-screen {
  position: fixed; inset: 0; z-index: 220; overflow: auto;
  background: #f7f5f3; color: #111b21; padding: 22px 20px 40px;
}
.auth-page { width: min(1120px, 100%); margin: 0 auto; }

.auth-top { display: flex; align-items: center; gap: 10px; padding: 4px 2px 22px; }
.auth-mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.auth-x { margin-left: auto; }

/* promo strip — the "Download WhatsApp" slot */
.promo-card {
  display: flex; align-items: center; gap: 22px; padding: 16px 22px; margin-bottom: 18px; border-radius: 16px;
}
.promo-art { flex: 0 0 auto; display: grid; place-items: center; }
.promo-copy { flex: 1 1 auto; min-width: 0; }
.promo-copy h2 { margin: 0 0 4px; font-size: 17px; }
.promo-copy p { margin: 0; color: #667781; font-size: 13.5px; line-height: 1.5; }
.promo-btn { flex: 0 0 auto; }

/* the main card */
.auth-card {
  padding: 26px 30px 22px;
}
.auth-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 34px; align-items: start; }
.auth-two > * { min-width: 0; }
.auth-col h1 { margin: 0 0 6px; }
.auth-col .sub { color: #667781; font-size: 15px; line-height: 1.6; margin: 0 0 20px; max-width: 52ch; }

.auth-art { width: 100%; max-width: 268px; justify-self: end; }
.auth-art .a-panel { fill: #ffffff; }
.auth-art .a-fill { fill: var(--accent); }
.auth-art .a-soft { fill: rgba(var(--accent-rgb),.10); }
.auth-art .a-line { fill: none; stroke: rgba(17,27,33,.16); stroke-width: 2; }
.auth-art .a-dot { fill: rgba(17,27,33,.28); }
.promo-art .a-fill { fill: var(--accent); }
.promo-art .a-soft { fill: rgba(var(--accent-rgb),.14); }
.promo-art .a-line { fill: none; stroke: rgba(17,27,33,.2); stroke-width: 2; }
.promo-art .a-dot { fill: rgba(17,27,33,.3); }

/* numbered steps (1 · 2 · 3 · 4) with the live progress state */
.auth-steps { list-style: none; padding: 0; margin: 0 0 4px; display: grid; }
.as-pill { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: #667781; }
.as-pill i {
  flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: #667781; font-size: 12.5px; font-style: normal;
}
.as-pill.active { color: #111b21; }
.as-pill.done i { color: #fff; }
.as-pill.done i::before { content: '✓'; }
.as-pill.done i { font-size: 0; }
.as-pill.done i::before { font-size: 13px; }
.as-pill span { min-width: 0; }

.link-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  color: var(--accent); font: inherit; font-size: 13.5px; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent-lo); }
#authHelp { margin: 12px 0 16px; }

/* wizard panes sit inside the left column */
.auth-col .auth-body h3 { font-size: 16px; margin: 0 0 8px; }
.auth-switch { display: flex; justify-content: flex-end; margin-top: 14px; }
.auth-card .code-input { background: #f7f5f3; border: 1px solid #d6d2cc; color: #111b21; }
.auth-card .demo-code { background: rgba(240,180,41,.12); border-color: rgba(240,180,41,.4); color: #8a6400; }
.auth-card .demo-code code { color: #6b4c00; }
.auth-card .auth-alert.err { color: #b3261e; background: rgba(241,92,75,.1); }
.auth-card input, .auth-card .prefixed, .auth-card .country-pick { background: #f7f5f3; border: 1px solid #d6d2cc; color: #111b21; }
.auth-card .country-pick { background: #f7f5f3; }
.auth-card .hint, .auth-card .sub { color: #667781; }

.auth-secure {
  display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; margin: 18px 0 8px; text-align: center;
}
.auth-legal { display: flex; align-items: center; justify-content: center; gap: 8px; color: #8696a0; font-size: 13px; margin: 0; }
.auth-legal .hero-dev { color: #667781; text-decoration: none; }
.auth-legal .hero-dev:hover { color: var(--accent); text-decoration: underline; }

.legal-card { width: min(620px, 100%); }
.legal-card { background: #ffffff; border: 1px solid #e7e3de; }
.legal-card h2 { color: #111b21; }
.legal-card .icon-btn { color: #667781; }
.legal-body { overflow: auto; color: #3b4a54; font-size: 14px; line-height: 1.65; }
.legal-body b, .legal-body strong { color: #111b21; }
.legal-body code { background: #f0f2f5; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.legal-body h3 { font-size: 14px; margin: 16px 0 6px; color: var(--accent); }
.legal-body p { margin: 0 0 10px; }
.legal-body ul { margin: 0 0 10px; padding-left: 20px; }
.legal-body li { margin-bottom: 5px; }

@media (max-width: 900px) {
  .auth-screen { padding: 16px 14px 90px; }
  .auth-card { padding: 22px 18px 18px; border-radius: 14px; }
  .auth-two { grid-template-columns: 1fr; gap: 18px; }
  .auth-art { display: none; }                      /* the art is decoration — the form comes first */
  .promo-card { flex-wrap: wrap; gap: 14px; padding: 16px; }
  .promo-copy { flex: 1 1 55%; }
  .promo-btn { width: 100%; }
  .promo-art { display: none; }
  .auth-top { padding-bottom: 14px; }
}
@media (max-width: 560px) {
  .auth-steps { font-size: 13px; }
  .auth-col h1 { font-size: 20px; }
  .auth-legal { flex-wrap: wrap; }
}


.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }


.auth-grid .field.span2 { grid-column: span 2; }


.field { display: flex; flex-direction: column; gap: 6px; }


.auth-body h3 { font-size: 16px; margin: 4px 0 8px; }


.prefixed { display: flex; align-items: center; background: var(--bg-header); border-radius: 8px; padding-left: 10px; color: var(--text-2); }


.prefixed input { background: transparent; border: 0; padding-left: 4px; }


.phone-row { display: flex; gap: 8px; }


.phone-row input { flex: 1; }


.country-pick {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 12px;
  background: var(--bg-header); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; font-size: 14px; min-width: 104px;
}


.country-pick:hover { border-color: var(--accent); }


.flag-badge {
  display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px;
  border-radius: 6px; background: rgba(134,150,160,.18); color: var(--text-2);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px;
}


#auFlag.flag-badge { background: var(--accent-soft); color: var(--accent); }


.auth-alert { display: none; margin: 12px 0 0; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; }


.auth-alert.show { display: block; }


.auth-alert.err { background: rgba(241,92,75,.14); color: #ff9a8b; border: 1px solid rgba(241,92,75,.35); }


.auth-alert.ok { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(var(--accent-rgb),.35); }


.auth-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }


.auth-actions .btn-primary { margin-left: auto; }


.auth-note { margin-top: 12px; }


.code-row { display: flex; gap: 10px; align-items: center; }


.code-input {
  flex: 1; font-size: 24px; letter-spacing: 10px; text-align: center;
  font-variant-numeric: tabular-nums; height: 54px;
}


.demo-code {
  margin-top: 12px; padding: 10px 12px; border-radius: 9px; font-size: 13px;
  background: rgba(240,180,41,.12); border: 1px solid rgba(240,180,41,.35); color: #f0b429;
}


.demo-code code { font-size: 16px; letter-spacing: 2px; color: #ffd166; }


.demo-code span { display: block; margin-top: 4px; color: var(--text-2); }


.strength { display: flex; gap: 5px; margin-top: 12px; }


.strength i { flex: 1; height: 4px; border-radius: 3px; background: rgba(134,150,160,.25); }


.strength.s1 i:nth-child(-n+1) { background: #f15c4b; }


.strength.s2 i:nth-child(-n+2) { background: #f0b429; }


.strength.s3 i:nth-child(-n+3) { background: #7ec86a; }


.strength.s4 i { background: var(--accent); }

.country-overlay { position: fixed; inset: 0; z-index: 240; background: rgba(5,10,13,.72); display: grid; place-items: center; padding: 20px; }
.country-card {
  width: min(520px, 100%); max-height: 82vh; display: flex; flex-direction: column;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
}
.country-card header { display: flex; align-items: center; margin-bottom: 12px; }
.country-card header h2 { font-size: 16px; margin: 0; }
.country-card header .icon-btn { margin-left: auto; }
.country-list { overflow: auto; margin-top: 10px; }
.country-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 9px; cursor: pointer;
}
.country-item:hover, .country-item.active { background: var(--bg-header); }
.country-item .ci-name { flex: 1; font-size: 14px; }
.country-item .ci-dial { color: var(--text-2); font-variant-numeric: tabular-nums; }
.country-item.active .ci-dial { color: var(--accent); }

/* account card used in settings + the profile tab */
.account-card { background: var(--bg-header); border-radius: 12px; padding: 14px; margin: 4px 0 10px; }
.account-card .ac-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 0; color: var(--text-2); }
.account-card .ac-row b { color: var(--text); font-weight: 500; }
.badge-verified { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 11px; }
.badge-warn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #f0b429; background: rgba(240,180,41,.14); padding: 2px 8px; border-radius: 11px; }
.retention { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.retention b { color: var(--text); }

/* people search (find anyone by phone / username / e-mail) */
.search-hit { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.search-hit:hover { background: var(--bg-header); }
.search-hit .sh-main { flex: 1; min-width: 0; }
.search-hit .sh-name { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.search-hit .sh-sub { color: var(--text-2); font-size: 12.5px; }
.search-hit .sh-acts { display: flex; gap: 4px; }

/* sidebar account strip + people-search hint + profile pane */
.side-account { padding: 4px 12px 8px; }
.side-acc-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.side-acc-row:hover { background: var(--bg-header); }
.side-acc-row .sa-main { min-width: 0; flex: 1; }
.side-acc-row .sa-main b { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-acc-row .sa-main small { color: var(--text-2); font-size: 12px; }
.side-acc-row .sa-more { color: var(--text-2); }
.search-hint {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 12px 0; padding: 8px 11px; border-radius: 9px; font-size: 13px;
  background: var(--accent-soft); color: var(--accent);
}
.search-hint b { color: var(--text); }
.search-hint .mini-btn { background: var(--accent); color: var(--on-accent); }
.profile-pane { flex: 1; overflow-y: auto; padding: 4px 14px 14px; }
.profile-pane .account-card { background: var(--bg-header); }

/* ==========================================================================
   Social round — verified badge, online dots, profile drawer, stories,
   blocks & reports, business accounts
   ========================================================================== */

/* ---- blue verified tick (business accounts) ---- */
.tick-blue { flex: 0 0 auto; vertical-align: -2px; margin-left: 4px; }
.chat-line1 .tick-blue { width: 15px; height: 15px; }
.chat-head-txt .tick-blue { width: 16px; height: 16px; }

/* ---- online dot on avatars ---- */
.avatar { position: relative; overflow: visible; }
.avatar .av-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.online-dot {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px;
  border-radius: 50%; background: #31a24c; border: 2px solid var(--bg-panel);
}
.avatar.av-48 .online-dot { width: 13px; height: 13px; }
.avatar.av-96 .online-dot { width: 18px; height: 18px; border-width: 3px; }
.dot-on {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #31a24c; margin-right: 5px; vertical-align: 1px;
}
.biz-label { color: var(--accent); font-weight: 500; }

/* ---- contact info drawer ---- */
.contact-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100%;
  background: var(--bg-panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 30;
  box-shadow: -8px 0 24px rgba(0,0,0,.18);
}
.contact-drawer.hidden { display: none; }
.cd-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-header); min-height: 60px;
}
.cd-head > span { flex: 1; font-weight: 500; font-size: 16px; }
.cd-body { flex: 1; overflow: auto; padding: 18px 0 30px; }
.cd-photo { text-align: center; padding: 8px 0 14px; }
.cd-photo .avatar { margin: 0 auto; font-size: 34px; }
.cd-name { text-align: center; font-size: 21px; font-weight: 500; padding: 6px 24px 2px; }
.cd-sub { text-align: center; color: var(--muted); font-size: 13.5px; padding-bottom: 16px; }
.cd-card {
  background: var(--bg-hover); border-radius: 12px; margin: 0 16px 16px; padding: 14px 16px;
}
.cd-card h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.cd-about { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
.cd-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 14px; }
.cd-row .cd-ico { width: 20px; text-align: center; opacity: .8; }
.cd-row .cd-k { color: var(--muted); min-width: 74px; }
.cd-row .cd-v { flex: 1; word-break: break-word; }
.cd-open-now { color: #31a24c; font-weight: 600; }
.cd-shut { color: #f15c4b; font-weight: 600; }
.cd-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 0 8px 6px;
  border-radius: 10px; color: var(--accent); text-decoration: none; font-size: 14.5px;
}
.cd-link:hover { background: var(--bg-hover); }
.cd-link small { color: var(--muted); }
.cd-action {
  display: flex; align-items: center; gap: 14px; padding: 13px 20px; cursor: pointer; font-size: 15px;
}
.cd-action:hover { background: var(--bg-hover); }
.cd-action.danger { color: #f15c4b; }
.cd-action .cd-ico { width: 22px; text-align: center; }
.cd-sep { height: 1px; background: var(--line); margin: 12px 0; }
.cd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cd-chip {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  border-radius: 999px; padding: 4px 11px; font-size: 12.5px; cursor: pointer;
}
.cd-chip:hover { background: var(--bg-hover); }
.cd-empty { color: var(--muted); font-size: 13.5px; }

/* ---- profile editor ---- */
.link-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.link-row input { flex: 1; }
.link-row .link-label { max-width: 130px; }
.link-row .mini-btn { flex: 0 0 auto; }
.biz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.biz-grid .full { grid-column: 1 / -1; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.switch { position: relative; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; background: var(--bg-active); border-radius: 999px; transition: .18s; pointer-events: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: .18s;
}
.switch input:checked + .track { background: #31a24c; }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ---- settings list (profile pane) ---- */
.set-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px 14px; }
.set-head .sh-main { min-width: 0; }
.set-head b { display: block; font-size: 18px; font-weight: 500; }
.set-head small { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-row {
  display: flex; align-items: center; gap: 16px; padding: 13px 18px; cursor: pointer;
}
.set-row:hover { background: var(--bg-hover); }
.set-row .sr-ico { width: 26px; height: 26px; display: grid; place-items: center; opacity: .85; }
.set-row .sr-main { flex: 1; min-width: 0; }
.set-row b { display: block; font-weight: 500; font-size: 15.5px; }
.set-row small { color: var(--muted); font-size: 12.8px; display: block; }
.set-row.danger b { color: #f15c4b; }
.pane-title {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-header);
  font-weight: 500; font-size: 17px; margin: -18px -18px 12px; border-bottom: 1px solid var(--line);
}
.badge-verified-2 {
  display: inline-flex; align-items: center; gap: 4px; background: rgba(29,161,242,.14); color: #1da1f2;
  border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600;
}
.blocked-tag { color: #f15c4b; font-weight: 500; }

/* ---- stories: multiple items per person ---- */
.status-row .sr-thumb { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; }
.story-items { padding: 6px 16px 14px; }
.story-items .si-head { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }
.story-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg-hover); margin-bottom: 6px;
}
.story-item .si-prev {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center;
  color: #fff; font-size: 11px; overflow: hidden;
}
.story-item .si-prev img { width: 100%; height: 100%; object-fit: cover; }
.story-item .si-main { flex: 1; min-width: 0; font-size: 13.5px; }
.story-item .si-main small { display: block; color: var(--muted); font-size: 12px; }
.sv-actions { position: absolute; bottom: 26px; left: 0; right: 0; display: flex; gap: 10px; justify-content: center; }
.sv-actions .mini-btn { background: rgba(0,0,0,.45); color: #fff; border-color: rgba(255,255,255,.25); }
.sv-seen { position: absolute; bottom: 78px; left: 0; right: 0; text-align: center; color: #e9edef; font-size: 13px; }

/* ---- frozen screen ---- */
.frozen-screen {
  position: fixed; inset: 0; z-index: 220; padding: 20px;
  align-items: center; justify-content: center; display: flex;
  background: rgba(11,20,26,.88); backdrop-filter: blur(4px);
}
.frozen-screen.hidden { display: none; }
.fz-card {
  background: var(--bg-panel); border-radius: 16px; padding: 30px 30px 22px; max-width: 430px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.fz-ico { font-size: 44px; }
.fz-card h2 { margin: 10px 0 6px; font-size: 20px; }

/* wallpaper off + chat text size (Chats settings) */
body.no-wall .msgs { background-image: none; }
.msgs .txt, .msgs .bubble { font-size: var(--chat-font, 15px); }


/* ---- business profile extras (image-4 parity) ---- */
.biz-banner {
  margin: -2px -4px 10px; padding: 9px 12px; border-radius: 10px; text-align: center;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-lo));
}
.biz-note { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.biz-map { margin-top: 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); height: 158px; background: var(--bg-hover); }
.biz-map iframe { width: 100%; height: 158px; border: 0; display: block; }
.biz-price { color: var(--accent); font-weight: 600; margin-left: 6px; }
.cd-mini-link { color: var(--accent); text-decoration: none; font-size: 12.5px; }
.cd-mini-link:hover { text-decoration: underline; }
.cd-action.muted { color: var(--muted); cursor: default; }
.link-row .prod-name { flex: 1.2; }
.link-row .prod-price { flex: .7; }
.link-row .prod-note { flex: 1.4; }

/* ==========================================================================
   Round 4b — the modern front door. Same layout as before (brand · promo ·
   card · footer), but with depth: gradient buttons that lift, soft focus
   rings, an animated backdrop, a numbered stepper with connector lines and
   a gentle entrance. Everything is scoped to the signed-out screen, so the
   app itself keeps its flat WhatsApp look.
   ========================================================================== */

/* --- animated backdrop: two aurora washes + a faint dot grid --------------- */
body.auth-open { background: #f4f6f5; }
body.auth-open .auth-screen::before,
body.auth-open .auth-screen::after { content: ''; position: fixed; inset: 0; pointer-events: none; }
body.auth-open .auth-screen::before {
  z-index: 0;
  background:
    radial-gradient(760px 420px at 8% -10%, rgba(var(--accent-rgb),.22), transparent 62%),
    radial-gradient(820px 460px at 96% 4%, rgba(64,120,255,.13), transparent 60%),
    radial-gradient(680px 520px at 58% 112%, rgba(var(--accent-rgb),.14), transparent 62%);
  animation: aurora 18s ease-in-out infinite alternate;
}
body.auth-open .auth-screen::after {
  z-index: 0; opacity: .55;
  background-image: radial-gradient(rgba(17,27,33,.09) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(900px 520px at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(900px 520px at 50% 0%, #000 30%, transparent 78%);
}
@keyframes aurora { from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); } to { transform: translate3d(1.5%, 1.5%, 0) scale(1.06); } }
.auth-page { position: relative; z-index: 1; }

/* --- brand: gradient wordmark, ringed logo -------------------------------- */
.auth-mark {
  background: linear-gradient(140deg, var(--accent-hi) 0%, var(--accent) 55%, var(--accent-lo) 100%);
  box-shadow: 0 8px 18px -8px rgba(var(--accent-rgb),.75), inset 0 1px 0 rgba(255,255,255,.25);
}
.auth-top b {
  font-size: 20px; font-weight: 750; letter-spacing: -.02em;
  background: linear-gradient(94deg, var(--accent-lo) 0%, var(--accent) 45%, #0b9fc4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-x {
  width: 36px; height: 36px; border-radius: 50%; color: #667781;
  transition: background .18s ease, transform .18s ease, color .18s ease;
}
.auth-x:hover { background: rgba(17,27,33,.06); color: #111b21; transform: rotate(90deg); }

/* --- entrance ------------------------------------------------------------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.auth-top   { animation: riseIn .45s cubic-bezier(.22,.9,.35,1) both; }
.promo-card { animation: riseIn .5s .06s cubic-bezier(.22,.9,.35,1) both; }
.auth-card  { animation: riseIn .55s .12s cubic-bezier(.22,.9,.35,1) both; }
.auth-secure{ animation: riseIn .5s .2s  cubic-bezier(.22,.9,.35,1) both; }
.auth-legal { animation: riseIn .5s .26s cubic-bezier(.22,.9,.35,1) both; }

/* --- promo strip: glassy, with a gradient icon tile ----------------------- */
.promo-card {
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  border: 1px solid rgba(17,27,33,.07);
  box-shadow: 0 1px 2px rgba(11,20,26,.04), 0 14px 34px -22px rgba(11,20,26,.35);
  backdrop-filter: blur(6px);
}
.promo-tile {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(140deg, rgba(var(--accent-rgb),.18), rgba(11,159,196,.10));
  border: 1px solid rgba(var(--accent-rgb),.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.promo-copy h2 { font-weight: 700; letter-spacing: -.01em; }

/* --- the main card -------------------------------------------------------- */
.auth-card {
  position: relative; overflow: hidden;
  border: 1px solid rgba(17,27,33,.07); border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdfd 100%);
  box-shadow: 0 1px 3px rgba(11,20,26,.05), 0 28px 60px -34px rgba(11,20,26,.45);
}
.auth-card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hi) 32%, #4f9dff 100%);
}
.auth-kicker {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 4px 11px;
  border-radius: 999px; font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-lo); background: rgba(var(--accent-rgb),.10); border: 1px solid rgba(var(--accent-rgb),.22);
}
.auth-kicker::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.16); }
.auth-col h1 { font-size: 31px; font-weight: 750; letter-spacing: -.028em; }

/* --- the stepper: gradient circles, connector line, tick animation -------- */
.auth-steps { position: relative; gap: 10px; }
.as-pill { position: relative; }
.as-pill:not(:last-child)::after {
  content: ''; position: absolute; left: 13px; top: 27px; width: 2px; height: 9px;
  background: rgba(17,27,33,.12); border-radius: 2px; transition: background .25s ease;
}
.as-pill.done:not(:last-child)::after { background: linear-gradient(var(--accent), rgba(var(--accent-rgb),.35)); }
.as-pill i {
  width: 27px; height: 27px; border: 1.5px solid rgba(17,27,33,.16); font-weight: 700;
  transition: transform .2s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.as-pill.active i {
  border-color: transparent; color: #fff;
  background: linear-gradient(140deg, var(--accent-hi), var(--accent));
  box-shadow: 0 6px 14px -6px rgba(var(--accent-rgb),.8), 0 0 0 4px rgba(var(--accent-rgb),.14);
  transform: scale(1.06);
}
.as-pill.done i { background: linear-gradient(140deg, var(--accent-hi), var(--accent)); border-color: transparent; box-shadow: 0 4px 10px -5px rgba(var(--accent-rgb),.7); }
.as-pill.active span, .as-pill.done span { color: #111b21; font-weight: 600; }

/* --- buttons: gradient, lift, sheen -------------------------------------- */
.auth-screen .btn-primary, .auth-screen .promo-btn {
  position: relative; overflow: hidden; gap: 8px;
  padding: 13px 22px; border: 0; border-radius: 999px; font-size: 14.5px; font-weight: 700;
  color: #fff; letter-spacing: .01em; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-hi) 0%, var(--accent) 52%, var(--accent-lo) 100%);
  box-shadow: 0 10px 22px -10px rgba(var(--accent-rgb),.75), inset 0 1px 0 rgba(255,255,255,.28);
  transition: transform .16s cubic-bezier(.22,.9,.35,1), box-shadow .22s ease, filter .2s ease;
}
.auth-screen .btn-primary:hover, .auth-screen .promo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(var(--accent-rgb),.8), inset 0 1px 0 rgba(255,255,255,.35);
  filter: saturate(1.06);
}
.auth-screen .btn-primary:active, .auth-screen .promo-btn:active { transform: translateY(0) scale(.985); }
.auth-screen .btn-primary:focus-visible, .auth-screen .promo-btn:focus-visible,
.auth-screen .btn-ghost:focus-visible, .auth-screen .link-btn:focus-visible,
.auth-screen input:focus-visible, .auth-screen .country-pick:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb),.35); outline-offset: 2px;
}
.auth-screen .btn-primary svg, .auth-screen .promo-btn svg { transition: transform .2s cubic-bezier(.22,.9,.35,1); }
.auth-screen .btn-primary:hover svg, .auth-screen .promo-btn:hover svg { transform: translateX(3px); }
.auth-screen .btn-primary::after, .auth-screen .promo-btn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 24%, rgba(255,255,255,.34) 48%, transparent 72%);
  transform: translateX(-130%); transition: transform .65s cubic-bezier(.3,.7,.3,1);
}
.auth-screen .btn-primary:hover::after, .auth-screen .promo-btn:hover::after { transform: translateX(130%); }
.auth-screen .btn-primary > span, .auth-screen .promo-btn > span { position: relative; z-index: 1; }

/* ghost buttons inside the wizard */
.auth-screen .btn-ghost {
  border-radius: 999px; padding: 11px 18px; font-weight: 600; color: #3b4a54;
  border: 1.5px solid rgba(17,27,33,.14); background: #fff; transition: background .18s ease, border-color .18s ease, transform .16s ease;
}
.auth-screen .btn-ghost:hover { background: #f7f8f8; border-color: rgba(17,27,33,.22); transform: translateY(-1px); }

/* --- inputs: soft wells with a coloured focus ring ------------------------ */
.auth-screen input, .auth-screen .prefixed, .auth-screen .country-pick {
  border-radius: 12px; border: 1.5px solid rgba(17,27,33,.12); background: #fafbfa;
  padding: 11px 13px; font-size: 14.5px; color: #111b21;
  transition: border-color .16s ease, box-shadow .18s ease, background .16s ease;
}
.auth-screen input::placeholder { color: #96a2ab; }
.auth-screen input:focus {
  background: #fff; border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.14);
}
.auth-screen .prefixed:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.14); }
.auth-screen .prefixed input { border: 0; background: transparent; padding-left: 2px; box-shadow: none !important; }
.auth-screen .country-pick { border-radius: 12px; background: #fafbfa; padding: 0 12px; }
.auth-screen .country-pick:hover { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.10); }
.auth-screen .flag-badge { border-radius: 8px; }
.field label { font-size: 12.5px; font-weight: 650; color: #3b4a54; letter-spacing: .01em; }
.auth-screen .hint { color: #7a8a93; font-size: 12px; }
.auth-screen .code-input { border-radius: 14px; font-weight: 700; }

/* --- illustration: slow float -------------------------------------------- */
.auth-art svg { animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* --- footer --------------------------------------------------------------- */
.auth-secure { color: #5b6b74; }
.auth-legal .link-btn { text-decoration-color: rgba(var(--accent-rgb),.45); }
.legal-card { border-radius: 20px; box-shadow: 0 30px 70px -30px rgba(11,20,26,.55); }
.legal-card::before {
  content: ''; display: block; height: 3px; margin: -18px -18px 14px; border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--accent), #4f9dff);
}

@media (max-width: 900px) {
  .auth-col h1 { font-size: 24px; }
  .auth-kicker { margin-bottom: 8px; }
  .promo-tile { width: 46px; height: 46px; }
}

/* --- the three doors on the first pane --------------------------------- */
.choose-grid { display: grid; gap: 12px; margin: 4px 0 6px; }
.choose-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 15px 16px; border-radius: 16px; cursor: pointer;
  background: #fafbfa; border: 1.5px solid rgba(17,27,33,.10);
  transition: transform .16s cubic-bezier(.22,.9,.35,1), border-color .18s ease, box-shadow .2s ease, background .18s ease;
}
.choose-card:hover:not(:disabled) {
  transform: translateY(-2px); background: #fff; border-color: rgba(var(--accent-rgb),.55);
  box-shadow: 0 14px 26px -18px rgba(11,20,26,.5), 0 0 0 4px rgba(var(--accent-rgb),.08);
}
.choose-card:active:not(:disabled) { transform: translateY(0) scale(.99); }
.choose-card:disabled { opacity: .55; cursor: not-allowed; }
.choose-ico {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  color: #018f74; background: linear-gradient(140deg, rgba(var(--accent-rgb),.16), rgba(79,157,255,.10));
  border: 1px solid rgba(var(--accent-rgb),.22);
}
.choose-card:hover:not(:disabled) .choose-ico { color: #fff; background: linear-gradient(140deg, var(--accent-hi), var(--accent)); border-color: transparent; }
.choose-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choose-txt b { font-size: 15.5px; letter-spacing: -.01em; }
.choose-txt small { color: #667781; font-size: 12.5px; line-height: 1.45; }
.auth-back { margin-right: 12px; vertical-align: middle; }
.auth-back svg { vertical-align: -2px; }
@media (max-width: 560px) { .choose-card { padding: 13px 13px; gap: 12px; } .choose-txt b { font-size: 14.5px; } }

/* ---- P2P Mesh Group Call Grid (0% Server Bandwidth) ---- */
.group-call-grid {
  position: absolute;
  inset: 72px 16px 102px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
  z-index: 2;
}
.group-call-grid.hidden { display: none; }
.group-peer-tile {
  position: relative;
  background: rgba(17, 27, 33, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.group-peer-tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.group-peer-tile .gp-avatar-wrap {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.group-peer-tile.has-video .gp-avatar-wrap {
  display: none;
}
.group-peer-tile .gp-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.group-peer-tile .gp-route {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  background: rgba(var(--accent-rgb), 0.25);
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  color: #7df3d1;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
@media (max-width: 640px) {
  .group-call-grid {
    inset: 64px 10px 96px 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
  }
}

/* ---- In-Call Floating Reactions & Raise Hand ---- */
.call-reaction-bar {
  position: absolute;
  bottom: 94px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 8px;
  background: rgba(11, 20, 26, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 10px;
  border-radius: 999px;
}
.call-react-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 50%;
  transition: transform 0.15s ease, background 0.15s ease;
}
.call-react-btn:hover {
  transform: scale(1.22);
  background: rgba(255, 255, 255, 0.14);
}
.call-floating-reactions {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 7;
}
.floating-emoji-item {
  position: absolute;
  bottom: 135px;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(11, 20, 26, 0.65);
  padding: 4px 12px;
  border-radius: 999px;
  animation: floatUpEmoji 3.2s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes floatUpEmoji {
  0% { opacity: 0; transform: translateY(20px) scale(0.75); }
  15% { opacity: 1; transform: translateY(0) scale(1.05); }
  80% { opacity: 1; transform: translateY(-180px) scale(1); }
  100% { opacity: 0; transform: translateY(-240px) scale(0.9); }
}

/* ---- Polls, Location, Contact Card, View Once & Circular Video Note ---- */
.poll-card {
  min-width: 220px;
  max-width: 310px;
  padding: 4px 2px;
}
.poll-q {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 8px;
}
.poll-opt {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  padding: 7px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  overflow: hidden;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
body.light .poll-opt { border-color: rgba(17, 27, 33, 0.15); }
.poll-opt.voted { border-color: var(--accent); font-weight: 600; }
.poll-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(var(--accent-rgb), 0.22);
  z-index: 0;
  transition: width 0.22s ease;
}
.poll-opt span { position: relative; z-index: 1; }
.loc-card, .contact-share-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 8px 11px;
  margin-bottom: 4px;
  text-decoration: none;
  color: inherit;
}
body.light .loc-card, body.light .contact-share-card { background: rgba(0, 0, 0, 0.06); }
.view-once-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
}
.view-once-pill.opened {
  opacity: 0.6;
  cursor: default;
  background: rgba(128, 128, 128, 0.15);
  border-color: transparent;
}
.video-note-circle {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  display: block;
  margin: 4px auto;
  background: #000;
}
.v-speed {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  cursor: pointer;
  margin-left: 4px;
}

/* ---- Modern Mobile & Web Attachment Grid (WhatsApp / Telegram Style) ---- */
.att-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0 8px;
}
.att-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: center;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.att-tile:hover, .att-tile:active {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.att-tile .att-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}
.att-tile strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.att-tile small {
  font-size: 10px;
  color: var(--text-2);
  line-height: 1.1;
}

/* ---- In-Chat Music Player, P2P File Card, Event Card & Code Snippet Card ---- */
.music-player-card, .p2p-file-card, .event-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 5px;
  min-width: 235px;
  max-width: 315px;
}
body.light .music-player-card, body.light .p2p-file-card, body.light .event-card {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}
.code-snippet-card {
  background: #0b141a;
  color: #e9edef;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 5px;
  min-width: 240px;
  max-width: 330px;
}
.code-snippet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  font-weight: 700;
}
.code-snippet-pre {
  margin: 0;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}
.p2p-progress-bar {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.p2p-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
}

/* ---- Call Waiting Banner ---- */
.call-waiting-banner {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(17, 27, 33, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 14px;
  padding: 10px 14px;
  width: min(92vw, 400px);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* ---- Drag & Drop Highlight & Mobile Bottom-Sheet Polish ---- */
#chatView.drop-active {
  outline: 3px dashed var(--accent);
  outline-offset: -8px;
}
@media (max-width: 640px) {
  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-overlay .modal {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    overflow-y: auto;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .call-controls {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    max-width: 96vw;
  }
}

/* ==========================================================================
   WhatsApp Web & Mobile Complete Design Upgrade (image-1.png — image-5.png)
   ========================================================================== */

/* ---- 1. Left Rail AI Ring, Status/Channel Dots & Filter '+' Chip (image-1.png) ---- */
.rail-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--rail-bg);
}
.ai-ring-btn {
  margin-top: 2px;
}
.ai-ring-orb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #00d2ff, #3a7bd5, #8e2de2, #ff0080, #00e676, #00d2ff);
  position: relative;
  display: inline-block;
  box-shadow: 0 0 10px rgba(58, 123, 213, 0.35);
}
.ai-ring-orb::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--rail-bg);
}
.chip-plus {
  padding: 4px 11px;
  font-weight: 700;
  font-size: 14px;
}
.mention-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

/* ---- 2. Floating Top-Right Incoming Call Card (image-1.png) ---- */
.incoming-overlay {
  position: fixed;
  inset: auto;
  top: 18px;
  right: 22px;
  z-index: 195;
  background: transparent !important;
  backdrop-filter: none !important;
  display: block;
  pointer-events: auto;
}
.incoming-card {
  position: relative;
  width: 286px;
  background: #1f2428;
  color: #f1f5f8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 20px 18px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: pop .18s ease-out;
}
.in-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: 0;
  color: #9aa5ad;
  font-size: 15px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.in-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.incoming-card .in-name {
  font-size: 19px;
  font-weight: 600;
  color: #ffffff;
  margin-top: 2px;
}
.incoming-card .in-sub {
  font-size: 12.5px;
  color: #9aa5ad;
  margin-bottom: 12px;
}
.in-preview-box {
  width: 100%;
  height: 132px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #2d3840 0%, #151c21 100%);
  display: grid;
  place-items: center;
  position: relative;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.in-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.incoming-card .in-actions {
  display: flex;
  justify-content: center;
  gap: 52px;
  width: 100%;
}
.in-act-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.in-act-col .call-btn.big {
  width: 54px;
  height: 54px;
}
.in-act-lbl {
  font-size: 12px;
  color: #cfd7dc;
  font-weight: 500;
}
@media (max-width: 640px) {
  .incoming-overlay {
    top: 12px;
    right: 50%;
    transform: translateX(50%);
  }
  .incoming-card {
    width: min(320px, 94vw);
  }
}

/* ---- 3. Group Voice Chat ("Hop on a Voice Chat") Mini Pill & Bottom Sheet (image-2.png) ---- */
.vc-mini-pill {
  align-self: center;
  margin: 4px auto 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
  z-index: 15;
  max-width: 92%;
}
.vc-mini-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-header);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
}
.vc-mini-btn.muted {
  background: rgba(241, 92, 109, 0.16);
  color: #f15c6d;
}
.vc-mini-btn.leave {
  color: #ea4335;
  font-size: 16px;
}
.vc-mini-avatars {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 0 4px;
}
.vc-mini-peer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}
.vc-mini-peer .avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
  border: 2px solid var(--bg-panel);
}
.vc-mini-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 7px;
}
.vc-mini-wave i {
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent);
  animation: vcWave 0.9s ease-in-out infinite;
}
.vc-mini-wave i:nth-child(2) { animation-delay: 0.2s; }
.vc-mini-wave i:nth-child(3) { animation-delay: 0.4s; }
@keyframes vcWave {
  0%, 100% { height: 3px; }
  50% { height: 7px; }
}

.vc-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 20, 26, 0.46);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 38;
  animation: fadeIn .16s ease-out;
}
.vc-sheet-card {
  background: var(--bg-panel);
  color: var(--text);
  border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.34);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.vc-sheet-handle {
  width: 38px;
  height: 4.5px;
  border-radius: 999px;
  background: var(--text-3);
  opacity: 0.45;
  margin-bottom: 8px;
}
.vc-sheet-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.vc-sheet-title-wrap {
  text-align: center;
}
.vc-sheet-title-wrap strong {
  display: block;
  font-size: 16.5px;
  font-weight: 700;
}
.vc-sheet-title-wrap small {
  font-size: 12px;
  color: var(--text-2);
}
.vc-sheet-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin: 8px 0 24px;
  width: 100%;
}
.vc-stage-peer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.vc-stage-ring {
  position: relative;
  padding: 4px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  transition: border-color .2s;
}
.vc-stage-ring.speaking {
  border-color: #d84315;
}
.vc-stage-ring .avatar {
  width: 78px;
  height: 78px;
  font-size: 26px;
}
.vc-stage-bars {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.vc-stage-bars i {
  width: 2.5px;
  background: #d84315;
  border-radius: 2px;
  animation: vcWave 0.75s ease-in-out infinite;
}
.vc-stage-bars i:nth-child(2) { animation-delay: 0.15s; }
.vc-stage-bars i:nth-child(3) { animation-delay: 0.3s; }
.vc-stage-bars i:nth-child(4) { animation-delay: 0.45s; }
.vc-stage-muted {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  display: grid;
  place-items: center;
  font-size: 13px;
}
.vc-stage-name {
  font-size: 13.5px;
  font-weight: 600;
}
.vc-sheet-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.vc-ctrl-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-header);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 20px;
  transition: transform .1s, background .15s;
}
.vc-ctrl-btn:hover {
  background: var(--bg-active);
}
.vc-ctrl-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.vc-ctrl-btn.leave {
  color: #ea4335;
  font-weight: 700;
}

/* ---- 4. WhatsApp Pill Composer, Group Avatars, Reaction Pill, PDF Card & Stickers (image-1, 3, 4) ---- */
.composer {
  align-items: center;
  gap: 8px;
  padding: 7px 12px calc(8px + env(safe-area-inset-bottom));
}
.composer-pill {
  border-radius: 24px;
  padding: 3px 8px 3px 6px;
  min-height: 44px;
}
.send-btn {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.35);
}
body.light .send-btn {
  background: var(--accent);
  color: #ffffff;
}
.msg-grp-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.msg-in-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  font-size: 11px;
  margin-top: 2px;
}
.wa-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  margin-top: 4px;
  cursor: pointer;
}
.wa-pdf-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 225px;
  padding: 9px 11px;
  margin: 1px 0 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  cursor: pointer;
}
body.light .wa-pdf-card {
  background: rgba(11, 20, 26, 0.06);
}
.wa-pdf-badge {
  width: 36px;
  height: 42px;
  border-radius: 6px;
  background: #e53935;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 5px rgba(229, 57, 53, 0.35);
}
.wa-pdf-badge.doc { background: #1e88e5; }
.wa-pdf-badge.zip { background: #fb8c00; }
.msg.sticker-msg .bubble {
  background: transparent !important;
  box-shadow: none !important;
  padding: 2px 4px !important;
}
.msg.sticker-msg .bubble::after {
  display: none !important;
}
.msg-sticker-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.msg-sticker-svg {
  width: 132px;
  height: 132px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18));
  transition: transform .15s;
}
.msg-sticker-svg:hover {
  transform: scale(1.06);
}
.msg.sticker-msg .meta {
  background: var(--bg-panel);
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  margin-top: -6px;
}

/* ---- 5. WhatsApp In-App Catalog & Storefront (image-5.png) ---- */
.catalog-pane {
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-panel);
}
.cat-topbar {
  background: #008069;
  color: #ffffff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 8;
}
.cat-topbar h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}
.cat-topbar .icon-btn {
  color: #ffffff;
  width: 34px;
  height: 34px;
}
.cat-hero {
  position: relative;
  height: 158px;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 45%, #40916c 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 16px;
  color: #ffffff;
  overflow: hidden;
}
.cat-hero-circle {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(217, 4, 41, 0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.cat-hero h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.cat-hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  max-width: 310px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.cat-pin-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 6px solid var(--bg-header);
  cursor: pointer;
}
.cat-pin-bar:hover {
  background: var(--bg-hover);
}
.cat-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
.cat-sec-head h4 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}
.cat-sec-head button {
  background: none;
  border: 0;
  color: #027eb5;
  font-size: 13px;
  font-weight: 600;
}
.cat-cards-row {
  display: flex;
  gap: 10px;
  padding: 4px 16px 14px;
  overflow-x: auto;
  border-bottom: 6px solid var(--bg-header);
}
.cat-card {
  flex: 0 0 104px;
  height: 108px;
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform .12s, border-color .15s;
}
.cat-card.active {
  border-color: #008069;
  transform: translateY(-2px);
}
.cat-card-ico {
  font-size: 32px;
  align-self: center;
  margin-top: 4px;
}
.cat-card-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #1f2c34;
}
.cat-deal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.cat-deal-thumb {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 28px;
  flex: 0 0 auto;
  background: var(--bg-header);
}
.cat-deal-info {
  flex: 1;
  min-width: 0;
}
.cat-deal-title {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text);
}
.cat-deal-price {
  font-size: 13px;
  color: var(--text-2);
}
.cat-deal-price s {
  opacity: 0.65;
  margin-right: 4px;
}
.cat-deal-price b {
  color: var(--text);
  font-weight: 700;
}
.cat-add-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: #008069;
  font-size: 20px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.cat-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #008069;
  border-radius: 8px;
  padding: 2px 6px;
  background: rgba(0, 128, 105, 0.08);
}
.cat-stepper button {
  background: none;
  border: 0;
  color: #008069;
  font-weight: 800;
  font-size: 15px;
  padding: 2px 5px;
}
.cat-cart-bar {
  position: sticky;
  bottom: 0;
  background: #008069;
  color: #ffffff;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 -4px 14px rgba(0,0,0,.22);
}
.cat-cart-bar button {
  background: #ffffff;
  color: #008069;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 12.5px;
}

/* ==========================================================================
   Dynamic Multi-Device UI Transformation (Desktop Web · Tablet · Mobile Phone)
   Matches image-1.png on Desktop, Split-Screen on Tablet, and image-2..5 on Mobile
   ========================================================================== */

.device-mode-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(var(--accent-rgb), 0.35) !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.device-mode-btn:hover {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
}

.guest-countdown-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 14px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.16), rgba(240, 180, 41, 0.14));
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.guest-countdown-bar.paused {
  background: linear-gradient(90deg, rgba(2, 126, 181, 0.18), rgba(var(--accent-rgb), 0.12));
}
.guest-countdown-bar.urgent {
  background: linear-gradient(90deg, rgba(234, 67, 53, 0.22), rgba(240, 180, 41, 0.18));
  color: #ff6b6b;
}

.mobile-only-btn {
  display: none;
}

.mobile-fab-btn {
  display: none;
  position: absolute;
  right: 18px;
  bottom: 74px;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #25d366;
  color: #07231d;
  border: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  place-items: center;
  z-index: 35;
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.mobile-fab-btn:hover {
  background: #20bd5a;
  transform: scale(1.04);
}

/* ---- 1. TABLET BREAKPOINT (681px – 1024px) OR body.force-tablet ---- */
@media (min-width: 681px) and (max-width: 1024px) {
  #rail { width: 52px; padding: 8px 0; }
  #sidebar { width: 295px; min-width: 270px; max-width: 310px; }
  .chat-head { padding: 0 10px; }
  .chat-head-actions { gap: 2px; }
  #btnPin, #btnSearchChat { display: none; }
  .bubble { max-width: 78%; }
}

body.force-tablet {
  background: #070d11;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.force-tablet #app {
  width: min(940px, 98vw) !important;
  height: min(680px, 94vh) !important;
  margin: auto;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 70px rgba(0,0,0,.65);
  flex-direction: row !important;
  padding-bottom: 0 !important;
}
body.force-tablet #rail { display: flex !important; width: 52px !important; }
body.force-tablet #sidebar { width: 290px !important; min-width: 270px !important; max-width: 300px !important; border-right: 1px solid var(--line) !important; }
body.force-tablet #chatPanel { position: relative !important; transform: none !important; flex: 1 !important; }
body.force-tablet .mobile-tabs { display: none !important; }
body.force-tablet .back-btn { display: none !important; }

/* ---- 2. MOBILE PHONE BREAKPOINT (<= 860px) — Native WhatsApp Android/iOS (image-2..5) ---- */
@media (max-width: 860px) {
  .mobile-only-btn { display: grid; }
  #btnNewChat { display: none; }
  .mobile-fab-btn { display: grid; }
  .side-foot { display: none; }
  /* Compact mobile chat header so all icons fit on 360px phones (image-2 & image-4) */
  #btnPin, #btnSearchChat { display: none; }
  /* Floating pill composer directly over doodle wallpaper on Mobile (image-2, image-3, image-4) */
  .composer {
    background: transparent !important;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom)) !important;
  }
  .composer .compose-box {
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
  }
  /* Full-width mobile Catalog modal when opened on phone (image-5.png) */
  .modal:has(#catModalRoot) {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
}

/* ---- 3. FORCED MOBILE PREVIEW ON ANY SCREEN (body.force-mobile — Demo 2, 3, 4, 5) ---- */
body.force-mobile {
  background: radial-gradient(circle at 50% 20%, #16242d, #060b0e);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.force-mobile #app {
  width: min(412px, 100vw) !important;
  height: min(844px, 96vh) !important;
  margin: auto;
  border-radius: 30px;
  overflow: hidden;
  border: 4px solid #26353d;
  box-shadow: 0 28px 80px rgba(0,0,0,.75);
  flex-direction: column !important;
  position: relative !important;
  padding-bottom: 56px !important;
  background: var(--bg-panel);
}
body.force-mobile.chat-open #app {
  padding-bottom: 0 !important;
}
body.force-mobile #rail { display: none !important; }
body.force-mobile #sidebar {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border-right: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  position: relative !important;
}
body.force-mobile .mobile-only-btn { display: grid !important; }
body.force-mobile #btnNewChat { display: none !important; }
body.force-mobile .mobile-fab-btn { display: grid !important; bottom: 18px !important; }
body.force-mobile .side-foot { display: none !important; }
body.force-mobile #chatPanel {
  position: absolute !important;
  inset: 0 !important;
  background: var(--chat-bg) !important;
  transform: translateX(100%) !important;
  transition: transform .22s ease !important;
  z-index: 45 !important;
}
body.force-mobile.chat-open #chatPanel {
  transform: translateX(0) !important;
}
body.force-mobile .back-btn { display: grid !important; }
body.force-mobile .chat-head { padding: 0 8px !important; height: 56px !important; gap: 6px !important; }
body.force-mobile .chat-head-actions { gap: 1px !important; }
body.force-mobile #btnPin, body.force-mobile #btnSearchChat { display: none !important; }
body.force-mobile .composer {
  background: transparent !important;
  padding: 6px 8px 10px !important;
  gap: 6px !important;
}
body.force-mobile .composer .compose-box {
  background: var(--bg-header);
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
body.force-mobile .bubble { max-width: 86% !important; }
body.force-mobile .mobile-tabs {
  display: flex !important;
  position: fixed !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(404px, 100vw) !important;
  bottom: max(2vh, 0px) !important;
  border-radius: 0 0 26px 26px !important;
  height: 56px !important;
  background: var(--bg-header) !important;
  border-top: 1px solid var(--line) !important;
  z-index: 55 !important;
}
body.force-mobile.chat-open .mobile-tabs {
  display: none !important;
}

/* ---- 4. FORCED DESKTOP PREVIEW ON ANY SCREEN (body.force-desktop — Demo 1) ---- */
body.force-desktop #rail { display: flex !important; width: 60px !important; }
body.force-desktop #app { flex-direction: row !important; padding-bottom: 0 !important; }
body.force-desktop #sidebar { width: 360px !important; min-width: 300px !important; max-width: 400px !important; border-right: 1px solid var(--line) !important; }
body.force-desktop #chatPanel { position: relative !important; transform: none !important; flex: 1 !important; }
body.force-desktop .mobile-tabs { display: none !important; }
body.force-desktop .back-btn { display: none !important; }
body.force-desktop .mobile-fab-btn { display: none !important; }

/* ==========================================================================
   5. WhatsApp Draggable Call Popup + Mini PiP Screen + Full Screen Modes
   ========================================================================== */

/* Active Call Mini Picture-in-Picture (PiP) Floating Window */
#callOverlay.call-pip-mode {
  width: min(280px, 88vw) !important;
}
#callOverlay.call-pip-mode .call-top {
  pointer-events: auto !important;
}
#callOverlay.call-pip-mode .call-win-actions {
  top: 6px !important;
  right: 8px !important;
  gap: 4px !important;
}
#callOverlay.call-pip-mode .call-win-btn {
  padding: 3px 8px !important;
  font-size: 11px !important;
}
#callOverlay.call-pip-mode .call-pill {
  padding: 3px 10px !important;
  font-size: 11.5px !important;
  align-self: flex-start !important;
}
#callOverlay.call-pip-mode .call-route,
#callOverlay.call-pip-mode #callReactionBar,
#callOverlay.call-pip-mode #btnVideoEffect,
#callOverlay.call-pip-mode #btnScreenShare,
#callOverlay.call-pip-mode #btnCallQuality,
#callOverlay.call-pip-mode #btnRecordCall,
#callOverlay.call-pip-mode #btnFlipCam,
#callOverlay.call-pip-mode .call-sub-status {
  display: none !important;
}
#callOverlay.call-pip-mode .call-audio-stage .avatar {
  width: 58px !important;
  height: 58px !important;
  font-size: 20px !important;
}
#callOverlay.call-pip-mode .call-audio-name {
  font-size: 15px !important;
}
#callOverlay.call-pip-mode .call-btn {
  width: 38px !important;
  height: 38px !important;
}
#callOverlay.call-pip-mode .call-btn.end {
  width: 42px !important;
  height: 42px !important;
}

/* Incoming Call Popup Drag Bar + Mini / Full Screen Modes */
.incoming-card {
  touch-action: none;
  user-select: none;
  transition: width .18s ease, padding .18s ease;
}
.in-win-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px 0 4px;
  padding: 4px 2px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: grab;
}
.in-win-bar:active {
  cursor: grabbing;
}
.in-drag-grip {
  font-size: 11px;
  font-weight: 700;
  color: #8696a0;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.in-win-btns {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.in-win-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #e9edef;
  font-size: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.in-win-btn:hover {
  background: rgba(var(--accent-rgb), 0.45);
  color: #fff;
}
.in-win-btn.close:hover {
  background: #ea4335;
  color: #fff;
}

/* Incoming Call — Mini Pill Mode */
.incoming-card.mini-mode {
  width: min(330px, 94vw) !important;
  padding: 10px 14px !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}
.incoming-card.mini-mode .in-preview-box,
.incoming-card.mini-mode .in-sub,
.incoming-card.mini-mode .in-act-lbl {
  display: none !important;
}
.incoming-card.mini-mode .in-name {
  font-size: 14.5px !important;
  margin: 0 !important;
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.incoming-card.mini-mode .in-actions {
  width: auto !important;
  gap: 8px !important;
  margin: 0 !important;
}
.incoming-card.mini-mode .call-btn.big {
  width: 40px !important;
  height: 40px !important;
}

/* Incoming Call — Full Screen Mode */
#incomingOverlay.full-mode {
  background: rgba(11, 20, 26, 0.96) !important;
  backdrop-filter: blur(10px) !important;
  pointer-events: auto !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}
#incomingOverlay.full-mode .incoming-card {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: min(440px, 96vw) !important;
  padding: 24px 22px 26px !important;
}
#incomingOverlay.full-mode .in-preview-box {
  height: 240px !important;
}

/* ==========================================================================
   WhatsApp Call Screen 2x3 Labeled Bottom Sheet (image-7.png Right Side)
   ========================================================================== */
#callOverlay {
  background-color: #0b141a;
  background-image: url("/wallpaper-dark.svg");
  background-size: 420px;
}
#callOverlay .call-controls {
  width: min(380px, 94vw) !important;
  backdrop-filter: blur(16px) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65) !important;
  position: relative !important;
  z-index: 30 !important;
}
.call-ctrl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.call-ctrl-lbl {
  font-size: 12px;
  font-weight: 500;
  color: #d1d7db;
  letter-spacing: 0.1px;
  user-select: none;
}
#callOverlay .call-btn.end {
  width: 56px;
  height: 56px;
  box-shadow: 0 4px 18px rgba(234, 0, 56, 0.52);
}
.call-more-tray {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(380px, 94vw);
  margin: 0 auto 10px auto;
  padding: 12px 14px;
  background: rgba(18, 27, 34, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  z-index: 32;
  position: relative;
}
.call-more-tray.hidden {
  display: none !important;
}
.call-more-tray .call-reaction-bar {
  position: static !important;
  transform: none !important;
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  width: 100%;
  justify-content: space-around;
}
.call-more-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.call-tool-pill {
  background: #2a3942;
  color: #e9edef;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.call-tool-pill.on, .call-tool-pill:hover {
  background: var(--accent);
  color: #06221b;
}
#callOverlay.call-pip-mode .call-ctrl-lbl,
#callOverlay.call-pip-mode #callMoreTray {
  display: none !important;
}

/* ==========================================================================
   WhatsApp Empty State Card & Quick Shortcuts (image-5.png & image-6.png)
   ========================================================================== */
.wa-empty-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 36px 28px;
  max-width: 440px;
  width: 92%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  margin-bottom: 26px;
}
.wa-empty-illus {
  margin-bottom: 14px;
}
.wa-empty-card h2 {
  font-size: 21px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 8px;
  line-height: 1.3;
}
.wa-empty-card p {
  font-size: 13.8px;
  color: var(--text-2);
  margin: 0 0 20px;
  line-height: 1.45;
}
.wa-go-calls-btn {
  background: #d9fdd3;
  color: #0b3b24;
  border: 0;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.wa-go-calls-btn:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}
.wa-empty-shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 24px;
  margin-bottom: 22px;
  max-width: 560px;
}
.wa-shortcut-item {
  background: none;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-2);
  min-width: 78px;
}
.wa-sc-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-1);
  transition: transform 0.14s ease, background 0.14s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.wa-shortcut-item:hover .wa-sc-circle {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.wa-sc-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

/* ==========================================================================
   WhatsApp Chat Row Dropdown ('⌄') & Floating Context Menu (image-5 & image-6)
   ========================================================================== */
.chat-row {
  position: relative;
}
.chat-row-menu-btn {
  background: none;
  border: 0;
  color: var(--text-2);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.72;
  padding: 0;
  margin-left: 2px;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s;
}
.chat-row:hover .chat-row-menu-btn,
.chat-row-menu-btn:focus {
  opacity: 1;
  background: rgba(134, 150, 160, 0.16);
}
.wa-ctx-menu {
  position: fixed;
  z-index: 350;
  min-width: 225px;
  background: var(--bg-panel);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 0;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
  user-select: none;
  animation: ctxFadeIn 0.12s ease-out;
}
@keyframes ctxFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.wa-ctx-item {
  width: 100%;
  background: none;
  border: 0;
  color: var(--text-1);
  padding: 10px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}
.wa-ctx-item:hover {
  background: rgba(134, 150, 160, 0.14);
}
.wa-ctx-item.danger {
  color: #f15c6d;
}
.wa-ctx-item .ctx-ico {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.88;
}
.wa-ctx-item .ctx-arrow {
  margin-left: auto;
  opacity: 0.6;
  font-size: 12px;
}
.wa-ctx-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 0;
}

/* ==========================================================================
   Clean WhatsApp Message Bubbles & Toggleable Action Bar (image-8.png)
   ========================================================================== */
.msg .bubble {
  position: relative;
}
.msg-menu-trigger {
  background: none;
  border: 0;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0 3px;
  margin-left: 4px;
  font-size: 12px;
  line-height: 1;
  border-radius: 4px;
}
.msg-menu-trigger:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.12);
}
.msg .msg-actions {
  display: none !important;
  border-top: 1px solid rgba(134, 150, 160, 0.2);
  padding-top: 5px;
  margin-top: 6px !important;
}
.msg.show-actions .msg-actions {
  display: flex !important;
}

/* ==========================================================================
   WhatsApp Mobile Call Screen & Chat Screen Overhaul (image-1.png & image-2.png)
   Auto-adapts across Mobile Phones, Tablets, and Desktop Web
   ========================================================================== */

/* 1. Call Screen Top Header: Left Minimize · Center Name + Timer · Right Add-Person (image-2.png) */
#callOverlay .call-top {
  display: grid !important;
  grid-template-columns: 44px 1fr 44px !important;
  align-items: start !important;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 18px !important;
  pointer-events: auto !important;
  background: linear-gradient(180deg, rgba(11, 20, 26, 0.78) 0%, transparent 100%) !important;
}
#callOverlay .call-corner-btn {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: rgba(31, 44, 52, 0.92) !important;
  color: #e9edef !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38) !important;
  transition: transform 0.12s ease, background 0.15s ease !important;
  pointer-events: auto !important;
}
#callOverlay .call-corner-btn:hover {
  background: #2a3942 !important;
  transform: scale(1.04);
}
#callOverlay .call-center-info.call-pill {
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  padding: 0 8px !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  text-align: center !important;
}
#callOverlay #callPeerName {
  font-size: 21px !important;
  font-weight: 500 !important;
  color: #e9edef !important;
  line-height: 1.22 !important;
  letter-spacing: -0.1px !important;
}
#callOverlay #callTimer {
  font-size: 13.8px !important;
  font-weight: 400 !important;
  color: #8696a0 !important;
  font-variant-numeric: tabular-nums !important;
}
#callOverlay .call-center-info .dot-sep {
  display: none !important;
}
#callOverlay #callRouteBadge {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 4px;
}

/* 2. Call Screen Center Avatar Stage (image-2.png: large circular avatar on doodle wallpaper) */
#callOverlay .call-audio-stage #callAvatar {
  width: 172px !important;
  height: 172px !important;
  font-size: 62px !important;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.52) !important;
}
#callOverlay .call-audio-stage #callAudioName,
#callOverlay .call-audio-stage #callSubStatus {
  display: none !important;
}

/* 3. Call Screen Bottom 2x3 Control Card (image-2.png) */
#callOverlay .call-controls {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px 28px !important;
  width: min(384px, 94vw) !important;
  max-width: 94vw !important;
  margin: auto auto calc(14px + env(safe-area-inset-bottom, 0px)) auto !important;
  padding: 20px 24px 18px !important;
  background: rgba(24, 34, 41, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 28px !important;
}
#callOverlay .call-btn {
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  background: #233138 !important;
  color: #e9edef !important;
}
#callOverlay .call-btn.on {
  background: #ffffff !important;
  color: #0b141a !important;
}
#callOverlay .call-btn.end {
  background: #ea0038 !important;
  color: #ffffff !important;
}

/* 4. WhatsApp Voice Note Bubble with Avatar + Mic Badge & Progress Dot (image-1.png) */
.voice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 235px;
  max-width: 300px;
  padding: 4px 2px 2px;
  cursor: pointer;
}
.v-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: #8696a0;
  flex: 0 0 auto;
}
.msg.out .v-play,
.msg.in .v-play {
  color: #8696a0;
}
.voice-track-col {
  flex: 1;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.voice-wave-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.v-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #53bdeb;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(83, 189, 235, 0.22);
}
.voice-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  line-height: 1;
}
.voice-av-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}
.voice-av-wrap .avatar {
  width: 42px !important;
  height: 42px !important;
  font-size: 15px !important;
}
.voice-mic-badge {
  position: absolute;
  left: -3px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0b141a;
  color: #53bdeb;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* 5. Photo Bubble with Floating Forward Button (image-1.png) */
.media-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.media-fwd-fab {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(17, 27, 33, 0.72);
  color: #e9edef;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.media-fwd-fab:hover {
  background: rgba(var(--accent-rgb), 0.85);
}
.bubble:has(.media-image) {
  padding: 4px 4px 5px !important;
  border-radius: 12px !important;
}
.bubble:has(.media-image) .media-image {
  margin: 0 !important;
  border-radius: 9px !important;
}

/* 6. Mobile Phone Chat & Composer Layout (image-1.png — Left & Right) */
@media (max-width: 860px) {
  html, body {
    overflow: hidden;
  }
  body.chat-open #app {
    padding-bottom: 0 !important;
  }
  .chat-head {
    height: 56px !important;
    flex: 0 0 56px !important;
    padding: 0 6px 0 4px !important;
    gap: 6px !important;
  }
  .chat-head #chatAvatar {
    width: 38px !important;
    height: 38px !important;
    font-size: 14px !important;
  }
  .chat-head-txt strong {
    font-size: 16px !important;
    font-weight: 500 !important;
  }
  /* Only show Video Call, Voice Call, and 3-Dots Menu in mobile chat header (image-1.png) */
  #btnPin,
  #btnSearchChat,
  #btnOpenCatalog {
    display: none !important;
  }
  .chat-head-actions {
    gap: 2px !important;
  }
  .chat-head-actions .icon-btn {
    width: 38px !important;
    height: 38px !important;
  }
  .msgs {
    padding: 10px 10px 8px !important;
    gap: 3px !important;
  }
  .bubble {
    border-radius: 12px !important;
    padding: 6px 10px 5px !important;
    font-size: 15px !important;
    max-width: 84% !important;
  }
  .msg-menu-trigger {
    display: none;
  }
  .msg.show-actions .msg-menu-trigger {
    display: inline-block;
  }
  /* Mobile Pill Composer (image-1.png: dark pill + circular green mic/send button) */
  .composer {
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 6px !important;
    align-items: center !important;
  }
  .composer .compose-box {
    min-height: 46px !important;
    border-radius: 24px !important;
    padding: 2px 8px 2px 6px !important;
    background: #1f2c34 !important;
  }
  body.light .composer .compose-box {
    background: #ffffff !important;
  }
  .composer .send-btn {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: var(--accent) !important;
    color: var(--on-accent) !important;
  }
}

body.force-mobile #btnPin,
body.force-mobile #btnSearchChat,
body.force-mobile #btnOpenCatalog,
body.ui-mode-mobile #btnPin,
body.ui-mode-mobile #btnSearchChat,
body.ui-mode-mobile #btnOpenCatalog {
  display: none !important;
}

/* ==========================================================================
   7. Mini Call Window (PiP) & Incoming Call Draggable Popup Fix
   Ensures 100% visibility when minimized and smooth mouse/touch dragging
   ========================================================================== */
#callOverlay.call-pip-mode {
  position: fixed !important;
  top: 68px;
  right: 16px;
  left: auto;
  bottom: auto;
  width: min(276px, 88vw) !important;
  height: 196px !important;
  border-radius: 20px !important;
  background-color: #111b21 !important;
  border: 2px solid rgba(var(--accent-rgb), 0.72) !important;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  z-index: 260 !important;
  cursor: grab !important;
  touch-action: none !important;
  user-select: none !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}
#callOverlay.call-pip-mode:active {
  cursor: grabbing !important;
}
#callOverlay.call-pip-mode .call-top {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  display: grid !important;
  grid-template-columns: 32px 1fr 32px !important;
  align-items: center !important;
  padding: 8px 10px 4px !important;
  background: linear-gradient(180deg, rgba(11, 20, 26, 0.92) 0%, transparent 100%) !important;
  flex: 0 0 auto !important;
  cursor: grab !important;
}
#callOverlay.call-pip-mode .call-corner-btn {
  width: 30px !important;
  height: 30px !important;
}
#callOverlay.call-pip-mode .call-corner-btn svg {
  width: 15px !important;
  height: 15px !important;
}
#callOverlay.call-pip-mode #callPeerName {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 175px !important;
}
#callOverlay.call-pip-mode #callTimer {
  font-size: 11.5px !important;
  color: var(--accent) !important;
  font-weight: 600 !important;
}
#callOverlay.call-pip-mode .call-audio-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 2px 0 !important;
  pointer-events: none !important;
}
#callOverlay.call-pip-mode .call-audio-stage #callAvatar {
  width: 56px !important;
  height: 56px !important;
  font-size: 20px !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
}
#callOverlay.call-pip-mode .call-local {
  width: 56px !important;
  height: 74px !important;
  right: 8px !important;
  bottom: 54px !important;
  border-radius: 8px !important;
}
#callOverlay.call-pip-mode .call-controls {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-evenly !important;
  gap: 6px !important;
  width: calc(100% - 16px) !important;
  max-width: calc(100% - 16px) !important;
  margin: 0 auto 8px auto !important;
  padding: 6px 8px !important;
  border-radius: 18px !important;
  background: rgba(18, 27, 34, 0.94) !important;
  flex: 0 0 auto !important;
}
#callOverlay.call-pip-mode .call-ctrl-item:nth-child(1),
#callOverlay.call-pip-mode .call-ctrl-item:nth-child(5),
#callOverlay.call-pip-mode .call-ctrl-lbl,
#callOverlay.call-pip-mode #callMoreTray {
  display: none !important;
}
#callOverlay.call-pip-mode .call-btn,
#callOverlay.call-pip-mode .call-btn.end {
  width: 38px !important;
  height: 38px !important;
}
#callOverlay.call-pip-mode .call-btn svg {
  width: 18px !important;
  height: 18px !important;
}

/* Remove transform from .incoming-overlay so position:fixed #incomingCardBox drags in true viewport coordinates */
.incoming-overlay.hidden { display: none !important; }
.incoming-overlay:not(.full-mode):not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  transform: none !important;
  pointer-events: none !important;
  background: transparent !important;
  display: block !important;
}
.incoming-overlay:not(.full-mode):not(.hidden) .incoming-card {
  position: fixed;
  top: 16px;
  right: 16px;
  pointer-events: auto !important;
  touch-action: none !important;
  cursor: grab;
  z-index: 255;
}
@media (max-width: 640px) {
  .incoming-overlay:not(.full-mode):not(.hidden) .incoming-card {
    right: 12px;
    top: 12px;
    width: min(320px, calc(100vw - 24px));
  }
}







/* ---- profile photo cropper ---- */
.crop-overlay{position:fixed;inset:0;z-index:400;background:rgba(0,0,0,.72);display:flex;align-items:center;justify-content:center;padding:16px}
.crop-box{background:var(--bg-panel,#fff);color:var(--text,#111);border-radius:16px;padding:18px;display:flex;flex-direction:column;align-items:center;gap:14px;max-width:96vw;box-shadow:0 12px 40px rgba(0,0,0,.4)}
.crop-box h3{margin:0;font-size:17px;font-weight:600}
.crop-stage{position:relative;border-radius:12px;overflow:hidden;background:#111}
.crop-stage canvas{display:block;cursor:grab}
.crop-ring{position:absolute;inset:0;pointer-events:none;border-radius:50%;box-shadow:0 0 0 999px rgba(0,0,0,.5);border:2px solid rgba(255,255,255,.9)}
.crop-zoom{width:100%;accent-color:var(--accent)}
.crop-actions{display:flex;gap:10px;justify-content:flex-end;width:100%}


/* ======================================================================
   Mobile keyboard handling (v w9): the app always fills the *visual*
   viewport, so when the on-screen keyboard opens the header stays on
   screen, the message list shrinks, and the composer + send button sit
   right above the keyboard — exactly like WhatsApp.
   ====================================================================== */
html { --vvh: 100dvh; --vvt: 0px; }
.composer-pill { min-width: 0; }
.composer-pill input { min-width: 0; width: 0; }
.composer, .composer-pill { max-width: 100%; }
.composer .send-btn { position: relative; z-index: 2; flex: 0 0 auto; }
@media (max-width: 860px) {
  html, body {
    position: fixed; left: 0; right: 0; top: 0; width: 100%;
    height: var(--vvh) !important; max-height: var(--vvh) !important;
    overscroll-behavior: none;
  }
  #app, #chatPanel, #chatView {
    height: var(--vvh) !important; max-height: var(--vvh) !important;
  }
  html.kb-open .composer { padding-bottom: 8px !important; }
  html.kb-open #rail, html.kb-open .bottom-nav { display: none !important; }
}
@media (max-width: 460px) {
  /* keep the send button visible next to a long draft: drop the extras while typing */
  .composer:has(#btnSend:not(.mic)) #btnScheduleMsg,
  .composer:has(#btnSend:not(.mic)) #btnQuickCam { display: none; }
  .composer-pill .icon-btn { width: 34px; height: 34px; flex: 0 0 auto; }
}

/* ---- install-the-app banner ---- */
.install-banner{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(14px + env(safe-area-inset-bottom));width:min(440px,calc(100vw - 20px));
  display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;background:var(--bg-panel,#fff);color:var(--text,#111);
  box-shadow:0 10px 36px rgba(0,0,0,.38);border:1px solid var(--line,#e7e3de);animation:ibUp .35s ease-out}
.install-banner img{border-radius:11px;flex:0 0 auto}
.install-banner .ib-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:12.5px;line-height:1.35;color:var(--text-2,#667781)}
.install-banner .ib-text strong{font-size:14.5px;color:var(--text,#111)}
.install-banner .ib-ico{display:inline-block;padding:0 4px;border-radius:4px;background:var(--bg-header,#f0f2f5)}
.install-banner .ib-actions{display:flex;flex-direction:column;gap:6px;flex:0 0 auto}
.install-banner button{border:0;border-radius:18px;padding:8px 16px;font-size:13px;font-weight:600;cursor:pointer}
.install-banner .ib-install{background:var(--accent);color:#04201a}
.install-banner .ib-later{background:transparent;color:var(--text-2,#667781)}
@keyframes ibUp{from{opacity:0;transform:translate(-50%,20px)}to{opacity:1;transform:translate(-50%,0)}}
html.kb-open .install-banner{display:none}

/* ======================================================================
   Marketplace (catalog) — full sidebar view, no overlap with the chat list
   ====================================================================== */
#sidebar.view-catalog > .side-head,
#sidebar.view-catalog > #guestCountdownBar,
#sidebar.view-catalog > .search-wrap,
#sidebar.view-catalog > #chips,
#sidebar.view-catalog > #searchHint,
#sidebar.view-catalog > #archivedRow,
#sidebar.view-catalog > #lockedRow,
#sidebar.view-catalog > #sideAccount,
#sidebar.view-catalog > .side-foot,
#sidebar.view-catalog > #btnMobileFab,
#sidebar.view-catalog > .net-line { display: none !important; }
#sidebar { min-height: 0; overflow: hidden; }
.catalog-pane { min-height: 0; overflow: hidden !important; display: flex; flex-direction: column; flex: 1 1 auto; }
.catalog-pane.hidden { display: none !important; }
.catalog-pane > * { flex-shrink: 0; }
.catalog-pane > .mk-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.catalog-pane > .cat-cart-bar { position: static; }
.catalog-pane > .cat-cart-bar.hidden { display: none; }
.catalog-pane > .cat-topbar { position: static; }
.mk-badge { position: absolute; top: 1px; right: 1px; background: #fff; color: #008069; border-radius: 999px; font-size: 10px; font-weight: 800; padding: 0 5px; line-height: 15px; }
.mk-badge.hidden { display: none; }
.mk-searchbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-header); color: var(--text-2); }
.mk-searchbar input[type=search] { flex: 1; min-width: 0; height: 38px; border-radius: 19px; border: 0; padding: 0 14px; background: var(--bg-panel); color: var(--text); font-size: 14.5px; outline: none; }
.mk-searchbar select { height: 38px; border-radius: 19px; border: 0; padding: 0 8px; background: var(--bg-panel); color: var(--text); font-size: 12.5px; }
.mk-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 4px; scrollbar-width: none; -ms-overflow-style: none; }
.mk-chips::-webkit-scrollbar, .mk-scroll::-webkit-scrollbar:horizontal { display: none; height: 0; }
.mk-chips.sub { padding-top: 6px; }
.mk-chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--bg-panel); color: var(--text); border-radius: 999px; padding: 7px 13px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.mk-chip small { opacity: .6; margin-left: 2px; }
.mk-chip.sm { padding: 5px 11px; font-size: 12px; background: var(--bg-header); }
.mk-chip.active { background: #d9fdd3; border-color: var(--accent); color: #0b3d2e; font-weight: 600; }
body:not(.light) .mk-chip.active { background: rgba(var(--accent-rgb),.25); color: #e9edef; }
.mk-chip.add { border-style: dashed; color: #008069; background: transparent; }
.mk-resultbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px 4px; font-size: 12.5px; color: var(--text-2); }
.mk-link { background: none; border: 0; color: #008069; font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 2px 0; }
.mk-note { margin: 10px 12px 0; padding: 9px 12px; border-radius: 10px; background: #fff8e1; color: #6b5200; font-size: 12.5px; line-height: 1.4; }
.mk-note.warn { background: #fdecea; color: #8a1c14; }
body:not(.light) .mk-note { background: rgba(240,180,41,.14); color: #f3d98b; }
.mk-row { cursor: pointer; align-items: flex-start; }
.mk-row:hover { background: var(--bg-hover); }
.mk-thumb { overflow: hidden; width: 64px !important; height: 64px !important; }
.mk-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-emoji { font-size: 30px; line-height: 1; } .mk-emoji.big { font-size: 64px; }
.mk-sub { font-size: 11.5px; color: var(--text-3, var(--text-2)); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-out { color: #d93025; }
.mk-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 24px; text-align: center; color: var(--text-2); }
.pd-img { height: 190px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; }
.pd-img .mk-img { object-fit: contain; }
.pd-price { font-size: 18px; } .pd-price s { opacity: .55; margin-right: 6px; font-size: 14px; } .pd-price b { font-weight: 800; } .pd-price em { font-style: normal; color: #008069; font-size: 13px; margin-left: 6px; font-weight: 600; }
.pd-desc { white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; color: var(--text); margin: 8px 0; }
.pd-seller { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--bg-header); margin: 8px 0; cursor: pointer; font-size: 13.5px; }
.pd-seller span { color: #008069; font-size: 12.5px; }
.pf-row { display: flex; gap: 10px; } .pf-row > div { flex: 1; min-width: 0; }
.pf-row select, .pf-row input, #pfTitle, #pfNewSub, #scName { width: 100%; }
.pf-photo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pf-photo .cat-deal-thumb { overflow: hidden; }
@media (max-width: 860px) {
  .catalog-pane { padding-bottom: 56px; }   /* keep the last product above the bottom tabs */
  .catalog-pane > .cat-cart-bar { margin-bottom: 0; }
}

/* a hidden call / incoming-call overlay must never keep catching taps (specificity guard) */
#callOverlay.hidden, #callOverlay.call-pip-mode.hidden, #incomingOverlay.hidden { display: none !important; pointer-events: none !important; }

/* install banner: never above modals / calls / chat composer, and clear of the bottom tabs */
.install-banner { z-index: 90 !important; }
@media (max-width: 860px) { .install-banner { bottom: calc(68px + env(safe-area-inset-bottom)) !important; } }
body.chat-open .install-banner,
body:has(#modalOverlay:not(.hidden)) .install-banner,
body:has(#callOverlay:not(.hidden)) .install-banner,
body:has(#incomingOverlay:not(.hidden)) .install-banner { display: none !important; }
#pfDesc { font: inherit; font-size: 14px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--bg-input, #f0f2f5); color: inherit; outline: none; box-sizing: border-box; }
#pfCat, #pfSub, #pfCur { font: inherit; font-size: 14px; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--bg-input, #f0f2f5); color: inherit; }

/* ---- AI assistant conversation ---- */

/* ---- Guest ads (AdSense / house promo) ---- */
.guest-ad { position: relative; flex: 0 0 auto; margin: 6px 10px 8px; padding: 18px 8px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-panel, #fff); overflow: hidden; min-height: 78px; }
.guest-ad.hidden { display: none !important; }
.guest-ad-lg { max-width: 420px; }
.guest-ad .ad-tag { position: absolute; top: 2px; left: 10px; right: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3, #8696a0); }
.guest-ad .ad-remove { border: 0; background: transparent; color: var(--accent); font-size: 10.5px; font-weight: 700; text-transform: none; letter-spacing: 0; padding: 0 2px; cursor: pointer; }
.guest-ad .ad-house { display: flex; align-items: center; gap: 10px; padding: 4px 2px 2px; }
.guest-ad .ad-house > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.35; }
.guest-ad .ad-house strong { font-size: 13.5px; }
.guest-ad .ad-house span { color: var(--text-2, #54656f); }
.guest-ad .ad-house .btn-primary { flex: 0 0 auto; margin: 0; padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
.guest-ad-lg .ad-house { flex-direction: column; text-align: center; padding: 28px 12px 12px; }
html.kb-open .guest-ad { display: none !important; }
.guest-ad-lg { width: 100%; align-self: stretch; box-sizing: border-box; margin: 18px 0 0; }
@media (max-width: 860px) {
  /* leave room for the round “new chat” button that floats over the bottom-right of the list */
  .guest-ad:not(.guest-ad-lg) { margin-bottom: 70px; }
}

/* back camera preview is never mirrored */
.call-local.back-cam { transform: none !important; }

/* phones: a Flip button right in the call controls (screen sharing does not exist on phones), and the small preview sits above the controls */
.call-ctrl-item.flip-quick { display: none !important; }
@media (max-width: 860px) {
  #callOverlay .call-ctrl-item.flip-quick { display: flex !important; }
  #callOverlay.audio .call-ctrl-item.flip-quick .call-btn { opacity: .45; }
  #callOverlay .call-ctrl-item.share-item { display: none !important; }
  #callOverlay.video .call-local { bottom: 250px; right: 14px; width: 104px; height: 140px; }
}

/* ---- business verification: forms + the camera screen ---- */
.kyc-select, .modal select.kyc-select { width: 100%; height: 42px; padding: 0 10px; background: var(--bg-header); color: var(--text); border: 1px solid transparent; border-radius: 8px; outline: none; }
.kyc-select:focus { border-color: var(--accent); }
.kyc-row small { color: var(--text-2); font-size: 12px; }
.kyc-btn { min-width: 96px; margin: 0 !important; }
.modal input:disabled, .modal select:disabled { opacity: .6; }
.kyc-cam { position: fixed; inset: 0; z-index: 100000; background: #000; color: #fff; display: flex; flex-direction: column; }
.kyc-cam .kc-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.kyc-cam .kc-title { font-weight: 600; font-size: 16px; }
.kyc-cam .kc-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; cursor: pointer; }
.kyc-cam .kc-stage { position: relative; flex: 1; min-height: 0; background: #111; overflow: hidden; }
.kyc-cam video, .kyc-cam #kcShot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111; }
.kyc-cam video.mirror { transform: scaleX(-1); }
.kyc-cam .kc-guide { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 3px solid rgba(255,255,255,.85); box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); pointer-events: none; }
.kyc-cam .kc-guide.doc { width: min(88vw, 520px); aspect-ratio: 1.586; border-radius: 16px; }
.kyc-cam .kc-guide.face { width: min(66vw, 320px); aspect-ratio: .78; border-radius: 50%; }
.kyc-cam .kc-msg { position: absolute; left: 14px; right: 14px; top: 50%; transform: translateY(-50%); text-align: center; background: rgba(0,0,0,.7); padding: 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.kyc-cam .kc-hint { padding: 10px 18px 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.8); min-height: 34px; }
.kyc-cam .kc-bar { display: flex; align-items: center; justify-content: space-around; gap: 12px; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); }
.kyc-cam .kc-bar.hidden, .kyc-cam .hidden { display: none !important; }
.kyc-cam .kc-side { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
.kyc-cam .kc-side small { font-size: 11px; color: rgba(255,255,255,.75); }
.kyc-cam .kc-shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 4px; cursor: pointer; }
.kyc-cam .kc-shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.kyc-cam .kc-shutter:active i { transform: scale(.88); }

#callOverlay.call-pip-mode .call-ctrl-item.flip-quick,
#callOverlay.call-pip-mode .call-ctrl-item.share-item { display: none !important; }

/* contact info: a full page on phones, above the tab bar and the + button */
@media (max-width: 860px) {
  .contact-drawer { position: fixed; inset: 0; width: 100%; max-width: 100%; z-index: 110; border-left: 0; box-shadow: none; padding-bottom: env(safe-area-inset-bottom); }
  body.cd-open #rail, body.cd-open #btnNewChat { display: none !important; }
  .cd-body { padding-bottom: 40px; -webkit-overflow-scrolling: touch; }
}

/* ---- phones: an incoming call is a full page, like the phone's own call screen ---- */
@media (max-width: 860px) {
  #incomingOverlay.full-mode:not(.hidden) {
    position: fixed !important; inset: 0 !important; width: 100% !important; height: 100% !important; z-index: 300 !important;
    display: flex !important; align-items: stretch !important; justify-content: stretch !important; padding: 0 !important; transform: none !important;
    background-color: #0b141a !important; background-image: url("/wallpaper-dark.svg") !important; background-size: cover !important;
    backdrop-filter: none !important; pointer-events: auto !important;
  }
  #incomingOverlay.full-mode .incoming-card {
    position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
    width: 100% !important; max-width: none !important; height: 100% !important; margin: 0 !important; border-radius: 0 !important;
    border: 0 !important; box-shadow: none !important; background: transparent !important; justify-content: flex-start !important;
    padding: calc(56px + env(safe-area-inset-top)) 24px calc(44px + env(safe-area-inset-bottom)) !important; gap: 6px !important;
  }
  #incomingOverlay.full-mode .in-win-bar { display: none !important; }
  #incomingOverlay.full-mode .in-name { font-size: 30px !important; margin-top: 6px; }
  #incomingOverlay.full-mode .in-sub { font-size: 15px !important; opacity: .8; }
  #incomingOverlay.full-mode .in-preview-box { flex: 1 1 auto; width: 100% !important; height: auto !important; max-height: 52vh; min-height: 160px; margin: 22px 0 !important; border-radius: 22px !important; }
  #incomingOverlay.full-mode .in-actions { width: 100%; justify-content: space-around !important; margin-top: auto; gap: 24px; }
  #incomingOverlay.full-mode .call-btn.big { width: 70px !important; height: 70px !important; }
}
@media (max-width: 860px) {
  #incomingOverlay.full-mode .in-preview-box .avatar { width: 128px !important; height: 128px !important; font-size: 46px !important; line-height: 128px; }
}


/* --- request 26: sign-up / sign-in forms on phones --------------------------
   The two-column grid used `1fr`, which cannot shrink below the input's own
   minimum width, so Username / E-mail / Phone ran off the right edge of the
   card. Every track is now `minmax(0,1fr)` and the form is one column on a
   phone, with touch-sized fields (16px text so iOS does not zoom in). */
.auth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-grid > .field, .auth-col, .auth-body, .auth-card, .auth-main, .prefixed, .phone-row { min-width: 0; }
.auth-screen input, .auth-screen select { min-width: 0; max-width: 100%; box-sizing: border-box; }
.auth-art { max-width: 300px; }
@media (max-width: 640px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .auth-grid .field.span2 { grid-column: auto; }
  .auth-screen { padding-left: 12px; padding-right: 12px; }
  .auth-card { padding: 20px 16px 16px; }
  .auth-screen .field input, .auth-screen .prefixed, .auth-screen .country-pick { height: 50px; font-size: 16px; }
  .auth-screen .prefixed input { height: 48px; }
  .phone-row { gap: 8px; }
  .phone-row .country-pick { flex: 0 0 auto; padding: 0 12px; }
  .phone-row input { flex: 1 1 0; width: 0; }
  .field .hint { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
  .auth-actions { flex-wrap: wrap; gap: 10px; }
  .auth-actions .btn-primary { flex: 1 1 100%; justify-content: center; min-height: 50px; }
  .auth-switch { justify-content: center; }
  .auth-steps { gap: 8px; }
  .as-pill span { font-size: 13px; line-height: 1.35; }
}
/* the app preview: always beside the card on desktop; on a phone it shows under the three doors only */
@media (max-width: 900px) {
  .auth-art { display: none; }
  .auth-screen[data-step="choose"] .auth-art { display: block; width: 100%; max-width: 250px; margin: 6px auto 0; justify-self: center; }
  .auth-screen[data-step="choose"] .auth-two { grid-template-columns: minmax(0, 1fr); }
}

/* ---- request 28: PeerLink Assistant sheet ---- */
#modalOverlay.ai-open { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); padding: 0; display: flex; align-items: stretch; justify-content: center; overflow: hidden; }
.modal.ai-sheet { display: flex; flex-direction: column; width: 100%; max-width: 100%; height: 100%; max-height: none; border-radius: 0; padding: 0; overflow: hidden; background: var(--bg-panel); animation: none; }
@media (min-width: 700px) {
  #modalOverlay.ai-open { align-items: center; padding: 18px; }
  .modal.ai-sheet { width: 480px; height: min(720px, 100%); border-radius: 18px; animation: pop .16s ease-out; }
}
.ai-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px 14px; border-bottom: 1px solid rgba(127,127,127,.18); flex: 0 0 auto; }
.ai-title { flex: 1; min-width: 0; }
.ai-title h2 { margin: 0; font-size: 16.5px; font-weight: 650; line-height: 1.2; }
.ai-title span { display: block; font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-hbtn { border: 0; background: rgba(127,127,127,.14); color: var(--text); border-radius: 999px; height: 32px; padding: 0 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ai-hbtn.ai-x { width: 32px; padding: 0; font-size: 14px; }
/* the glowing blue ring (Antigravity style) */
.ai-orb, .ai-think-orb { position: relative; display: inline-block; flex: 0 0 auto; border-radius: 50%; }
.ai-orb { width: 38px; height: 38px; isolation: isolate; }
.ai-orb::before, .ai-think-orb::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(0,0,0,0) 46%, #6fa0ff 58%, #3f6fe0 70%, rgba(40,80,200,.25) 84%, rgba(0,0,0,0) 100%); filter: blur(1.2px); animation: aiBreath 2.2s ease-in-out infinite; }
.ai-orb::after, .ai-think-orb::after { content: ''; position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgba(90,140,255,.38) 40%, rgba(90,140,255,0) 70%); animation: aiGlow 2.2s ease-in-out infinite; z-index: -1; }
.ai-orb i { position: absolute; inset: 24%; border-radius: 50%; background: #0a1020; }
.ai-think-orb { width: 30px; height: 30px; }
@keyframes aiBreath { 0%,100% { transform: scale(.86); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes aiGlow { 0%,100% { transform: scale(.8); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes aiShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.ai-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; background: var(--bg-header, #f0f2f5); -webkit-overflow-scrolling: touch; }
.ai-msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.ai-msg.me { align-self: flex-end; background: var(--bubble-out, #d9fdd3); color: var(--text); border-bottom-right-radius: 5px; }
.ai-msg.bot { align-self: flex-start; background: var(--bg-panel, #fff); color: var(--text); border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.ai-msg.err { background: #fde8e8; color: #9b1c1c; }
.ai-msg.hello { background: linear-gradient(135deg, rgba(63,111,224,.14), rgba(var(--accent-rgb),.12)); box-shadow: none; }
.ai-msg .ai-text b { font-weight: 650; }
.ai-msg .ai-text code { background: rgba(127,127,127,.18); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.ai-msg .ai-text pre { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: rgba(127,127,127,.16); overflow-x: auto; font-size: 12.5px; white-space: pre-wrap; }
.ai-msg .ai-li { display: block; padding-left: 4px; }
.ai-acts { display: flex; gap: 14px; margin-top: 4px; }
.ai-use { border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 12.5px; padding: 2px 0; cursor: pointer; }
/* "Thinking…" — a black pill with a breathing blue ring and shimmering text */
.ai-msg.wait { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 14px; background: radial-gradient(120% 160% at 30% 50%, #0d1a3d 0%, #04060f 70%); border-radius: 999px; box-shadow: 0 0 0 1px rgba(111,160,255,.25), 0 0 26px rgba(63,111,224,.45); opacity: 1; font-style: normal; isolation: isolate; }
.ai-think-text { font-size: 15px; font-weight: 600; letter-spacing: .2px; background: linear-gradient(90deg, #6f86c4 0%, #ffffff 25%, #9bbcff 50%, #6f86c4 75%, #ffffff 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: aiShimmer 2.4s linear infinite; text-shadow: 0 0 14px rgba(120,160,255,.45); }
.ai-foot { flex: 0 0 auto; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(127,127,127,.18); background: var(--bg-panel); }
#modalOverlay.kb .ai-foot { padding-bottom: 8px; }
#modalOverlay.kb .ai-note { display: none; }
.ai-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 8px; flex-wrap: nowrap; scrollbar-width: none; }
.ai-chips::-webkit-scrollbar { display: none; }
.ai-chips .chip { flex: 0 0 auto; white-space: nowrap; }
#modalOverlay.kb .ai-chips { display: none; }
.ai-row { display: flex; gap: 8px; align-items: center; }
.modal .ai-row input { flex: 1; min-width: 0; height: 44px; border-radius: 22px; padding: 0 16px; font-size: 16px; border: 1px solid rgba(127,127,127,.25); }
.ai-send { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #3f6fe0, var(--accent)); color: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 2px 10px rgba(63,111,224,.45); }
.ai-send:disabled { opacity: .5; }
.ai-note { margin: 6px 0 0; font-size: 11.5px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .ai-orb::before, .ai-orb::after, .ai-think-orb::before, .ai-think-orb::after, .ai-think-text { animation: none; } }

/* ---- request 29: business account — hours, shop products, product page ---- */
@media (max-width: 780px) { #sideAccount { display: none !important; } }
body.force-mobile #sideAccount { display: none !important; }
.biz-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.biz-grid > div { min-width: 0; }
@media (max-width: 420px) { .biz-grid { grid-template-columns: minmax(0, 1fr); } }
.modal select, .modal textarea { width: 100%; background: var(--bg-header); color: var(--text); border: 1px solid transparent; border-radius: 8px; outline: none; font: inherit; }
.modal select { height: 42px; padding: 0 10px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.modal textarea { padding: 10px 12px; }
.modal select:focus, .modal textarea:focus { border-color: var(--accent); }
.biz-hours small { color: var(--text-2); font-size: 11.5px; display: block; margin-bottom: 4px; }
.biz-days { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.day-chip { border: 1px solid rgba(127,127,127,.3); background: transparent; color: var(--text-2); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.day-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.biz-times { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.biz-times.dim { opacity: .4; pointer-events: none; }
.modal .check-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--text); font-size: 13.5px; }
.check-line input { width: 18px !important; height: 18px !important; accent-color: var(--accent); }
.pe-shop { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pe-prod { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--bg-header); }
.pe-prod .cat-deal-thumb { flex: 0 0 auto; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.pe-prod .mk-img { width: 100%; height: 100%; object-fit: cover; }
.pe-prod-info { flex: 1; min-width: 0; }
.pe-prod-info b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-prod-info small { color: var(--text-2); font-size: 12px; }
.pe-prod.legacy { opacity: .8; }
.pf-scroll { max-height: 62vh; overflow: auto; padding-right: 4px; }
.pf-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-bottom: 6px; }
.pf-ph, .pf-add { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-header); }
.pf-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-ph.cover { outline: 2px solid var(--accent); }
.pf-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; cursor: pointer; }
.pf-cv, .pf-mk { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); }
.pf-mk { background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.pf-add { border: 2px dashed rgba(127,127,127,.4); background: transparent; color: var(--text-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.pf-add span { font-size: 24px; }
.pf-add small { font-size: 11.5px; }
.pd-thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.pd-th { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--bg-header); cursor: pointer; }
.pd-th.on { border-color: var(--accent); }
.pd-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pd-tags span { background: var(--bg-header); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; color: var(--text-2); }
.pd-seller { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--bg-header); margin-top: 8px; }
.pd-seller-info { display: flex; flex-direction: column; gap: 2px; }
.pd-seller-info small { color: var(--text-2); font-size: 12.5px; }
.cd-shop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cd-prod { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 0; border-radius: 12px; background: var(--bg-header); padding: 6px; color: var(--text); cursor: pointer; min-width: 0; }
.cd-prod-img { display: grid; place-items: center; aspect-ratio: 1.2; border-radius: 8px; overflow: hidden; font-size: 34px; }
.cd-prod-img .mk-img { width: 100%; height: 100%; object-fit: cover; }
.cd-prod b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ==========================================================================
   Themes — app colours, chat wallpapers, call wallpapers (public/themes.js paints them)
   ========================================================================== */
#chatPanel, #callOverlay, #incomingOverlay { isolation: isolate; }
.wall-layer { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; display: none; background: var(--wl-bg, transparent); }
.wall-layer.on { display: block; }
#incomingOverlay:not(.full-mode) > .wall-layer { display: none !important; }
.wall-layer .wl-orb { position: absolute; width: 75vmax; height: 75vmax; border-radius: 50%; will-change: transform;
  background: radial-gradient(circle, var(--wl-o, transparent) 0%, transparent 62%); }
.wall-layer .wl-orb.a { left: -25vmax; top: -22vmax; --wl-o: var(--o1); animation: wlOrbA 26s ease-in-out infinite alternate; }
.wall-layer .wl-orb.b { right: -30vmax; bottom: -26vmax; --wl-o: var(--o2); animation: wlOrbB 32s ease-in-out infinite alternate; }
.wall-layer .wl-orb.c { left: 18%; top: 28%; width: 52vmax; height: 52vmax; --wl-o: var(--o3); animation: wlOrbC 38s ease-in-out infinite alternate; }
.wall-layer .wl-pat { position: absolute; inset: -360px; background-image: var(--wl-tile); background-size: 360px 360px; will-change: transform;
  animation: wlDrift 90s linear infinite; }
.wall-layer[data-flow=rise] .wl-pat { animation: wlRise 70s linear infinite; }
.wall-layer[data-flow=fall] .wl-pat { animation: wlFall 80s linear infinite; }
.wall-layer[data-flow=sway] .wl-pat { animation: wlSway 110s linear infinite; }
.wall-layer[data-flow=twinkle] .wl-pat { animation: wlTwinkle 5.5s ease-in-out infinite alternate; }
@keyframes wlDrift { to { transform: translate3d(360px, 360px, 0); } }
@keyframes wlRise { to { transform: translate3d(0, -360px, 0); } }
@keyframes wlFall { to { transform: translate3d(0, 360px, 0); } }
@keyframes wlSway { 0% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(180px, -180px, 0); } 100% { transform: translate3d(0, -360px, 0); } }
@keyframes wlTwinkle { from { opacity: .35; } to { opacity: 1; } }
@keyframes wlOrbA { to { transform: translate3d(18vmax, 14vmax, 0) scale(1.15); } }
@keyframes wlOrbB { to { transform: translate3d(-16vmax, -12vmax, 0) scale(1.12); } }
@keyframes wlOrbC { 0% { opacity: .55; transform: translate3d(0, 0, 0) scale(.9); } 100% { opacity: 1; transform: translate3d(10vmax, -8vmax, 0) scale(1.15); } }
body.wp-noanim .wall-layer *, .ap-prev.noanim .wall-layer * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .wall-layer *:not(.never) { animation: none !important; } }

body.wp-chat .msgs { background: transparent !important; }
body.wp-chat .sys-note { background: color-mix(in srgb, var(--bg-header) 88%, transparent); padding: 6px 12px; border-radius: 8px; }
body.wp-chat #chatPanel, body.wp-chat.force-mobile #chatPanel { background: var(--chat-bg) !important; }
body.wp-call #callOverlay { background-image: none !important; }
body.wp-call #incomingOverlay.full-mode:not(.hidden) { background-image: none !important; }

/* ---- the picker (Settings → Appearance) ---- */
.ap-tabs { display: flex; gap: 6px; background: var(--bg-hover); padding: 4px; border-radius: 12px; margin: 4px 0 12px; }
.ap-tabs button { flex: 1; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; padding: 9px 6px; border-radius: 9px; cursor: pointer; }
.ap-tabs button.on { background: var(--accent); color: var(--on-accent); }
.ap-prev { position: relative; isolation: isolate; overflow: hidden; border-radius: 16px; height: 168px; margin-bottom: 12px; border: 1px solid var(--line);
  background: var(--chat-bg); display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 12px 14px; }
.ap-prev.ap-classic[data-kind=chat] { background: var(--chat-bg) var(--wallpaper); background-size: 360px; }
.ap-prev.ap-classic[data-kind=call] { background: #0b141a url("/wallpaper-dark.svg"); background-size: 360px; }
.ap-prev .pv-b { max-width: 70%; padding: 7px 11px; border-radius: 12px; font-size: 13px; line-height: 1.35; background: var(--bubble-in); color: var(--bubble-text); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.ap-prev .pv-b.out { align-self: flex-end; background: var(--bubble-out); }
.ap-prev .pv-call { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #e9edef; }
.ap-prev .pv-call i { width: 74px; height: 74px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 28px var(--font); font-style: normal; box-shadow: 0 10px 28px rgba(0,0,0,.4); }
.ap-prev .pv-call small { color: #aebac1; font-size: 12px; }
.ap-prev .pv-ui { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ap-prev .pv-ui .pv-bar { background: var(--bg-header); padding: 9px 14px; font-weight: 700; color: var(--accent); }
.ap-prev .pv-ui .pv-body { flex: 1; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; background: var(--chat-bg); }
.ap-prev .pv-ui .pv-btn { align-self: flex-start; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 12px; padding: 6px 14px; border-radius: 999px; }
.ap-cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.ap-cats::-webkit-scrollbar { display: none; }
.ap-cats button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--bg-panel); color: var(--text-2); font: inherit; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.ap-cats button.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; max-height: 42vh; overflow-y: auto; padding: 2px 2px 6px; }
.ap-card { position: relative; border: 2px solid transparent; background: transparent; border-radius: 14px; padding: 0; cursor: pointer; text-align: center; font: inherit; color: var(--text); }
.ap-card .ap-th { display: block; height: 96px; border-radius: 12px; border: 1px solid var(--line); background-color: var(--bg-hover); }
.ap-card.app .ap-th { display: grid; place-items: center; background: var(--bg-hover); }
.ap-card.app .ap-th i { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(145deg, var(--pv2), var(--pv)); box-shadow: 0 6px 14px -4px var(--pv); }
.ap-card b { display: block; font-size: 11.5px; font-weight: 600; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-card.on { border-color: var(--accent); }
.ap-card.on::after { content: '✓'; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.ap-card.locked .ap-th { filter: grayscale(.55) brightness(.8); }
.ap-card.locked::before { content: '🔒'; position: absolute; top: 6px; left: 6px; z-index: 1; font-size: 13px; background: rgba(0,0,0,.55); border-radius: 8px; padding: 2px 5px; }
.ap-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ap-hint { font-size: 12px; color: var(--text-3); margin: 6px 0 0; line-height: 1.5; }

/* ===================== Feed (Updates tab, below the status circles) ===================== */
.feed-box { padding: 6px 0 90px; border-top: 8px solid var(--bg-app); margin-top: 8px; }
.feed-head { padding: 8px 14px 2px; position: sticky; top: 0; z-index: 3; background: var(--bg-panel); }
.feed-tabs { display: flex; gap: 6px; margin: 4px 0 8px; }
.feed-tabs button { flex: 1; background: transparent; color: var(--text-2); border: 0; border-bottom: 2px solid transparent; padding: 9px 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.feed-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.feed-bar { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.feed-me { flex: 1; font-size: 12.5px; color: var(--text-2); }
.feed-me b, .feed-prof-stats b, .fp-counts b { color: var(--text); font-weight: 700; margin-right: 3px; }
.feed-new { background: var(--accent) !important; color: var(--on-accent) !important; font-weight: 700; padding: 7px 14px !important; font-size: 13px !important; }
.feed-empty { margin: 26px 18px; text-align: center; }
.feed-foot { text-align: center; padding: 12px; }
.fp { padding: 12px 14px 8px; border-bottom: 8px solid var(--bg-app); }
.fp-head { display: flex; align-items: center; gap: 10px; }
.fp-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.fp-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fp-name b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-name small { color: var(--text-3); font-size: 12px; }
.fp-follow.on { opacity: .75; }
.fp-text { margin: 10px 0 8px; font-size: 15px; line-height: 1.5; word-break: break-word; white-space: normal; }
.fp-media { display: grid; gap: 3px; margin: 8px 0; border-radius: 12px; overflow: hidden; background: var(--bg-header); }
.fp-media.n1 { grid-template-columns: 1fr; }
.fp-media.n2, .fp-media.n3, .fp-media.n4 { grid-template-columns: 1fr 1fr; }
.fp-media img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; background: var(--bg-header); }
.fp-media.n1 img { max-height: 460px; height: auto; object-fit: contain; }
.fp-media.n2 img, .fp-media.n3 img, .fp-media.n4 img { aspect-ratio: 1 / 1; }
.fp-media.n3 img:first-child { grid-column: 1 / 3; aspect-ratio: 2 / 1; }
.fp-foot { display: flex; align-items: center; gap: 14px; padding: 4px 0 2px; font-size: 13px; color: var(--text-2); }
.fp-act { background: transparent; border: 0; color: var(--text-2); cursor: pointer; font-size: 14px; padding: 6px 2px; display: inline-flex; align-items: center; gap: 4px; }
.fp-act:hover { color: var(--text); }
.fp-act.liked { color: #f0457a; }
.fp-act.small { font-size: 12px; }
.fp-ico { font-size: 18px; line-height: 1; }
.fp-exp { font-size: 11.5px; color: var(--text-3); }
.fp-note { font-size: 12px; color: #d6a21a; padding: 4px 0 6px; }
.feed-ta { width: 100%; box-sizing: border-box; background: var(--bg-header); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; resize: vertical; min-height: 90px; outline: none; }
.feed-ta:focus { border-color: var(--accent); }
.np-count { text-align: right; font-size: 11.5px; color: var(--text-3); margin: 4px 0 8px; }
.np-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.np-ph { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; background: var(--bg-header); }
.np-ph img { width: 100%; height: 100%; object-fit: cover; }
.np-ph button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.np-status { font-size: 12.5px; color: var(--text-2); min-height: 18px; margin-top: 6px; }
.np-status.err { color: #e5484d; }
.feed-comments { max-height: 46vh; overflow-y: auto; margin-bottom: 10px; }
.fc-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.fc-row .fc-main { flex: 1; word-break: break-word; }
.fc-row small { color: var(--text-3); font-size: 11.5px; }
.fc-form { display: flex; gap: 8px; align-items: center; }
.fc-form input { flex: 1; }
.feed-reasons .set-row { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); cursor: pointer; }
.fp-sheet { max-height: 78vh; overflow-y: auto; }
.fp-prof { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.fp-prof-main { display: flex; flex-direction: column; line-height: 1.3; }
.fp-prof-main b { font-size: 17px; }
.fp-prof-main small { color: var(--text-3); }
.fp-counts, .feed-prof-stats { display: flex; gap: 22px; font-size: 12.5px; color: var(--text-2); }
.fp-counts span, .feed-prof-stats span { display: flex; flex-direction: column; align-items: center; }
.feed-prof-stats { padding: 4px 18px 12px; justify-content: flex-start; }
.fp-counts { margin-bottom: 12px; }
.fp-prof-acts { display: flex; gap: 8px; margin-bottom: 8px; }
.fp-sheet-list .fp { padding-left: 0; padding-right: 0; border-bottom-width: 1px; border-bottom-color: var(--line); }
.feed-zoom { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.feed-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---- Creator Reward card (Profile tab) ---- */
.rw-card { margin: 4px 14px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-panel); display: flex; flex-direction: column; gap: 8px; }
.rw-card.hidden { display: none; }
.rw-top { display: flex; align-items: center; justify-content: space-between; color: var(--text); font-size: 15px; }
.rw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rw-grid > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rw-grid small { color: var(--text-3); font-size: 11px; }
.rw-grid b { color: var(--text); font-size: 16px; }
.rw-grid i { color: var(--text-3); font-size: 11px; font-style: normal; }
.rw-line { font-size: 12.5px; color: var(--text-2); }
.rw-line b { color: var(--text); }
.rw-card small { color: var(--text-3); font-size: 11.5px; }
.rw-why { font-size: 12px; color: var(--text-2); background: var(--bg-hover); border-radius: 10px; padding: 7px 10px; }
.rw-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rw-actions .btn-primary { margin-left: auto; padding: 8px 16px; }
.rw-note { font-size: 11.5px; color: var(--text-3); }
.rw-help { padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--text-2); }
.rw-f { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 12.5px; color: var(--text-2); }
.rw-f input, .rw-f select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-app); color: var(--text); font-size: 14px; }
.rw-sum { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.rw-sum > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-2); }
.rw-sum b { color: var(--text); text-align: right; }
.rw-list { max-height: 60vh; overflow-y: auto; }
.rw-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rw-h span { display: flex; flex-direction: column; min-width: 0; }
.rw-h small { color: var(--text-3); font-size: 11.5px; }
.rw-h b.neg { color: #d9534f; }
.rw-h3 { margin: 14px 0 2px; font-size: 13px; color: var(--text-2); }

/* ---- ads in the feed (Sponsored cards) ---- */
.fp-ad { padding: 12px 14px 8px; border-bottom: 8px solid var(--bg-app); background: var(--bg-header); position: relative; }
.fp-ad .fp-head { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; }
.fp-ad .fp-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fp-ad .fp-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-spons { color: var(--text-2); font-size: 11px; letter-spacing: .02em; }
.fp-ad-av { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent-hi, #2bd6a0), var(--accent-lo, #0e9f78)); flex: none; }
.fp-ad-media { margin: 8px -14px 0; background: #000; max-height: 420px; overflow: hidden; display: flex; justify-content: center; }
.fp-ad-media img, .fp-ad-media video { width: 100%; max-height: 420px; object-fit: contain; display: block; cursor: pointer; }
.fp-ad-bar { display: flex; align-items: center; gap: 10px; padding: 10px 0 2px; }
.fp-ad-h { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.fp-ad-h b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-ad-h small { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-ad-cta { flex: none; white-space: nowrap; }
.fp-ad-g { min-height: 60px; }

/* ---- Ads Manager (advertiser) ---- */
.am-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.am-ad { background: var(--bg-header); border-radius: 12px; padding: 12px; }
.am-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.am-top b { min-width: 0; overflow-wrap: anywhere; }
.am-sub { color: var(--text-2); display: block; margin-top: 2px; }
.am-pill { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--line); color: var(--text-2); white-space: nowrap; flex: none; }
.am-pill.st-active { background: rgba(37,211,102,.18); color: #22c55e; }
.am-pill.st-pending, .am-pill.st-review { background: rgba(245,158,11,.18); color: #f59e0b; }
.am-pill.st-rejected, .am-pill.st-stopped { background: rgba(239,68,68,.18); color: #ef4444; }
.am-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 8px; text-align: center; }
.am-nums b { display: block; font-size: 15px; }
.am-nums small { color: var(--text-2); font-size: 11px; }
.am-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.am-bar i { display: block; height: 100%; background: var(--accent, #25d366); }
.am-note { margin-top: 8px; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: rgba(245,158,11,.12); color: var(--text); }
.am-note.bad { background: rgba(239,68,68,.14); }
.am-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.am-l { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--text-2); }
.am-l small { color: var(--text-2); opacity: .8; }
.am-in { width: 100%; box-sizing: border-box; }
.am-h { margin: 18px 0 2px; font-size: 15px; }
.am-seg { display: flex; gap: 6px; }
.am-seg button { flex: 1; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: 14px; }
.am-seg button.on { border-color: var(--accent, #25d366); background: rgba(37,211,102,.12); font-weight: 600; }
.am-file { display: flex; align-items: center; gap: 10px; }
.am-countries { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 8px 0; font-size: 13px; }
.am-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.am-pay { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-header); font-size: 13.5px; overflow-wrap: anywhere; }
.am-chk { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: 12.5px; color: var(--text-2); }
.am-chk input { margin-top: 3px; flex: none; }
.am-err { color: #ef4444; font-size: 13px; min-height: 18px; margin-top: 8px; }
.am-prev { margin: 0 0 6px; border: 1px solid var(--line); border-radius: 12px; }
input.am-in, select.am-in { height: 44px; padding: 0 12px; line-height: 44px; }
textarea.am-in { padding: 10px 12px; }
.am-two > div { min-width: 0; }
.am-two input { min-width: 0; max-width: 100%; }

/* ---- Instagram-style Updates tab (stories rail + feed cards) ---- */
.av-36 { width: 36px; height: 36px; font-size: 14px; }
.av-56 { width: 56px; height: 56px; font-size: 20px; }
.story-rail { display: flex; gap: 14px; overflow-x: auto; padding: 12px 14px 10px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.story-rail::-webkit-scrollbar { display: none; }
.story-cell { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.story-cell .status-ring { width: 70px; height: 70px; padding: 3px; background: linear-gradient(45deg, #f9ce34, #ee2a7b 55%, #6228d7); position: relative; }
.story-cell .status-ring.seen { background: var(--line); }
.story-cell .status-ring .avatar { width: 62px; height: 62px; border: 2px solid var(--bg-panel); box-sizing: border-box; }
.story-cell .status-ring.mine { background: none; }
.story-cell .status-ring.mine.has { background: linear-gradient(45deg, #f9ce34, #ee2a7b 55%, #6228d7); }
.story-cell .status-ring.mine::after { display: none; }
.story-plus { position: absolute; right: -1px; bottom: -1px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bg-panel); background: #0095f6; color: #fff; font-size: 16px; font-weight: 700; line-height: 1; padding: 0; display: grid; place-items: center; cursor: pointer; }
.story-name { max-width: 72px; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.story-manage { padding: 6px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.story-manage summary { cursor: pointer; padding: 4px 0; }
.feed-box { padding: 0 0 96px; border-top: 0; margin-top: 0; position: relative; }
.feed-head { display: flex; align-items: center; padding: 0 8px 0 0; border-bottom: 1px solid var(--line); background: var(--bg-panel); position: sticky; top: 0; z-index: 3; }
.feed-tabs { flex: 1; display: flex; gap: 0; margin: 0; }
.feed-tabs button { flex: 1; padding: 12px 6px; font-weight: 600; font-size: 14px; color: var(--text-3); border-bottom: 2px solid transparent; background: transparent; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.feed-tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.feed-refresh { background: transparent; border: 0; color: var(--text-2); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.feed-refresh:hover { background: var(--bg-hover); }
.feed-fab { position: sticky; bottom: 78px; float: right; margin: -62px 16px 0 0; width: 54px; height: 54px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #f9ce34, #ee2a7b 60%, #6228d7); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.35); cursor: pointer; z-index: 4; }
.feed-fab:active { transform: scale(.94); }
.fp { padding: 0; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.fp-head { padding: 10px 12px; gap: 10px; }
.fp-name b { font-size: 14px; display: flex; align-items: center; gap: 3px; }
.fp-name small { font-size: 11.5px; }
.fp-follow { background: transparent; border: 0; color: #0095f6; font-weight: 700; font-size: 13.5px; padding: 6px 4px; cursor: pointer; }
.fp-follow.on { color: var(--text-3); font-weight: 600; opacity: 1; }
.fp-more { background: transparent; border: 0; color: var(--text); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.fp-more:hover { background: var(--bg-hover); }
.fp-media { position: relative; display: block; margin: 0; border-radius: 0; background: var(--bg-header); aspect-ratio: var(--ar, 1); overflow: hidden; user-select: none; -webkit-user-select: none; }
.fp-slides { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.fp-slides::-webkit-scrollbar { display: none; }
.fp-slides img, .fp-media img { flex: 0 0 100%; width: 100%; height: 100%; max-height: none; object-fit: cover; scroll-snap-align: center; cursor: pointer; display: block; }
.fp-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.62); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 12px; pointer-events: none; }
.fp-dots { display: flex; justify-content: center; gap: 4px; padding: 8px 0 0; }
.fp-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); opacity: .45; }
.fp-dots i.on { background: #0095f6; opacity: 1; }
.fp-tc { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 28px; text-align: center; color: #fff; font-size: clamp(20px, 6vw, 30px); font-weight: 700; line-height: 1.35; word-break: break-word; overflow: hidden; user-select: none; }
.fp-heart { position: absolute; left: 50%; top: 50%; width: 86px; height: 86px; margin: -43px 0 0 -43px; color: #fff; opacity: 0; pointer-events: none; filter: drop-shadow(0 3px 10px rgba(0,0,0,.4)); transform: scale(.4); }
.fp-heart svg { width: 86px; height: 86px; }
.fp-heart.pop { animation: fpPop .85s ease-out; }
@keyframes fpPop { 0% { opacity: 0; transform: scale(.3); } 18% { opacity: 1; transform: scale(1.18); } 32% { transform: scale(.95); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
.fp-actions { display: flex; align-items: center; gap: 6px; padding: 6px 8px 0; }
.fp-act { padding: 6px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.fp-act:hover { color: var(--text-2); }
.fp-act.liked { color: #ff3040; }
.fp-act.liked svg { animation: fpLike .3s ease-out; }
@keyframes fpLike { 0% { transform: scale(.7); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.fp-likes { padding: 2px 14px 0; font-weight: 700; font-size: 14px; }
.fp-cap { padding: 3px 14px 0; font-size: 14.5px; line-height: 1.45; word-break: break-word; }
.fp-viewcm { display: block; background: transparent; border: 0; padding: 4px 14px 0; color: var(--text-3); font-size: 13.5px; cursor: pointer; text-align: left; }
.fp-meta { padding: 4px 14px 12px; font-size: 11.5px; color: var(--text-3); text-transform: none; }
.fp-note { margin: 0 14px 10px; }
.fp-share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; margin: 6px 0 12px; }
.fp-share-app { display: flex; flex-direction: column; align-items: center; gap: 6px; background: transparent; border: 0; color: var(--text); font-size: 12px; text-decoration: none; cursor: pointer; padding: 0; }
.fp-share-app i { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 800; font-size: 20px; }
.fp-share-link { background: var(--bg-header); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; color: var(--text-2); word-break: break-all; user-select: all; }
.fp-sheet-list .fp { margin-bottom: 0; }
/* sponsored cards, same look */
.fp-ad { padding: 0; border-bottom: 1px solid var(--line); margin-bottom: 6px; background: transparent; }
.fp-ad .fp-head { padding: 10px 12px; }
.fp-ad-av { width: 36px; height: 36px; font-size: 14px; }
.fp-ad .fp-text { margin: 0; padding: 0 14px 10px; }
.fp-ad-media { margin: 0; max-height: none; }
.fp-ad-media img, .fp-ad-media video { max-height: 520px; }
.fp-ad-bar { padding: 10px 14px; background: var(--bg-header); }
.fp-ad-cta { background: #0095f6 !important; color: #fff !important; font-weight: 700; padding: 7px 14px; border-radius: 8px; font-size: 13px; }
.fp-ad .fp-foot { padding: 4px 12px 8px; }
.fp-name b > * { flex: none; }

/* ---- Updates page: one centred column that fits phone, tablet and desktop ---- */
.status-pane { background: var(--bg-app); }
.status-pane > #statusStories, .status-pane > #feedBox { max-width: 600px; margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; background: var(--bg-panel); }
.status-pane > #statusStories { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.status-pane > #feedBox { border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 60vh; }
@media (max-width: 600px) {
  .status-pane > #statusStories, .status-pane > #feedBox { border-left: 0; border-right: 0; }
}
@media (min-width: 681px) {
  /* on a tablet or desktop the Updates page uses the whole width instead of a narrow list beside an empty area */
  body.view-updates:not(.force-mobile) #sidebar { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; max-width: none !important; border-right: 0 !important; background: var(--bg-app); }
  body.view-updates:not(.force-mobile) .search-wrap,
  body.view-updates:not(.force-mobile) #chips,
  body.view-updates:not(.force-mobile) #searchHint,
  body.view-updates:not(.force-mobile) #archivedRow,
  body.view-updates:not(.force-mobile) #lockedRow { display: none !important; }
  body.view-updates:not(.force-mobile) .side-head { background: var(--bg-panel); border-bottom: 1px solid var(--line); }
}
@media (min-width: 861px) {
  body.view-updates:not(.force-mobile) #chatPanel { display: none !important; }
}
@media (max-width: 860px) {
  #sidebar.view-updates .search-wrap { display: none; }
}
.fp-media img { max-height: 78vh; }
.fp-media { max-height: 78vh; }
@media (min-width: 861px) { .fp-media, .fp-media img { max-height: 680px; } }

/* ---- feeling line + live video ---- */
.live-rail { padding: 10px 0 0; border-bottom: 1px solid var(--line); background: var(--bg-panel); }
.live-rail.hidden { display: none; }
.live-rail-in { display: flex; gap: 14px; overflow-x: auto; padding: 0 14px 10px; scrollbar-width: none; }
.live-rail-in::-webkit-scrollbar { display: none; }
.live-cell { flex: 0 0 auto; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; }
.live-ring { position: relative; width: 70px; height: 70px; border-radius: 50%; padding: 3px; display: grid; place-items: center; background: linear-gradient(45deg, #ff3040, #ee2a7b 60%, #fd1d1d); }
.live-ring .avatar { width: 62px; height: 62px; border: 2px solid var(--bg-panel); box-sizing: border-box; }
.live-pill { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: #ff3040; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; border: 2px solid var(--bg-panel); }
.live-watch { font-size: 10.5px; color: var(--text-3); }
.lv-screen { position: fixed; inset: 0; z-index: 110; background: #000; color: #fff; display: flex; flex-direction: column; }
.lv-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.lv-screen video.mirror { transform: scaleX(-1); }
.lv-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 24px; background: linear-gradient(#000a, #0000); }
.lv-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lv-name { font-weight: 700; font-size: 14px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-badge { background: #ff3040; color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: .05em; }
.lv-meta { font-size: 12.5px; background: rgba(0,0,0,.45); padding: 3px 9px; border-radius: 12px; }
.lv-btn { background: rgba(0,0,0,.5); color: #fff; border: 0; border-radius: 18px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.lv-btn.round { width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 12px; }
.lv-btn.off { background: #e5383b; }
.lv-btn.send { background: #0095f6; }
.lv-end { background: #e5383b; color: #fff; border: 0; border-radius: 18px; padding: 8px 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.is-viewer .lv-end { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.55); font-size: 16px; }
.lv-msg { position: relative; z-index: 2; margin: auto; background: rgba(0,0,0,.6); padding: 10px 16px; border-radius: 12px; font-size: 14px; text-align: center; max-width: 80%; }
.lv-msg.hidden { display: none; }
.lv-feed { position: relative; z-index: 2; margin-top: auto; padding: 0 12px 8px; max-height: 34vh; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 4px; max-width: 520px; width: 100%; box-sizing: border-box; }
.lv-feed::-webkit-scrollbar { display: none; }
.lv-c { background: rgba(0,0,0,.45); padding: 5px 10px; border-radius: 12px; font-size: 14px; align-self: flex-start; max-width: 100%; word-break: break-word; }
.lv-c svg { width: 14px; height: 14px; vertical-align: -2px; }
.lv-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
.lv-bar input { flex: 1; min-width: 0; height: 42px; border-radius: 21px; border: 1px solid rgba(255,255,255,.45); background: rgba(0,0,0,.45); color: #fff; padding: 0 16px; font-size: 14.5px; }
.lv-bar input::placeholder { color: rgba(255,255,255,.7); }
.lv-prev { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 40vh; }
.lv-prev video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lv-prev video.mirror { transform: scaleX(-1); }
.set-row small { display: block; color: var(--text-3); font-weight: 400; font-size: 12px; margin-top: 2px; }
.lv-top { gap: 6px; }
.lv-who { flex: 1 1 auto; min-width: 0; }
.lv-top .grow { display: none; }
.lv-name { max-width: none; }
.lv-meta, .lv-badge, .lv-btn, .lv-end { flex: none; white-space: nowrap; }
.lv-meta { padding: 3px 8px; font-size: 12px; }
.lv-btn { padding: 7px 11px; }
.live-ring { margin-bottom: 9px; }
.lv-prev { max-height: 30vh; }
body.view-updates #btnNewChat, body.view-updates #btnMobileFab { display: none !important; }

/* ---- short video posts (Updates tab) ---- */
.fp-vid { background: #000; }
.fp-vid video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.fp-snd { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.fp-snd svg { width: 18px; height: 18px; }
.np-video { position: relative; margin-top: 8px; border-radius: 12px; overflow: hidden; background: #000; }
.np-video video { width: 100%; max-height: 260px; display: block; background: #000; }
.np-video small { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.np-video .np-vx { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }

.fp-play { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; pointer-events: none; }
.fp-vid.playing .fp-play { display: none; }

/* ---- feed: "Add to your post", extras on cards, requests ---- */
.np-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.np-chip { display: inline-flex; align-items: center; background: var(--bg-header); border-radius: 999px; overflow: hidden; font-size: 13px; max-width: 100%; }
.np-chip button { background: transparent; border: 0; color: var(--text); cursor: pointer; padding: 5px 4px 5px 11px; font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.np-chip .np-chip-x { padding: 5px 10px 5px 4px; color: var(--text-2); font-size: 16px; line-height: 1; }
.np-gifprev { flex-basis: 100%; }
.np-gifprev img { max-height: 150px; max-width: 100%; border-radius: 10px; display: block; }
.np-addbar { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 10px; }
.np-addt { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.np-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.np-ic { background: var(--bg-header); border: 1px solid transparent; border-radius: 10px; color: var(--text); padding: 7px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.np-ic span { font-size: 20px; line-height: 1.1; }
.np-ic small { font-size: 10.5px; color: var(--text-2); text-align: center; line-height: 1.15; }
.np-ic.on { border-color: var(--accent); }
.np-ic:active { transform: scale(.96); }
.np-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.np-sec-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 8px; padding-right: 28px; position: relative; }
.np-sec-h b { font-size: 14.5px; }
.np-sec-h small { flex-basis: 100%; color: var(--text-2); font-size: 12px; line-height: 1.35; }
.np-sec-x { position: absolute; right: 0; top: -2px; background: transparent; border: 0; color: var(--text-2); font-size: 20px; cursor: pointer; width: 26px; height: 26px; }
.np-sec-a { margin-top: 8px; }
.np-feels { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow-y: auto; }
.np-feel { background: var(--bg-header); border: 1px solid transparent; color: var(--text); border-radius: 999px; padding: 6px 11px; font-size: 13px; cursor: pointer; }
.np-feel.on { border-color: var(--accent); }
.pp-list { margin-top: 8px; max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pp-row { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; color: var(--text); text-align: left; padding: 6px 4px; border-radius: 10px; cursor: pointer; }
.pp-row:hover { background: var(--bg-hover); }
.pp-row:disabled { opacity: .5; cursor: default; }
.pp-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-n b { font-size: 14px; display: flex; align-items: center; gap: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-n small { color: var(--text-2); font-size: 12px; }
.pp-go { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.pp-row.on .pp-go { color: var(--text-2); }
.np-gifs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; max-height: 240px; overflow-y: auto; }
.np-gifs button { padding: 0; border: 0; background: var(--bg-header); border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1; }
.np-gifs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-ex { padding: 6px 14px 0; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.fp-ex i { opacity: .8; }
.fp-gif { aspect-ratio: auto; background: #000; }
.fp-gif img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.fp-life { display: flex; gap: 12px; align-items: center; margin: 8px 12px 0; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(0,168,132,.2), rgba(98,40,215,.2)); }
.fp-life-i { font-size: 28px; }
.fp-life b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.fp-life span { display: block; font-size: 16px; font-weight: 600; margin-top: 2px; }
.fp-life small { color: var(--text-2); font-size: 12px; }
.fp-prod { display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-panel); }
.fp-prod-img { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--bg-header); display: grid; place-items: center; font-size: 26px; flex: none; }
.fp-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.fp-prod-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fp-prod-t b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-prod-t span { font-size: 15px; font-weight: 700; color: var(--accent); }
.fp-buy { margin: 0 !important; padding: 9px 14px; white-space: nowrap; }
.fp-out { font-size: 12px; color: #e05a5a; font-weight: 600; }
.fp-cta { display: flex; gap: 8px; margin: 8px 12px 0; flex-wrap: wrap; }
.fp-cta-b { background: var(--bg-header); color: var(--text); border: 0; border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
.fp-cta-b.wa { background: #25d366; color: #06361a; }
.fp-treq { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 8px 12px 0; padding: 10px 12px; border-radius: 12px; background: rgba(0,168,132,.14); font-size: 13.5px; }
.fp-treq.ok { background: var(--bg-header); }
.fp-treq .btn-primary, .fp-treq .btn-ghost { margin: 0 0 0 6px; padding: 7px 14px; font-size: 13px; }
.feed-reqs { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; margin-right: 4px; }
.feed-reqs b { background: #fff; color: var(--accent); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.rq-list { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }
.rq-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rq-t { font-size: 14px; line-height: 1.35; min-width: 0; }
.rq-t small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.rq-a { grid-column: 1 / -1; display: flex; gap: 8px; }
.rq-a .btn-primary, .rq-a .btn-ghost { margin: 0; padding: 8px 18px; }
.pd-buy { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; }
.pd-buy-t { display: flex; flex-direction: column; min-width: 0; }
.pd-buy-t small { color: var(--text-2); }


/* ---- request 54: clean header (brand + menu only), roomy 3-dot menus, multi-select ---- */
.side-head #btnDeviceMode, .side-head #btnMobileCam, .side-head #btnInvite { display: none !important; }
.modal .modal-list { max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal .chat-menu-list { max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); }
.modal-item { padding: 13px 14px; }
.modal-item + .modal-item { border-top: 1px solid var(--line); border-radius: 0; }
.modal-item:hover { border-radius: 8px; }
.modal-overlay .modal:has(> .modal-list) .actions { position: sticky; bottom: -22px; background: var(--bg-panel); padding: 10px 0 2px; margin-top: 10px; }
.modal-overlay .modal:has(> .modal-list) .actions .btn-ghost { width: 100%; }
@media (max-width: 680px) {
  .modal-overlay .modal:not(.ai-sheet) { max-height: 92vh; max-height: 92dvh; }
  .modal-overlay .modal > h2 { padding: 0 2px; }
}
.side-head, .chat-head { position: relative; }
.sel-bar { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--bg-panel); border-bottom: 1px solid var(--line); }
.sel-bar b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-bar .sp { flex: 1; }
.sel-bar .mini-btn { height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--bg-header); color: var(--text); font-size: 13px; white-space: nowrap; cursor: pointer; }
.sel-bar .mini-btn.sel-del { background: #e5484d; border-color: #e5484d; color: #fff; }
.sel-bar .mini-btn[disabled] { opacity: .45; pointer-events: none; }
body.sel-msgs #msgs .msg { cursor: pointer; position: relative; }
body.sel-msgs #msgs .msg[id]::before { content: ''; position: absolute; left: 10px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; border: 2px solid var(--text-3); box-sizing: border-box; background: var(--bg-panel); z-index: 2; }
body.sel-msgs #msgs .msg.sel::before { content: '✓'; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 13px; line-height: 16px; text-align: center; }
body.sel-msgs #msgs .msg.sel { background: var(--accent-soft); }
body.sel-msgs #msgs .msg { padding-left: 38px; }
body.sel-msgs #msgs .msg .msg-menu-trigger, body.sel-msgs #msgs .msg .msg-actions { display: none !important; }
body.sel-chats #chatList .chat-row { cursor: pointer; }
body.sel-chats #chatList .chat-row.sel { background: var(--accent-soft); }
body.sel-chats #chatList .chat-row.sel .avatar, body.sel-chats #chatList .chat-row.sel .av { outline: 3px solid var(--accent); }
body.sel-chats #chatList .chat-row-menu-btn { display: none; }

.snap-row { padding: 4px 14px 8px; display: flex; gap: 8px; }
.snap-vid { flex: 0 0 auto; padding: 0 14px; }
.snap-btn { flex: 1 1 auto; width: 100%; height: 42px; border-radius: 21px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; }

/* ---- request 55: shared posts, share sheet, "Open post" in messages ---- */
.feed-tabs button.hidden { display: none; }
.fp-shared { margin: 0 14px 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-header); cursor: pointer; }
.fp-shared.gone { padding: 18px 14px; color: var(--text-2); font-size: 14px; text-align: center; cursor: default; }
.fp-shared-who .avatar { width: 28px; height: 28px; font-size: 12px; flex: 0 0 auto; }
.fp-shared-who { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 14px; }
.fp-shared-who small { color: var(--text-2); }
.fp-shared img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.fp-shared-vid { padding: 26px 12px; text-align: center; background: #111; color: #fff; font-weight: 600; }
.fp-shared-t { padding: 9px 12px 12px; font-size: 14.5px; line-height: 1.45; word-break: break-word; }
.dm-list { max-height: 42vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.dm-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dm-row:last-child { border-bottom: 0; }
.dm-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }
.dm-name small { color: var(--text-2); margin-left: 6px; }
.post-link { display: block; margin-top: 6px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; text-align: center; }
.modal .set-row small { display: block; color: var(--text-2); font-weight: 400; font-size: 12.5px; margin-top: 2px; }
.modal .set-row .sr-ico { font-size: 20px; width: 28px; text-align: center; }

/* ---- request 56b: the AI Assistant ring is back in the top bar (phone) ---- */
.side-head #btnAiHead { display: grid; place-items: center; }
@media (min-width: 861px) { body:not(.force-mobile) .side-head #btnAiHead { display: none; } }
