
@font-face {
  font-family: 'IRANSansWeb';
  src: url('../fonts/IRANSansWeb.ttf') format('truetype');
  font-weight: normal; font-style: normal; font-display: swap;
}

/* Mobile polish: keep header compact + make badge readable */
@media (max-width: 520px) {
  .main-header { padding: 0 12px; height: 60px; }
  .header-left { gap: 10px; }
  .header-search { width: 100%; }
  /* smaller height on mobile (requested) */
  .live-search { width: 100%; border-radius: 16px; padding: 6px 10px; font-size: 13px; height: 34px; }
  .unread-badge { --ub-size: 20px; font-size: 12px; }
}

:root {
  --bg-deep: #1c3341;
  --bg-elevated: #2a4759;
  --glass: rgba(42, 71, 89, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  --text: #f8fafc;
  --text-muted: #9baec1;
  --primary: #007aff;
  --incoming: var(--bg-elevated);
  --outgoing: var(--primary);
  --accent: #38bdf8;
  --danger: #ef4444;
  
  /* Secondary Profile Colors */
  --sec-bg: #1e293b;
  --sec-border: rgba(255, 255, 255, 0.08);
  --sec-label: #94a3b8;
  --sec-link: #3b82f6;

  --font: "IRANSansWeb", Tahoma, sans-serif;
  --chat-text-scale: 100%;
  --chat-wallpaper-image: none;
  --chat-wallpaper-overlay: linear-gradient(rgba(255,255,255,0.00), rgba(255,255,255,0.00));
}

body.has-chat-wallpaper {
  --chat-wallpaper-overlay: linear-gradient(rgba(7, 15, 24, 0.16), rgba(7, 15, 24, 0.22));
}

body[data-theme="classic"] {
  --bg-deep: #1c3341;
  --bg-elevated: #2a4759;
  --glass: rgba(42, 71, 89, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  --text: #f8fafc;
  --text-muted: #9baec1;
  --primary: #007aff;
  --incoming: #315163;
  --outgoing: #007aff;
  --accent: #38bdf8;
  --danger: #ef4444;
  --sec-bg: #1e293b;
  --sec-border: rgba(255, 255, 255, 0.08);
  --sec-label: #94a3b8;
  --sec-link: #3b82f6;
}

body[data-theme="whatsapp"] {
  --bg-deep: #ffffff;
  --bg-elevated: #ffffff;
  --glass: rgba(255, 255, 255, 0.98);
  --glass-border: rgba(17, 27, 33, 0.08);
  --glass-shadow: 0 10px 26px rgba(17, 27, 33, 0.06);
  --text: #111b21;
  --text-muted: #667781;
  --primary: #25d366;
  --incoming: #ffffff;
  --outgoing: #25d366;
  --accent: #128c7e;
  --danger: #d93025;
  --sec-bg: #ffffff;
  --sec-border: rgba(17, 27, 33, 0.08);
  --sec-label: #667781;
  --sec-link: #128c7e;
}

body[data-theme="future"] {
  --bg-deep: #07111f;
  --bg-elevated: #111f35;
  --glass: rgba(10, 19, 35, 0.78);
  --glass-border: rgba(112, 211, 255, 0.18);
  --glass-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
  --text: #f3fbff;
  --text-muted: #8eb5c8;
  --primary: #5b8cff;
  --incoming: #152641;
  --outgoing: linear-gradient(135deg, #5b8cff, #00d4ff);
  --accent: #00d4ff;
  --danger: #ff5d7a;
  --sec-bg: #0c1729;
  --sec-border: rgba(112, 211, 255, 0.16);
  --sec-label: #7aa5ba;
  --sec-link: #7be7ff;
}

body[data-theme="sunset"] {
  --bg-deep: #f3eadf;
  --bg-elevated: #fff7f2;
  --glass: rgba(255, 249, 242, 0.94);
  --glass-border: rgba(92, 57, 33, 0.14);
  --glass-shadow: 0 12px 32px rgba(84, 52, 33, 0.10);
  --text: #5e2f56;
  --text-muted: #8a6b57;
  --primary: #e26d4f;
  --incoming: linear-gradient(180deg, #ff9f68 0%, #8f4d8c 100%);
  --outgoing: linear-gradient(180deg, #9a67ea 0%, #8d5a31 100%);
  --accent: #c08a52;
  --danger: #b84c3a;
  --sec-bg: #fffaf4;
  --sec-border: rgba(92, 57, 33, 0.12);
  --sec-label: #8a6b57;
  --sec-link: #e26d4f;
}

body[data-theme="aurora"] {
  --bg-deep: #071a21;
  --bg-elevated: #0e2630;
  --glass: rgba(11, 33, 41, 0.84);
  --glass-border: rgba(102, 239, 211, 0.16);
  --glass-shadow: 0 16px 40px rgba(2, 12, 18, 0.36);
  --text: #effffd;
  --text-muted: #93c7c6;
  --primary: #13c6b3;
  --incoming: linear-gradient(180deg, #143742 0%, #102d36 100%);
  --outgoing: linear-gradient(135deg, #13c6b3 0%, #4f7cff 100%);
  --accent: #7de2d1;
  --danger: #ff6a7a;
  --sec-bg: #0c2128;
  --sec-border: rgba(102, 239, 211, 0.14);
  --sec-label: #8eb9ba;
  --sec-link: #7de2d1;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg-deep); }
body { font-family: var(--font); color: var(--text); display: flex; flex-direction: column; position: absolute; inset: 0; -webkit-font-smoothing: antialiased; }

body[data-theme="whatsapp"] { background-image: none; }
body[data-theme="future"] { background-image: radial-gradient(circle at top left, rgba(0,212,255,0.12), transparent 32%), radial-gradient(circle at bottom right, rgba(91,140,255,0.16), transparent 26%); }
body[data-theme="sunset"] { background-image: radial-gradient(circle at top left, rgba(255, 154, 85, 0.16), transparent 34%), radial-gradient(circle at bottom right, rgba(116, 82, 196, 0.14), transparent 30%), linear-gradient(180deg, #fff0e0 0%, #ffd8c4 54%, #f0d6ff 100%); }
body[data-theme="aurora"] { background-image: radial-gradient(circle at top left, rgba(125,226,209,0.12), transparent 32%), radial-gradient(circle at bottom right, rgba(79,124,255,0.14), transparent 28%), linear-gradient(180deg, #071a21 0%, #0b2028 100%); }
body[data-theme="sunset"] .glass,
body[data-theme="sunset"] .modal-card,
body[data-theme="sunset"] .full-modal-card,
body[data-theme="sunset"] .msg-popover,
body[data-theme="sunset"] .reaction-picker { box-shadow: 0 16px 36px rgba(112,72,124,0.14); }
body[data-theme="sunset"] .icon-btn,
body[data-theme="sunset"] .attach-btn,
body[data-theme="sunset"] .action-btn,
body[data-theme="sunset"] .refresh-glyph { color: var(--text); }
body[data-theme="sunset"] .main-header,
body[data-theme="sunset"] .filter-tabs,
body[data-theme="sunset"] .chat-header,
body[data-theme="sunset"] .bottom-nav { background: rgba(255,247,244,0.96); }
body[data-theme="sunset"] .live-search { background: #fff1e9; border-color: rgba(141,78,109,0.12); color: var(--text); }
body[data-theme="sunset"] .live-search-results { background: rgba(255,249,242,0.98); border-color: rgba(141,78,109,0.12); }
body[data-theme="sunset"] .ls-item:hover,
body[data-theme="sunset"] .room-item:active,
body[data-theme="sunset"] .user-item:active { background: rgba(212,106,84,0.08); }
body[data-theme="sunset"] .msg-bubble.incoming { box-shadow: 0 2px 8px rgba(118,69,120,0.16); }
body[data-theme="sunset"] .msg-bubble.outgoing { box-shadow: 0 2px 8px rgba(118,69,120,0.18); }
body[data-theme="sunset"] .filter-btn.active::after { background: #e26d4f; }
body[data-theme="aurora"] .glass,
body[data-theme="aurora"] .modal-card,
body[data-theme="aurora"] .full-modal-card,
body[data-theme="aurora"] .msg-popover,
body[data-theme="aurora"] .reaction-picker { box-shadow: 0 18px 48px rgba(2,12,18,0.38), 0 0 0 1px rgba(125,226,209,0.06) inset; }
body[data-theme="aurora"] .room-item:active,
body[data-theme="aurora"] .user-item:active { background: rgba(125,226,209,0.08); }
body[data-theme="aurora"] .filter-btn.active::after { background: #13c6b3; }
body[data-theme="future"] .glass,
body[data-theme="future"] .modal-card,
body[data-theme="future"] .full-modal-card,
body[data-theme="future"] .msg-popover,
body[data-theme="future"] .reaction-picker { box-shadow: 0 18px 50px rgba(0,0,0,0.4), 0 0 0 1px rgba(123,231,255,0.08) inset; }
body[data-theme="future"] .room-item:active,
body[data-theme="future"] .user-item:active { background: rgba(123,231,255,0.06); }
body[data-theme="whatsapp"] .ui-icon,
body[data-theme="whatsapp"] .ui-icon-small { filter: none; }
body[data-theme="whatsapp"] .icon-btn,
body[data-theme="whatsapp"] .attach-btn,
body[data-theme="whatsapp"] .action-btn { color: var(--text); }
body[data-theme="whatsapp"] .main-header,
body[data-theme="whatsapp"] .filter-tabs,
body[data-theme="whatsapp"] .chat-header,
body[data-theme="whatsapp"] .bottom-nav { background: rgba(255,255,255,0.96); }
body[data-theme="whatsapp"] .live-search { background: #f0f2f5; border-color: rgba(17,27,33,0.08); color: var(--text); }
body[data-theme="whatsapp"] .live-search-results { background: rgba(255,255,255,0.98); border-color: rgba(17,27,33,0.08); }
body[data-theme="whatsapp"] .ls-item:hover { background: rgba(17,27,33,0.04); }
body[data-theme="whatsapp"] .room-item:active,
body[data-theme="whatsapp"] .user-item:active { background: rgba(18,140,126,0.06); }
body[data-theme="whatsapp"] .msg-bubble.incoming { box-shadow: 0 1px 2px rgba(17,27,33,0.12); }
body[data-theme="whatsapp"] .msg-bubble.outgoing { box-shadow: 0 1px 2px rgba(18,140,126,0.16); }
body[data-theme="whatsapp"] .filter-btn.active::after { background: #25d366; }

.theme-picker-grid { display:grid; gap:12px; }
.theme-card { width:100%; border:1px solid var(--glass-border); background: var(--bg-elevated); border-radius: 20px; padding: 14px; cursor:pointer; text-align: right; color: var(--text); box-shadow: var(--glass-shadow); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.theme-card:hover { transform: translateY(-1px); }
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 24%, transparent), var(--glass-shadow); }
.theme-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.theme-card-title { font-size:15px; font-weight:800; }
.theme-card-sub { color: var(--text-muted); font-size:12px; margin-top:4px; }
.theme-badge { min-width: 82px; text-align:center; padding:6px 10px; border-radius:999px; background: rgba(255,255,255,0.06); font-size:11px; font-weight:800; }
.theme-card.active .theme-badge { background: color-mix(in srgb, var(--primary) 20%, transparent); color: var(--text); }
.theme-preview { display:grid; grid-template-columns: 1fr; gap:8px; padding:12px; border-radius:16px; border:1px solid rgba(255,255,255,0.06); overflow:hidden; }
.theme-preview.classic-preview { background: linear-gradient(180deg, #254154, #1c3341); }
.theme-preview.whatsapp-preview { background: linear-gradient(180deg, #f8f5ef, #efeae2); }
.theme-preview.future-preview { background: linear-gradient(180deg, #102039, #07111f); }
.theme-preview.sunset-preview { background: linear-gradient(180deg, #ffe0c4, #f0d0ff); }
.theme-preview.aurora-preview { background: linear-gradient(180deg, #0d2630, #0a1b22); }
.theme-preview.midnight-preview { background: linear-gradient(180deg, #0d1328, #070b16); }
.theme-preview.rose-preview { background: linear-gradient(180deg, #fff4f6, #f6e4df); }
.theme-topbar { height:16px; border-radius: 999px; opacity:.95; }
.theme-preview.classic-preview .theme-topbar { background:#2a4759; }
.theme-preview.whatsapp-preview .theme-topbar { background:#25d366; }
.theme-preview.future-preview .theme-topbar { background: linear-gradient(90deg, #5b8cff, #00d4ff); }
.theme-preview.sunset-preview .theme-topbar { background:#e26d4f; }
.theme-preview.aurora-preview .theme-topbar { background: linear-gradient(90deg, #13c6b3, #4f7cff); }
.theme-preview.midnight-preview .theme-topbar { background: linear-gradient(90deg, #7b61ff, #00a9ff); }
.theme-preview.rose-preview .theme-topbar { background: linear-gradient(90deg, #d68aa1, #e8b69b); }
.theme-bubbles { display:flex; flex-direction:column; gap:6px; }
.theme-bubble { height:14px; border-radius: 999px; width:72%; }
.theme-bubble.right { margin-right:auto; }
.theme-preview.classic-preview .theme-bubble.left { background:#315163; }
.theme-preview.classic-preview .theme-bubble.right { background:#007aff; }
.theme-preview.whatsapp-preview .theme-bubble.left { background:#ffffff; }
.theme-preview.whatsapp-preview .theme-bubble.right { background:#dcf8c6; }
.theme-preview.future-preview .theme-bubble.left { background:#152641; }
.theme-preview.future-preview .theme-bubble.right { background: linear-gradient(90deg, #5b8cff, #00d4ff); }
.theme-preview.sunset-preview .theme-bubble.left { background:#fff4ed; }
.theme-preview.sunset-preview .theme-bubble.right { background:#e26d4f; }

.view-main { flex: 1; display: flex; flex-direction: column; height: 100%; width: 100%; overflow: hidden; scroll-behavior: auto; background: var(--bg-deep); position: relative; }
.view-chat { position: absolute; inset: 0; z-index: 200; display: flex; flex-direction: column; background: var(--bg-deep); height: 100%; width: 100%; animation: chatSlideIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes chatSlideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
body.chat-open .bottom-nav { display: none !important; }

.page-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); display: none; opacity: 0; position: relative; z-index: 1; }
.page-content.active-page { display: block; animation: pageFadeSlide 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes pageFadeSlide { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

.ui-icon { width: 24px; height: 24px; display: block; object-fit: contain; filter: brightness(0) invert(1); }
.ui-icon-small { width: 16px; height: 16px; display: inline-block; object-fit: contain; vertical-align: middle; margin: 0 4px; filter: brightness(0) invert(1); }

.main-header { height: 64px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; background: transparent; flex-shrink: 0; flex-direction: row-reverse; position: sticky; top: 0; z-index: 1300; overflow: visible; }
.chat-header { height: 64px; padding: 0 16px; display: flex; align-items: center; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--glass-border); flex-shrink: 0; position: relative; z-index: 1000; width: 100%; }

.header-content { display: flex; align-items: center; width: 100%; height: 100%; gap: 8px; overflow: hidden; }
.chat-meta-click { display: flex; align-items: center; gap: 12px; flex: 1; height: 100%; cursor: pointer; overflow: hidden; padding: 4px; }
.chat-avatar { width: 42px; height: 42px; min-width: 42px; border-radius: 50%; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 700; color: #fff; flex-shrink: 0; border: 1px solid var(--glass-border); }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.chat-info { display: flex; flex-direction: column; justify-content: center; flex: 1; min-width: 0; align-items: flex-start; }
.chat-name, .chat-type { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; direction: rtl; }
.chat-name { font-weight: 700; font-size: 15px; color: var(--text); }
.chat-type { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.brand-text { font-weight: 700; font-size: 19px; color: var(--text); letter-spacing: 0.5px; -webkit-text-stroke: 0.3px var(--text); }

/* Live search in header */
.header-left { display:flex; align-items:center; gap:12px; flex: 1; min-width: 0; }
.header-search { position: relative; display:flex; align-items:center; flex: 1; min-width: 0; margin-top: 10px; }
.live-search {
  /* full width on desktop header area (requested) */
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 14px;
  /* smaller height on desktop too */
  /* a bit shorter (requested) */
  padding: 6px 10px;
  box-sizing: border-box;
  height: 36px;
  outline: none;
  font-family: inherit;
  font-size: 13px;
}
.live-search:focus { border-color: rgba(255,255,255,0.22); }
.live-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(14,18,24,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  z-index: 9999;
  max-height: 320px;
  overflow-y: auto;
}
.ls-item { display:flex; align-items:center; gap:10px; padding: 10px 12px; cursor:pointer; }
.ls-item:hover { background: rgba(255,255,255,0.06); }
.ls-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.08); overflow:hidden; display:flex; align-items:center; justify-content:center; font-weight:800; }
.ls-avatar img { width:100%; height:100%; object-fit:cover; }
.ls-meta { display:flex; flex-direction:column; min-width:0; }
.ls-title { font-weight:700; font-size: 13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ls-sub { font-size: 12px; color: var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Sections in chats list */
.room-section-title {
  padding: 10px 16px;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.filter-tabs { display: flex; padding: 0 20px; gap: 24px; height: 56px; align-items: center; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--glass-border); position: sticky; top: 0; z-index: 900; flex-shrink: 0; }
.filter-btn { background: none; border: none; color: var(--text-muted); font-family: inherit; font-weight: 600; font-size: 14px; padding: 16px 0; cursor: pointer; position: relative; transition: color 0.2s ease; }
.filter-btn.active { color: var(--text); font-weight: 700; }
.filter-btn.active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: var(--primary); border-radius: 4px 4px 0 0; }

.room-item, .user-item { display: flex; align-items: center; padding: 12px 20px; cursor: pointer; height: 76px; transition: background 0.2s ease; }
.room-item:active, .user-item:active { background: rgba(255,255,255,0.05); }
.room-avatar, .user-avatar { position: relative; width: 50px; height: 50px; border-radius: 50%; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; margin-left: 14px; flex-shrink: 0; overflow: hidden; color: var(--text); border: 1px solid var(--glass-border); }
.room-avatar img, .user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-info, .user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid rgba(255,255,255,0.03); padding-bottom: 14px; padding-top: 14px; height: 100%; }
.part-name { font-weight: 700; font-size: 16px; color: var(--text); margin-bottom: 4px; }
.part-bio { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-top { display: flex; justify-content: space-between; margin-bottom: 6px; align-items: center; }
.room-name { font-weight: 700; font-size: 16px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; }
.room-kind-icon{ width:14px; height:14px; vertical-align:-2px; margin-left:6px; opacity:0.9; }

.room-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.room-msg { font-size: 14px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 12px; }

/* Ensure unread badge is always visible (fix: badge could be pushed out in RTL/desktop) */
.room-msg { flex: 1; min-width: 0; }
.room-badge { flex-shrink: 0; }
.room-top { gap: 10px; }

/* Telegram-like unread badge (minimal + responsive) */
.unread-badge {
  --ub-size: 18px;
  min-width: var(--ub-size);
  height: var(--ub-size);
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,79,79,0.96), rgba(220,36,36,0.96));
  box-shadow: 0 6px 16px rgba(220, 36, 36, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 1;
  flex-shrink: 0;
}
.unread-badge.avatar-badge{ display:none; 
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 5px;
  transform: translateZ(0);
  z-index: 2;
}

.unread-badge.pulse { animation: unreadPulse 360ms ease-out; }

.mention-suggestions{position:absolute;left:0;right:0;bottom:calc(100% + 10px);display:flex;flex-direction:column;gap:4px;max-height:220px;overflow:auto;padding:8px;background:var(--bg-elevated);border:1px solid var(--glass-border);border-radius:18px;box-shadow:var(--glass-shadow);z-index:1305}
.mention-suggestion-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:14px;cursor:pointer;transition:background .18s ease}
.mention-suggestion-item:hover,.mention-suggestion-item.active{background:rgba(255,255,255,.08)}
.mention-suggestion-avatar{width:34px;height:34px;flex-shrink:0;border-radius:50%;overflow:hidden;background:rgba(255,255,255,.08);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700}
.mention-suggestion-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.mention-suggestion-meta{min-width:0;display:flex;flex-direction:column;gap:2px}
.mention-suggestion-name{font-size:13px;font-weight:700;display:flex;align-items:center;gap:4px;min-width:0}
.mention-suggestion-sub{font-size:11px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:ltr;text-align:right}
.unread-badge.mention-badge{min-width:var(--ub-size);padding:0 6px;font-weight:900;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.msg-row.mention-flash .msg-bubble{animation:mentionFlash 1.6s ease}
@keyframes mentionFlash{0%{box-shadow:0 0 0 0 rgba(255,204,0,.38);transform:translateY(0)}35%{box-shadow:0 0 0 10px rgba(255,204,0,0);transform:translateY(-1px)}100%{box-shadow:none;transform:translateY(0)}}
@keyframes unreadPulse { 0% { transform: scale(1); } 45% { transform: scale(1.16); } 100% { transform: scale(1); } }

.badge { background: var(--primary); color: #fff; font-size: 11px; min-width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; padding: 0 6px; border-radius: 11px; font-weight: 800; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4); }
.room-badge:not(:empty) { margin-right: 8px; }

/* Bottom nav labels: keep in one line on desktop (fix: "پنل ادمین" wrapping) */
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (min-width: 900px){
  .bottom-nav .nav-label { font-size: 11px; }
}

.messages-area { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 20px calc(156px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; overscroll-behavior-y: contain; overflow-anchor: none; contain: none; transform: translateZ(0); backface-visibility: hidden; background-image: var(--chat-wallpaper-overlay), var(--chat-wallpaper-image); background-size: cover; background-position: center; background-attachment: scroll; touch-action: pan-y; }
@media (min-width: 1024px) {
  .messages-area, .rooms-list, .users-list, .saved-list {
    -webkit-overflow-scrolling: auto;
    scroll-behavior: auto;
    overscroll-behavior-y: none;
  }
}

.room-list, .user-list, .saved-list { position: relative; z-index: 1; min-height: 100%; }
.msg-row, .msg-container, .msg-bubble, .msg-reactions { overflow: visible; }
.msg-row:last-child { padding-bottom: 10px; }
body.chat-open .scroll-down-fab { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 1202; }
.msg-row { width: 100%; max-width: 100%; min-width: 0; display: flex; margin-bottom: 4px; overflow-x: clip; }
.msg-row.unread-message, .msg-row[data-unread="1"] { }
.msg-row.first-unread-message { margin-top: 22px; }
.msg-row.unread-message .msg-bubble, .msg-row[data-unread="1"] .msg-bubble { border: 1.5px solid rgba(239, 68, 68, 0.92) !important; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.14), 0 8px 22px rgba(239, 68, 68, 0.12); }
.msg-unread-separator { display:flex !important; align-items:center; justify-content:center; width:100%; max-width:100%; min-width:0; flex:0 0 auto; gap:10px; margin: 20px 0 14px; color:#ef4444; font-weight:900; font-size:12px; letter-spacing:.08em; text-transform:uppercase; direction:ltr; position:relative; z-index:25; pointer-events:none; }
.msg-unread-separator::before, .msg-unread-separator::after { content:''; flex:1 1 auto; min-width:12px; height:1px; background: linear-gradient(90deg, rgba(239,68,68,0.0), rgba(239,68,68,0.72), rgba(239,68,68,0.0)); }
.msg-unread-separator span { display:inline-flex; align-items:center; justify-content:center; white-space:nowrap; flex:0 0 auto; padding:8px 16px; border-radius:10px; background: rgba(239,68,68,0.24); border:1px solid rgba(239,68,68,0.58); box-shadow: 0 10px 22px rgba(239,68,68,0.20); }
@media (max-width: 768px){ .msg-row.first-unread-message { margin-top: 20px; } .msg-unread-separator { margin: 18px 0 12px; font-size:12px; gap:8px; position:relative; left:0; right:0; } .msg-unread-separator span { padding:8px 14px; min-height:34px; } }
html[dir="rtl"] .msg-row.me { justify-content: flex-start; direction: rtl; } 
html[dir="rtl"] .msg-row.other { justify-content: flex-start; direction: ltr; } 

html[dir="rtl"] .msg-row.other .msg-container { direction: rtl; text-align: right; } 
html[dir="rtl"] .msg-row.other .mavatar { margin-left: 0; margin-right: 10px; align-self: flex-end; } 

.msg-container { max-width: min(82%, 100%); min-width: 0; display: flex; flex-direction: column; }
.msg-row.other .msg-container { max-width: min(calc(100% - 46px), 76%); }
.is-dm .msg-row.other .msg-container { max-width: min(82%, 100%); }
.msg-bubble { padding: 10px 14px; position: relative; min-width: 70px; max-width: 100%; box-shadow: 0 2px 8px rgba(0,0,0,0.1); cursor: pointer; word-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; font-size: calc(15px * var(--chat-text-scale) / 100); line-height: 1.5; }

html[dir="rtl"] .msg-row.me .msg-bubble { background: var(--outgoing); color: #fff; border-radius: 18px 18px 4px 18px; }
html[dir="rtl"] .msg-row.other .msg-bubble { background: var(--incoming); color: var(--text); border-radius: 18px 18px 18px 4px; border: 1px solid rgba(255,255,255,0.05); }

.mavatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-elevated); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; border: 1px solid var(--glass-border); }
.mavatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.is-dm .msg-row.other .mavatar { display: none; }
.msg-row.me .mavatar { display: none; }

.msg-name { font-size: calc(12px * var(--chat-text-scale) / 100); color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.msg-body { white-space: pre-wrap; margin-bottom: 2px; }
.msg-meta { font-size: calc(10px * var(--chat-text-scale) / 100); color: rgba(255,255,255,0.6); float: left; margin-top: 6px; margin-right: 12px; display: flex; align-items: center; gap: 4px; line-height: 1; direction: ltr; }
.ticks { font-size: 12px; color: #fff; letter-spacing: -1px; margin-left: 2px; }
.ticks.read { color: rgba(60, 255, 140, 0.95); }

/* minimal badges for pinned/saved inside message meta */
.msg-badges { display:inline-flex; align-items:center; gap:6px; margin-left: 6px; }
.msg-badge-icon {
  width: 14px;
  height: 14px;
  opacity: 0.92;
  filter: brightness(0) invert(1);
  transform: translateY(0.5px);
}
.msg-badge-icon.soft { opacity: 0.7; }

/* pinned bar (Telegram-like, minimal) */
.pinned-bar {
  display:none;
  padding: 10px 16px;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.pinned-bar.active { display:flex; align-items:center; gap:10px; }
.pinned-bar .pin-ico { width: 18px; height: 18px; filter: brightness(0) invert(1); opacity: 0.9; }
.pinned-bar .pin-list { display:flex; gap:10px; overflow-x:auto; flex:1; scrollbar-width:none; }
.pinned-bar .pin-list::-webkit-scrollbar { display:none; }
.pinned-chip {
  flex: 0 0 auto;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.pinned-chip:active { transform: scale(0.98); background: rgba(255,255,255,0.06); }
.pinned-chip .pc-title { font-weight: 800; font-size: 12px; color: var(--text); white-space: nowrap; overflow:hidden; text-overflow:ellipsis; }
.pinned-chip .pc-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow:hidden; text-overflow:ellipsis; margin-top: 2px; direction: rtl; }
.edited-text { font-size: 10px; font-style: italic; color: rgba(255,255,255,0.6); padding-right: 4px; }

.reply-embed { border-right: 3px solid #fff; background: rgba(0,0,0,0.15); padding: 6px 10px; border-radius: 6px; margin-bottom: 8px; font-size: calc(13px * var(--chat-text-scale) / 100); cursor: pointer; overflow: hidden; transition: background 0.2s; }

.chat-thumbnail { max-width: 180px; max-height: 180px; min-width: 80px; min-height: 80px; object-fit: cover; border-radius: 12px; cursor: pointer; display: block; margin-top: 6px; background-color: var(--bg-deep); border: 1px solid var(--glass-border); }
.voice-player { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.15); padding: 6px 12px; border-radius: 20px; margin-top: 4px; min-width: 200px; }
.vp-play { width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.vp-play .ui-icon-small { filter: none; } 
html[dir="rtl"] .msg-row.other .vp-play { background: var(--primary); }
html[dir="rtl"] .msg-row.other .vp-play .ui-icon-small { filter: brightness(0) invert(1); }
.vp-waveform { flex: 1; height: 4px; background: rgba(255, 255, 255, 0.2); border-radius: 2px; position: relative; overflow: hidden; cursor: pointer; direction: ltr; }
.vp-progress { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: #fff; border-radius: 2px; transition: width 0.1s linear; pointer-events: none; }
html[dir="rtl"] .msg-row.other .vp-progress { background: var(--primary); }
.vp-time { font-size: 11px; font-weight: 700; min-width: 32px; text-align: center; color: var(--text); opacity: 0.8; direction: ltr; }
.voice-player, .audio-file-card, .chat-video-card, .file-attachment-trigger, .file-attachment-card { max-width: 100%; min-width: 0; }
.voice-player { width: 100%; min-width: 0; gap: 10px; }
.vp-main { flex: 1 1 auto; min-width: 0; }
.vp-top { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; margin-bottom:6px; }
.vp-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vp-speed, .vp-skip { flex-shrink: 0; }
.audio-file-card audio, .file-attachment-trigger { max-width: 100%; }
.chat-video-thumb { max-width: min(100%, 236px); display:block; }
.file-attachment-card, .msg-file-card { width: min(100%, 236px); }
@media (max-width: 640px) {
  .msg-row.other .msg-container { max-width: min(calc(100% - 42px), 72vw); }
  .chat-video-thumb { max-width: min(100%, 220px); }
  .file-attachment-card, .msg-file-card { width: min(100%, 220px); }
}

.composer-wrapper { background: transparent; padding: 8px 16px 16px 16px; position: sticky; bottom: 0; z-index: 1201; display: flex; flex-direction: column; pointer-events: none; flex-shrink: 0; }
.composer-inner, .composer-context, .read-only-banner { pointer-events: auto; }
.read-only-banner { background: var(--bg-elevated); color: var(--text-muted); text-align: center; padding: 12px; border-radius: 16px; font-size: calc(14px * var(--chat-text-scale) / 100); font-weight: 600; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.composer-inner { display: flex; align-items: flex-end; background: var(--bg-elevated); border-radius: 28px; padding: 6px; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.composer-context { background: var(--bg-elevated); margin-bottom: 8px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; border-radius: 16px; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.action-btn, .attach-btn { border: none; flex-shrink: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s, opacity 0.2s; width: 44px; height: 44px; border-radius: 50%; }
.input-container { position: relative; flex: 1; display: flex; align-items: center; background: transparent; min-height: 44px; padding-bottom: 2px; margin-left: 12px; transition: margin 0.3s ease; }
#msgInput { width: 100%; background: transparent; border: none; color: var(--text); resize: none; outline: none; padding: 10px 12px; font-family: inherit; font-size: calc(15px * var(--chat-text-scale) / 100); max-height: 120px; line-height: 1.5; }
#msgInput::placeholder { color: var(--text-muted); }
.send-btn, .mic-btn { background-color: var(--primary) !important; width: 44px; height: 44px; border-radius: 50% !important; box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4); }
.send-btn:not(:disabled):active, .mic-btn:active { transform: scale(0.92); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; background-color: var(--bg-elevated) !important; }

.bottom-nav { position: fixed; bottom: 20px; left: 20px; right: 20px; height: 64px; border-radius: 32px; background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); display: flex; align-items: center; z-index: 1600; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); flex-direction: row-reverse; justify-content: space-evenly; isolation: isolate; }
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); text-decoration: none; border: none; background: none; cursor: pointer; transition: color 0.2s, transform 0.2s; padding: 0 16px; }
.nav-item.active { color: var(--text); }
.nav-item:active { transform: scale(0.9); }
.nav-label { font-size: 11px; font-weight: 700; margin-top: 4px; font-family: var(--font); }
.nav-avatar { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); color: #fff; font-size: 12px; border: 1px solid var(--glass-border); }
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.icon-btn { background: none; border: none; padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background 0.2s; width: 44px; height: 44px; }
.icon-btn:hover { background: rgba(255,255,255,0.05); }
.icon-btn-small { background: none; border: none; padding: 6px; cursor: pointer; border-radius: 50%; transition: background 0.2s; }
.icon-btn-small:hover { background: rgba(255,255,255,0.05); }
.popup-menu { position: absolute; top: 60px; right: 20px; background: var(--bg-elevated); border: 1px solid var(--glass-border); border-radius: 16px; width: 220px; padding: 8px; display: flex; flex-direction: column; z-index: 99999; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.popup-item, a.popup-item { text-decoration: none !important; background: transparent; border: 0; color: var(--text); text-align: right; padding: 12px; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 500; transition: background 0.2s; display: flex; align-items: center; gap: 8px; }
.popup-item:hover { background: rgba(255,255,255,0.05); }
.msg-popover { position: fixed; background: var(--bg-elevated); border: 1px solid var(--glass-border); border-radius: 14px; padding: 6px; z-index: 99999; box-shadow: var(--glass-shadow); display: none; width: min(240px, calc(100vw - 16px)); max-height: min(68vh, 420px); overflow: hidden; }
.msg-popover-inner { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-left: 2px; max-height: calc(min(68vh, 420px) - 12px); scrollbar-width: thin; }
.msg-popover-inner::-webkit-scrollbar{width:6px}.msg-popover-inner::-webkit-scrollbar-thumb{background:rgba(128,128,128,.45);border-radius:999px}
.pop-btn { background: transparent; border: 0; color: var(--text); padding: 12px 16px; border-radius: 10px; font-family: inherit; font-size: 14px; text-align: right; cursor: pointer; width: 100%; flex: 0 0 auto; }
.pop-btn:hover { background: rgba(255,255,255,0.05); }
.text-danger { color: var(--danger) !important; }

.modal, .full-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop, .full-modal { background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); }
.modal-card { width: 90%; max-width: 400px; background: var(--bg-deep); border-radius: 20px; border: 1px solid var(--glass-border); display: flex; flex-direction: column; max-height: 80vh; z-index: 1001; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.modal-header { padding: 20px; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 18px; }
.modal-body { padding: 20px; overflow-y: auto; }

.full-modal-card { width: 90%; max-width: 380px; background: var(--bg-elevated); border-radius: 24px; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; position: relative; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.full-modal-close { position: absolute; top: 16px; left: 16px; background: rgba(255,255,255,0.05); width: 36px; height: 36px; border: none; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.full-modal-avatar { width: 110px; height: 110px; min-height: 110px; border-radius: 50%; overflow: hidden; margin-bottom: 20px; border: 3px solid var(--primary); background: var(--bg-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; font-size: 32px; font-weight: bold; }
.full-modal-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.full-modal-name { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; width: 100%; text-align: center; }
.full-modal-bio { font-size: 14px; color: var(--text-muted); text-align: center; width: 100%; }

#pageProfile { padding: 0; display: flex; flex-direction: column; height: 100%; }
.profile-static-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 30px 20px 100px 20px; width: 100%; max-width: 440px; margin: 0 auto; }

.ps-avatar { width: 130px; height: 130px; border-radius: 28px; background: var(--bg-elevated); margin-bottom: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: bold; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.3); border: 2px solid var(--glass-border); flex-shrink: 0; }
.ps-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ps-name { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 20px; text-align: center; }

.pb-box { width: 100%; background: var(--sec-bg); border: 1px solid var(--sec-border); border-radius: 20px; padding: 8px 20px; margin-bottom: 20px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.pb-row { display: flex; flex-direction: column; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.pb-row:last-child { border-bottom: none; }
.pb-label { font-size: 13px; color: var(--sec-label); font-weight: 600; margin-bottom: 6px; }
.pb-value { font-size: 15px; color: var(--text); font-weight: 700; word-break: break-word; }
.pb-link-val { color: var(--sec-link); direction: ltr; text-align: right; }

.copyable-link { cursor: pointer; transition: opacity 0.2s; }
.copyable-link:active { opacity: 0.6; }

.pb-edit-btn { width: 100%; min-height: 52px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 800; font-family: inherit; border: none; border-radius: 16px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3); flex-shrink: 0; }
.pb-edit-btn:active { transform: scale(0.96); box-shadow: 0 2px 10px rgba(0, 122, 255, 0.2); }

.scroll-down-fab { position: absolute; bottom: 85px; right: 16px; width: 44px; height: 44px; border-radius: 50%; background: var(--glass); border: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0,0,0,0.4); z-index: 150; cursor: pointer; backdrop-filter: blur(10px); }
.badge-counter { position: absolute; top: -4px; left: -4px; background: var(--primary); color: white; font-size: 10px; padding: 2px 6px; border-radius: 10px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }

@keyframes pulse-mic { 0% { transform: scale(1); } 50% { transform: scale(1.1); background-color: var(--danger); border-radius: 50%; } 100% { transform: scale(1); } }
.mic-btn.recording { animation: pulse-mic 1s infinite; background-color: var(--danger) !important; }

/* =========================================================
    استایل صفحه تنضیمات همون پروفایل
   ========================================================= */

.admin-body {
  background: var(--bg-deep);
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  position: relative;
}

.admin-shell {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  scroll-behavior: smooth;
}

.admin-top {
  position: relative;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: transparent;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.admin-top .brand {
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.5px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px 20px;
  margin: 0 16px 20px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.card h3 {
  margin-top: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.card hr {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin: 24px 0;
}

.row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.avatar.big {
  width: 110px;
  height: 110px;
  min-width: 110px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
  background: var(--bg-deep);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  margin: 0 auto;
}

.avatar.big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar.big + div {
  width: 100%;
  flex: none !important;
}

label {
  display: block;
  font-size: 13px;
  color: var(--sec-label);
  margin-bottom: 6px;
  font-weight: 600;
}

input:not([type="file"]):not([type="checkbox"]), select {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

input:not([type="file"]):not([type="checkbox"]):focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

input[type="file"] {
  width: 100%;
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
  margin-bottom: 16px;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.hint b {
  color: var(--text);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.menu {
  position: relative;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-dropdown {
  position: absolute;
  top: 50px;
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  padding: 8px;
  min-width: 160px;
  z-index: 105;
  display: flex;
  flex-direction: column;
}

.menu-dropdown .menu-item {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-align: right;
  transition: background 0.2s;
}

.menu-dropdown .menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* =========================================================
   استایل صفحه ادمین
   ========================================================= */

.grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 16px;
  font-weight: 600;
}

label.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.members-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.member-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}

.member-chip:hover, .member-chip:active {
  background: rgba(255, 255, 255, 0.08);
}

.gm-check {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.table {
  width: 100%;
  overflow-x: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.15);
  margin-bottom: 16px;
}

.table::-webkit-scrollbar { height: 6px; }
.table::-webkit-scrollbar-track { background: transparent; }
.table::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.thead, .trow {
  display: flex;
  min-width: max-content;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: center;
}

.thead {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
  font-size: 12px;
  color: var(--sec-label);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trow {
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.trow:hover { background: rgba(255, 255, 255, 0.02); }
.trow:last-child { border-bottom: none; }

.thead > div, .trow > div {
  flex: 1 0 90px; 
  padding: 0 8px;
  word-break: break-word;
}

.thead > div:last-child, .trow > div:last-child {
  flex: 0 0 180px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end; /* Align buttons to right */
}

.pill.small {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  height: auto;
  width: auto;
}

.pill.small:hover, .pill.small:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.96);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:active {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.mono {
  font-family: monospace;
  direction: ltr;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.meta {
  color: var(--text-muted);
  font-size: 12px;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s;
}

.link:active { opacity: 0.7; }

/* =========================================================
   استایل فرم لاگین
   ========================================================= */

.login-body {
  background: radial-gradient(circle at 50% 20%, var(--bg-elevated) 0%, var(--bg-deep) 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  overflow: hidden;
}

.login-card {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  animation: slideUpLogin 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes slideUpLogin {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card .brand {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #9baec1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
  font-weight: 500;
}

.login-card .alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ffb3b3;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  animation: shakeAlert 0.4s ease-in-out;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-6px); }
}

.login-card form {
  display: flex;
  flex-direction: column;
}

.login-card input {
  margin-bottom: 24px;
  background: rgba(0, 0, 0, 0.2); 
}

.login-card .btn-primary {
  margin-top: 8px;
  height: 52px;
  font-size: 16px;
}

.login-card .hint {
  text-align: center;
  margin-top: 24px;
  margin-bottom: 0;
  opacity: 0.6;
  font-size: 12px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* =========================================================
   فیکس سازی دسکتاپ
   ========================================================= */
@media (min-width: 860px) {
  
  body:not(.admin-body):not(.login-body) {
    display: flex !important;
    flex-direction: row !important;
  }

  .view-main {
    width: 380px !important;
    min-width: 380px !important;
    max-width: 380px !important;
    flex: none !important;
    border-left: 1px solid var(--glass-border);
    display: flex !important;
    position: relative;
    height: 100vh !important;
    background: var(--bg-deep);
    z-index: 10;
    overflow: hidden !important;
  }

  .bottom-nav {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important; 
    left: auto !important;   
    width: 340px !important;  
    margin: 0 !important;
    z-index: 1000 !important;
    display: flex !important; 
  }

  body.chat-open .bottom-nav {
    display: flex !important;
  }

  .view-chat {
    flex: 1 !important;
    display: flex !important;
    position: relative;
    height: 100vh !important;
    animation: none !important;
    background: radial-gradient(circle at 50% 50%, #202b36 0%, var(--bg-deep) 100%);
  }

  #backBtn { display: none !important; }

  body:not(.chat-open) .view-chat::after {
    content: 'یک گفتگو را برای شروع انتخاب کنید';
    position: absolute;
    inset: 0;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 600;
  }

  .admin-body .admin-shell {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 30px 50px !important;
    display: block !important;
  }

  .admin-body .grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 30px !important;
  }

  .page-content { padding-bottom: 120px !important; }

  .composer-wrapper {
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
    padding: 10px 20px 30px 20px;
  }
}

/* Saved Messages avatar icon */
.saved-avatar-icon{ width:60%; height:60%; object-fit:contain; opacity:0.95; }

.forward-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  opacity: 0.95;
}

.forward-badge::before {
  content: "↪";
  font-size: 13px;
}

.forward-search-wrap {
  margin-bottom: 12px;
}

.forward-search-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-main);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  font: inherit;
}

.forward-search-input:focus {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}

.forward-room-item.is-busy {
  opacity: .7;
}

.forward-picker-list, .group-members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forward-room-item, .group-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px;
  color: inherit;
  cursor: pointer;
  text-align: right;
}

.forward-room-item:hover, .group-member-item:hover {
  background: rgba(255,255,255,0.06);
}

.forward-room-item[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.fr-avatar, .gm-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.fr-avatar img, .gm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fr-meta, .gm-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.fr-title, .gm-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fr-sub, .gm-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.empty-compact {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  text-align: center;
}

/* reactions */
.reaction-picker { position: fixed; z-index: 10030; padding: 8px; border-radius: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; white-space: nowrap; width: min(92vw, 420px); max-width: min(92vw, 420px); box-shadow: 0 14px 32px rgba(0,0,0,.28); }
.reaction-rail { display: flex; align-items: center; gap: 8px; overflow-x: auto; overflow-y: hidden; flex: 1 1 auto; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; touch-action: pan-x; overscroll-behavior-x: contain; }
.reaction-rail::-webkit-scrollbar { display: none; }
.reaction-rail-nav { border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.08); color: var(--text); width: 34px; min-width: 34px; height: 34px; border-radius: 999px; display:flex; align-items:center; justify-content:center; font-size: 22px; line-height: 1; cursor: pointer; transition: opacity .2s ease, transform .15s ease, background .2s ease; }
.reaction-rail-nav:hover, .reaction-rail-nav:active { transform: scale(1.05); background: rgba(255,255,255,.14); }
.reaction-rail-nav:disabled { opacity: .38; cursor: default; transform: none; }
.reaction-option { border: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); width: 40px; min-width: 40px; height: 40px; border-radius: 999px; font-size: 21px; cursor: pointer; display:flex; align-items:center; justify-content:center; transition: transform .15s ease, background .2s ease, border-color .2s ease; }
.reaction-option:hover, .reaction-option:active { transform: scale(1.08); background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.16); }
.msg-container { display: flex; flex-direction: column; align-items: flex-start; max-width: min(82vw, 560px); }
.msg-row.me .msg-container { align-items: flex-start; }
.msg-row.other .msg-container { align-items: flex-start; }
.msg-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding-inline: 4px; }
.reaction-chip { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.06); color: var(--text); border-radius: 999px; min-height: 28px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .15s ease, background .2s ease, border-color .2s ease; }
.reaction-chip:hover, .reaction-chip:active { transform: translateY(-1px); background: rgba(255,255,255,.10); }
.reaction-chip.mine { background: rgba(10,132,255,.18); border-color: rgba(10,132,255,.45); }
.reaction-chip .emoji { font-size: 15px; line-height: 1; }
.reaction-chip .count { direction: ltr; min-width: 10px; text-align: center; }
html[dir="rtl"] .msg-row.other .reaction-chip { background: rgba(255,255,255,.08); }
html[dir="rtl"] .msg-row.other .reaction-chip.mine { background: rgba(10,132,255,.14); }

.online-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; display: inline-block; box-shadow: 0 0 0 2px rgba(34,197,94,.18); flex: 0 0 auto; }
.online-dot.inline { vertical-align: middle; }

.verified-badge,
.room-verified-badge,
.gold-verified-badge,
.gold-room-verified-badge,
.premium-badge {
  display: inline-block;
  width: 19px;
  height: 19px;
  margin-right: 6px;
  vertical-align: -3px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
  flex: 0 0 auto;
}
.verified-badge,
.room-verified-badge {
  filter: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.gold-verified-badge,
.gold-room-verified-badge,
.premium-badge {
  filter: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.chat-name .verified-badge,
.room-name .verified-badge,
.part-name .verified-badge,
.ps-name .verified-badge,
.pb-value .verified-badge,
.ls-title .verified-badge,
.msg-name .verified-badge,
#fpName .verified-badge,
.admin-user-name + .verified-badge,
.chat-name .room-verified-badge,
.room-name .room-verified-badge,
.part-name .room-verified-badge,
.ps-name .room-verified-badge,
.pb-value .room-verified-badge,
.ls-title .room-verified-badge,
.msg-name .room-verified-badge,
#fpName .room-verified-badge,
.admin-user-name + .room-verified-badge,
.chat-name .gold-verified-badge,
.room-name .gold-verified-badge,
.part-name .gold-verified-badge,
.ps-name .gold-verified-badge,
.pb-value .gold-verified-badge,
.ls-title .gold-verified-badge,
.msg-name .gold-verified-badge,
#fpName .gold-verified-badge,
.admin-user-name + .gold-verified-badge,
.chat-name .gold-room-verified-badge,
.room-name .gold-room-verified-badge,
.part-name .gold-room-verified-badge,
.ps-name .gold-room-verified-badge,
.pb-value .gold-room-verified-badge,
.ls-title .gold-room-verified-badge,
.msg-name .gold-room-verified-badge,
#fpName .gold-room-verified-badge,
.admin-user-name + .gold-room-verified-badge,
.premium-badge {
  margin-right: 6px;
}
.pill.gold {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #2f2300;
  border-color: rgba(245,158,11,.35);
  box-shadow: 0 10px 24px rgba(245,158,11,.18);
}

.pb-change-pass-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  margin-top: 10px;
  background: #e53935;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(229,57,53,.18);
}
.password-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.password-card-title {
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.password-card input {
  margin-top: 8px;
}

.compose-menu-page{padding:16px 16px 8px;display:flex;flex-direction:column;gap:10px}
.compose-hero-btn{width:100%;border:0;border-radius:16px;padding:14px 16px;font-weight:800;background:#2d6cdf;color:#fff}
.compose-hero-btn.secondary{background:#2d6cdf}
.members-pick-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;max-height:280px;overflow:auto;padding:4px 0}
.member-pick-item{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);padding:10px 12px;border-radius:14px}

#roomSettingsBtn{margin-right:auto}

.msg-list-loading{display:flex;align-items:center;justify-content:center;padding:10px 0;color:var(--text-muted);font-size:12px;}
.msg-list-loading .dot{width:6px;height:6px;border-radius:50%;background:currentColor;display:inline-block;margin:0 3px;opacity:.45;animation:msgDot 1s infinite;}
.msg-list-loading .dot:nth-child(2){animation-delay:.15s;}
.msg-list-loading .dot:nth-child(3){animation-delay:.3s;}
@keyframes msgDot{0%,80%,100%{transform:scale(.8);opacity:.35;}40%{transform:scale(1.15);opacity:1;}}

/* message info modal */
.message-info-modal { display:flex; flex-direction:column; gap:16px; }
.mi-summary { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; }
.mi-stat { border:1px solid var(--glass-border); background: rgba(255,255,255,.04); border-radius:16px; padding:14px; }
.mi-stat-label { font-size:12px; color:var(--text-muted); margin-bottom:6px; }
.mi-stat-value { font-size:20px; font-weight:800; color:var(--text); }
.mi-section { border:1px solid var(--glass-border); background: rgba(255,255,255,.03); border-radius:18px; overflow:hidden; }
.mi-section-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid rgba(255,255,255,.06); font-weight:800; gap:10px; }
.mi-section-sub { font-size:12px; color:var(--text-muted); font-weight:600; }
.mi-list { max-height:220px; overflow:auto; }
.mi-empty { padding:18px 16px; color:var(--text-muted); text-align:center; }
.mi-user { display:flex; align-items:center; gap:12px; padding:12px 16px; border-top:1px solid rgba(255,255,255,.05); }
.mi-user:first-child { border-top:0; }
.mi-user-avatar { width:42px; height:42px; min-width:42px; border-radius:50%; overflow:hidden; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; border:1px solid var(--glass-border); }
.mi-user-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.mi-user-main { min-width:0; flex:1; display:flex; flex-direction:column; gap:3px; }
.mi-user-name { font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mi-user-sub, .mi-user-time { font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mi-pill { display:inline-flex; align-items:center; justify-content:center; min-width:38px; height:32px; border-radius:999px; padding:0 10px; background:rgba(10,132,255,.16); border:1px solid rgba(10,132,255,.36); font-size:18px; }
.mi-reaction-group { padding-bottom:8px; }
.mi-reaction-head { display:flex; align-items:center; justify-content:space-between; padding:12px 16px 8px; font-weight:800; }
.mi-reaction-meta { font-size:12px; color:var(--text-muted); }
@media (max-width: 480px){ .mi-summary { grid-template-columns: 1fr; } }

html[data-theme="classic"] {
  --bg-deep: #1c3341;
  --bg-elevated: #2a4759;
  --glass: rgba(42, 71, 89, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  --text: #f8fafc;
  --text-muted: #9baec1;
  --primary: #007aff;
  --incoming: var(--bg-elevated);
  --outgoing: var(--primary);
  --accent: #38bdf8;
  --danger: #ef4444;
  --sec-bg: #1e293b;
  --sec-border: rgba(255, 255, 255, 0.08);
  --sec-label: #94a3b8;
  --sec-link: #3b82f6;
}

html[data-theme="whatsapp"] {
  --bg-deep: #ffffff;
  --bg-elevated: #ffffff;
  --glass: rgba(255,255,255,0.98);
  --glass-border: rgba(15,23,42,0.08);
  --glass-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  --text: #111b21;
  --text-muted: #667781;
  --primary: #25d366;
  --incoming: #ffffff;
  --outgoing: #25d366;
  --accent: #128c7e;
  --danger: #e5484d;
  --sec-bg: #ffffff;
  --sec-border: rgba(17, 27, 33, 0.08);
  --sec-label: #5f6c72;
  --sec-link: #128c7e;
}

html[data-theme="future"] {
  --bg-deep: #0b1020;
  --bg-elevated: #141c34;
  --glass: rgba(16, 24, 48, 0.78);
  --glass-border: rgba(124, 92, 255, 0.22);
  --glass-shadow: 0 14px 40px rgba(8, 12, 24, 0.45);
  --text: #eef2ff;
  --text-muted: #98a2c6;
  --primary: #7c5cff;
  --incoming: #141c34;
  --outgoing: linear-gradient(135deg, #7c5cff 0%, #00c2ff 100%);
  --accent: #67e8f9;
  --danger: #fb7185;
  --sec-bg: #121a31;
  --sec-border: rgba(124, 92, 255, 0.22);
  --sec-label: #a5b4fc;
  --sec-link: #67e8f9;
}

html[data-theme="sunset"] {
  --bg-deep: #f3eadf;
  --bg-elevated: #fff7f2;
  --glass: rgba(255, 249, 242, 0.94);
  --glass-border: rgba(92, 57, 33, 0.14);
  --glass-shadow: 0 12px 32px rgba(84, 52, 33, 0.10);
  --text: #5e2f56;
  --text-muted: #8a6b57;
  --primary: #e26d4f;
  --incoming: linear-gradient(180deg, #ff9f68 0%, #8f4d8c 100%);
  --outgoing: linear-gradient(180deg, #9a67ea 0%, #8d5a31 100%);
  --accent: #c08a52;
  --danger: #b84c3a;
  --sec-bg: #fffaf4;
  --sec-border: rgba(92, 57, 33, 0.12);
  --sec-label: #8a6b57;
  --sec-link: #e26d4f;
}

html[data-theme="midnight"] {
  --bg-deep: #070b16;
  --bg-elevated: #10162a;
  --glass: rgba(11, 17, 33, 0.88);
  --glass-border: rgba(123, 97, 255, 0.18);
  --glass-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  --text: #eef2ff;
  --text-muted: #a7b0d6;
  --primary: #7b61ff;
  --incoming: #171f3a;
  --outgoing: linear-gradient(135deg, #7b61ff 0%, #00a9ff 100%);
  --accent: #7dd3fc;
  --danger: #fb7185;
  --sec-bg: #0f1730;
  --sec-border: rgba(123, 97, 255, 0.18);
  --sec-label: #c7d2fe;
  --sec-link: #7dd3fc;
}

html[data-theme="rose"] {
  --bg-deep: #fff7f5;
  --bg-elevated: #fffdfb;
  --glass: rgba(255, 251, 249, 0.96);
  --glass-border: rgba(214, 138, 161, 0.16);
  --glass-shadow: 0 12px 30px rgba(161, 111, 125, 0.10);
  --text: #69454f;
  --text-muted: #9d7683;
  --primary: #d68aa1;
  --incoming: #ffffff;
  --outgoing: linear-gradient(135deg, #d68aa1 0%, #e8b69b 100%);
  --accent: #e8b69b;
  --danger: #c85d6f;
  --sec-bg: #fffaf8;
  --sec-border: rgba(214, 138, 161, 0.14);
  --sec-label: #9d7683;
  --sec-link: #c77791;
}

html[data-theme="whatsapp"] body,
html[data-theme="whatsapp"] .view-main,
html[data-theme="whatsapp"] .view-chat {
  background: #ffffff;
}
html[data-theme="future"] body,
html[data-theme="future"] .view-main,
html[data-theme="future"] .view-chat {
  background:
    radial-gradient(circle at top right, rgba(124,92,255,0.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(0,194,255,0.12), transparent 24%),
    linear-gradient(180deg, #0a1020 0%, #0f1730 100%);
}
html[data-theme="whatsapp"] .ui-icon,
html[data-theme="whatsapp"] .ui-icon-small { filter:none; opacity:.82; }
html[data-theme="whatsapp"] #attachBtn .ui-icon,
body[data-theme="whatsapp"] #attachBtn .ui-icon {
  filter: brightness(0) saturate(100%) invert(47%) sepia(78%) saturate(533%) hue-rotate(118deg) brightness(92%) contrast(88%);
  opacity: 1;
}

html[data-theme="whatsapp"] #fileLightbox .full-modal-close,
body[data-theme="whatsapp"] #fileLightbox .full-modal-close {
  background: #ebf6ef;
  border: 1px solid rgba(18,140,126,0.18);
  color: #128c7e;
}
html[data-theme="whatsapp"] #fileLightbox .full-modal-close .ui-icon,
body[data-theme="whatsapp"] #fileLightbox .full-modal-close .ui-icon {
  filter: brightness(0) saturate(100%) invert(47%) sepia(78%) saturate(533%) hue-rotate(118deg) brightness(92%) contrast(88%);
  opacity: 1;
}

html[data-theme="whatsapp"] .verified-badge,
html[data-theme="whatsapp"] .room-verified-badge,
html[data-theme="whatsapp"] .gold-verified-badge,
html[data-theme="whatsapp"] .gold-room-verified-badge,
html[data-theme="rose"] .verified-badge,
html[data-theme="rose"] .room-verified-badge,
html[data-theme="rose"] .gold-verified-badge,
html[data-theme="rose"] .gold-room-verified-badge,
body[data-theme="whatsapp"] .verified-badge,
body[data-theme="whatsapp"] .room-verified-badge,
body[data-theme="whatsapp"] .gold-verified-badge,
body[data-theme="whatsapp"] .gold-room-verified-badge,
body[data-theme="rose"] .verified-badge,
body[data-theme="rose"] .room-verified-badge,
body[data-theme="rose"] .gold-verified-badge,
body[data-theme="rose"] .gold-room-verified-badge,
.premium-badge {
  filter: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  mix-blend-mode: normal !important;
  isolation: isolate;
}

html[data-theme="whatsapp"] .msg-meta,
html[data-theme="whatsapp"] .edited-text { color: rgba(17,27,33,.6); }
html[data-theme="whatsapp"] .ticks,
body[data-theme="whatsapp"] .ticks,
html[data-theme="whatsapp"] .msg-row.me .ticks,
body[data-theme="whatsapp"] .msg-row.me .ticks,
html[data-theme="whatsapp"] .msg-row.me .ticks.read,
body[data-theme="whatsapp"] .msg-row.me .ticks.read { color: #0a84ff !important; font-weight: 900; opacity: 1; text-shadow: none; -webkit-text-stroke: 0; }
html[data-theme="whatsapp"] .pinned-bar .pin-ico,
html[data-theme="whatsapp"] .msg-badge-icon { filter:none; opacity:.75; }
html[data-theme="whatsapp"] .reply-embed,
html[data-theme="whatsapp"] .voice-player { background: rgba(17,27,33,0.06); }
html[data-theme="whatsapp"] .live-search,
html[data-theme="whatsapp"] .popup-menu,
html[data-theme="whatsapp"] .msg-popover,
html[data-theme="whatsapp"] .reaction-picker,
html[data-theme="whatsapp"] .modal-card,
html[data-theme="whatsapp"] .full-modal-card { box-shadow: 0 14px 36px rgba(17,27,33,0.12); }
html[data-theme="whatsapp"] .main-header,
html[data-theme="whatsapp"] .chat-header,
html[data-theme="whatsapp"] .filter-tabs,
html[data-theme="whatsapp"] .bottom-nav,
html[data-theme="whatsapp"] .composer-inner,
html[data-theme="whatsapp"] .composer-context,
html[data-theme="whatsapp"] .pinned-bar,
html[data-theme="whatsapp"] .popup-menu,
html[data-theme="whatsapp"] .msg-popover,
html[data-theme="whatsapp"] .reaction-picker,
html[data-theme="whatsapp"] .modal-card,
html[data-theme="whatsapp"] .full-modal-card,
html[data-theme="whatsapp"] .room-item,
html[data-theme="whatsapp"] .user-item {
  background: #ffffff;
}
html[data-theme="whatsapp"] .messages-area {
  background-color: #efeae2;
}
html[data-theme="whatsapp"] .room-item,
html[data-theme="whatsapp"] .user-item { border-bottom: 1px solid rgba(17,27,33,0.06); }
html[data-theme="whatsapp"] .msg-row.me .msg-bubble,
body[data-theme="whatsapp"] .msg-row.me .msg-bubble {
  color: #ffffff;
}
html[data-theme="whatsapp"] .msg-row.other .msg-bubble,
body[data-theme="whatsapp"] .msg-row.other .msg-bubble {
  color: #111b21;
  border: 1px solid rgba(17,27,33,0.08);
}
html[data-theme="whatsapp"] .msg-row.me .msg-meta,
html[data-theme="whatsapp"] .msg-row.me .edited-text,
body[data-theme="whatsapp"] .msg-row.me .msg-meta,
body[data-theme="whatsapp"] .msg-row.me .edited-text {
  color: rgba(255,255,255,0.88);
}
html[data-theme="whatsapp"] #msgInput,
body[data-theme="whatsapp"] #msgInput {
  color: #111b21;
  background: #ffffff;
}
html[data-theme="whatsapp"] .filter-btn.active,
body[data-theme="whatsapp"] .filter-btn.active {
  color: #128c7e;
}

html[data-theme="sunset"] body,
html[data-theme="sunset"] .view-main,
html[data-theme="sunset"] .view-chat {
  background:
    radial-gradient(circle at top left, rgba(166,121,77,0.10), transparent 28%),
    radial-gradient(circle at bottom right, rgba(120,81,48,0.10), transparent 22%),
    linear-gradient(180deg, #fff0e0 0%, #ffd8c4 54%, #f0d6ff 100%);
}
html[data-theme="sunset"] .ui-icon,
html[data-theme="sunset"] .ui-icon-small { filter: brightness(0) saturate(100%) invert(19%) sepia(24%) saturate(1115%) hue-rotate(341deg) brightness(95%) contrast(91%); opacity:.92; }
html[data-theme="sunset"] .msg-meta,
html[data-theme="sunset"] .edited-text { color: rgba(94,47,86,.72); }
html[data-theme="sunset"] .ticks { color: #fff1ea; }
html[data-theme="sunset"] .reply-embed,
html[data-theme="sunset"] .voice-player { background: rgba(94,47,86,0.08); }
html[data-theme="sunset"] .live-search,
html[data-theme="sunset"] .popup-menu,
html[data-theme="sunset"] .msg-popover,
html[data-theme="sunset"] .reaction-picker,
html[data-theme="sunset"] .modal-card,
html[data-theme="sunset"] .full-modal-card { box-shadow: 0 14px 36px rgba(112,72,124,0.14); }
html[data-theme="sunset"] .main-header,
html[data-theme="sunset"] .chat-header,
html[data-theme="sunset"] .filter-tabs,
html[data-theme="sunset"] .bottom-nav,
html[data-theme="sunset"] .composer-inner,
html[data-theme="sunset"] .composer-context,
html[data-theme="sunset"] .pinned-bar,
html[data-theme="sunset"] .popup-menu,
html[data-theme="sunset"] .msg-popover,
html[data-theme="sunset"] .reaction-picker,
html[data-theme="sunset"] .modal-card,
html[data-theme="sunset"] .full-modal-card,
html[data-theme="sunset"] .room-item,
html[data-theme="sunset"] .user-item,
html[data-theme="sunset"] .messages-area { background-color: #fff7f2; }
html[data-theme="sunset"] .room-item,
html[data-theme="sunset"] .user-item { border-bottom: 1px solid rgba(141,78,109,0.08); }
html[data-theme="sunset"] .msg-row.me .msg-bubble,
body[data-theme="sunset"] .msg-row.me .msg-bubble,
html[data-theme="sunset"] .msg-row.other .msg-bubble,
body[data-theme="sunset"] .msg-row.other .msg-bubble {
  color: #ffffff;
  border: none;
}
html[data-theme="sunset"] .msg-row.me .msg-meta,
html[data-theme="sunset"] .msg-row.me .edited-text,
body[data-theme="sunset"] .msg-row.me .msg-meta,
body[data-theme="sunset"] .msg-row.me .edited-text,
html[data-theme="sunset"] .msg-row.other .msg-meta,
html[data-theme="sunset"] .msg-row.other .edited-text,
body[data-theme="sunset"] .msg-row.other .msg-meta,
body[data-theme="sunset"] .msg-row.other .edited-text {
  color: rgba(255,255,255,0.84);
}
html[data-theme="sunset"] #msgInput,
body[data-theme="sunset"] #msgInput {
  color: #5e2f56;
  background: #fffbfb;
}
html[data-theme="sunset"] .filter-btn.active,
body[data-theme="sunset"] .filter-btn.active { color: #e26d4f; }
html[data-theme="sunset"] .refresh-glyph,
body[data-theme="sunset"] .refresh-glyph { color:#5e2f56; }
html[data-theme="sunset"] .room-pin-btn { background:#ffe6da; color:#e26d4f; }
html[data-theme="sunset"] .room-pin-state { background:#f4d8ea; color:#8f4d8c; }
html[data-theme="sunset"] .rs-block { background:#fff7f2; border-color:#f1d8e8; }
html[data-theme="sunset"] .rs-member-card { background:#fffbfb; border-color:#f1d8e8; }
html[data-theme="sunset"] .rs-member-card.selected { background:#ffe8df; border-color:#e4aac9; }
html[data-theme="sunset"] .rs-owner-card { background:#fffbfb; border-color:#f1d8e8; }
html[data-theme="sunset"] .rs-owner-badge { background:#cf6b4d; border-color:#a75165; color:#fff; }

html[data-theme="future"] .ui-icon,
html[data-theme="future"] .ui-icon-small { filter: brightness(0) saturate(100%) invert(93%) sepia(15%) saturate(484%) hue-rotate(190deg) brightness(103%) contrast(106%); }
html[data-theme="future"] .room-item:active,
html[data-theme="future"] .user-item:active { background: rgba(124,92,255,0.08); }
html[data-theme="future"] .chat-header,
html[data-theme="future"] .filter-tabs,
html[data-theme="future"] .main-header,
html[data-theme="future"] .bottom-nav,
html[data-theme="future"] .pinned-bar,
html[data-theme="future"] .modal-card,
html[data-theme="future"] .full-modal-card,
html[data-theme="future"] .popup-menu,
html[data-theme="future"] .msg-popover,
html[data-theme="future"] .reaction-picker { box-shadow: 0 14px 40px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.03); }
html[data-theme="future"] .badge,
html[data-theme="future"] .unread-badge { box-shadow: 0 10px 24px rgba(124,92,255,0.32); }
html[data-theme="future"] .chat-thumbnail { box-shadow: 0 8px 18px rgba(0,0,0,0.24); }
html[data-theme="future"] .voice-player { background: rgba(91,140,255,0.12); }
html[data-theme="future"] .vp-play { background: linear-gradient(135deg, #5b8cff, #00d4ff); box-shadow: 0 8px 20px rgba(0,0,0,0.28); }
html[data-theme="future"] .vp-play .ui-icon-small { filter: brightness(0) invert(1); opacity: 1; }

html[data-theme="aurora"] body,
html[data-theme="aurora"] .view-main,
html[data-theme="aurora"] .view-chat {
  background:
    radial-gradient(circle at top left, rgba(125,226,209,0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(79,124,255,0.16), transparent 28%),
    linear-gradient(180deg, #071a21 0%, #0d2630 100%);
}
html[data-theme="aurora"] .ui-icon,
html[data-theme="aurora"] .ui-icon-small { filter: brightness(0) saturate(100%) invert(96%) sepia(22%) saturate(563%) hue-rotate(110deg) brightness(104%) contrast(101%); }
html[data-theme="aurora"] .chat-header,
html[data-theme="aurora"] .filter-tabs,
html[data-theme="aurora"] .main-header,
html[data-theme="aurora"] .bottom-nav,
html[data-theme="aurora"] .pinned-bar,
html[data-theme="aurora"] .modal-card,
html[data-theme="aurora"] .full-modal-card,
html[data-theme="aurora"] .popup-menu,
html[data-theme="aurora"] .msg-popover,
html[data-theme="aurora"] .reaction-picker { box-shadow: 0 14px 40px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.03); }
html[data-theme="aurora"] .badge,
html[data-theme="aurora"] .unread-badge { box-shadow: 0 10px 24px rgba(19,198,179,0.26); }
html[data-theme="aurora"] .msg-meta,
html[data-theme="aurora"] .edited-text { color: rgba(219,255,249,0.74); }
html[data-theme="aurora"] .ticks { color: #a7fff1; }
html[data-theme="aurora"] .reply-embed,
html[data-theme="aurora"] .voice-player { background: rgba(19,198,179,0.10); }
html[data-theme="aurora"] .vp-play { background: linear-gradient(135deg, #13c6b3, #4f7cff); box-shadow: 0 8px 20px rgba(0,0,0,0.28); }
html[data-theme="aurora"] .vp-play .ui-icon-small { filter: brightness(0) invert(1); opacity: 1; }

html[data-theme="midnight"] body,
html[data-theme="midnight"] .view-main,
html[data-theme="midnight"] .view-chat {
  background:
    radial-gradient(circle at top left, rgba(123,97,255,0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(0,169,255,0.10), transparent 24%),
    linear-gradient(180deg, #070b16 0%, #111a34 100%);
}
html[data-theme="midnight"] .ui-icon,
html[data-theme="midnight"] .ui-icon-small { filter: brightness(0) saturate(100%) invert(95%) sepia(10%) saturate(507%) hue-rotate(193deg) brightness(103%) contrast(103%); }
html[data-theme="midnight"] .chat-header,
html[data-theme="midnight"] .filter-tabs,
html[data-theme="midnight"] .main-header,
html[data-theme="midnight"] .bottom-nav,
html[data-theme="midnight"] .pinned-bar,
html[data-theme="midnight"] .modal-card,
html[data-theme="midnight"] .full-modal-card,
html[data-theme="midnight"] .popup-menu,
html[data-theme="midnight"] .msg-popover,
html[data-theme="midnight"] .reaction-picker { box-shadow: 0 14px 40px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.03); }
html[data-theme="midnight"] .badge,
html[data-theme="midnight"] .unread-badge { box-shadow: 0 10px 24px rgba(123,97,255,0.28); }
html[data-theme="midnight"] .msg-meta,
html[data-theme="midnight"] .edited-text { color: rgba(238,242,255,0.72); }
html[data-theme="midnight"] .ticks { color: #9edbff; }
html[data-theme="midnight"] .reply-embed,
html[data-theme="midnight"] .voice-player { background: rgba(123,97,255,0.12); }
html[data-theme="midnight"] .vp-play { background: linear-gradient(135deg, #7b61ff, #00a9ff); box-shadow: 0 8px 20px rgba(0,0,0,0.28); }
html[data-theme="midnight"] .vp-play .ui-icon-small { filter: brightness(0) invert(1); opacity: 1; }

html[data-theme="rose"] body,
html[data-theme="rose"] .view-main,
html[data-theme="rose"] .view-chat {
  background:
    radial-gradient(circle at top left, rgba(255,210,223,0.40), transparent 30%),
    radial-gradient(circle at bottom right, rgba(232,182,155,0.22), transparent 26%),
    linear-gradient(180deg, #fffaf8 0%, #fff0f4 50%, #f8e8e2 100%);
}
html[data-theme="rose"] .ui-icon,
html[data-theme="rose"] .ui-icon-small { filter: brightness(0) saturate(100%) invert(28%) sepia(16%) saturate(851%) hue-rotate(295deg) brightness(93%) contrast(89%); opacity:.92; }
html[data-theme="rose"] .chat-header,
html[data-theme="rose"] .filter-tabs,
html[data-theme="rose"] .main-header,
html[data-theme="rose"] .bottom-nav,
html[data-theme="rose"] .pinned-bar,
html[data-theme="rose"] .modal-card,
html[data-theme="rose"] .full-modal-card,
html[data-theme="rose"] .popup-menu,
html[data-theme="rose"] .msg-popover,
html[data-theme="rose"] .reaction-picker { box-shadow: 0 14px 34px rgba(161,111,125,0.14); }
html[data-theme="rose"] .msg-meta,
html[data-theme="rose"] .edited-text { color: rgba(105,69,79,0.70); }
html[data-theme="rose"] .ticks { color: #fff5f0; }
html[data-theme="rose"] .reply-embed,
html[data-theme="rose"] .voice-player { background: rgba(214,138,161,0.08); }
html[data-theme="rose"] .room-item,
html[data-theme="rose"] .user-item { border-bottom: 1px solid rgba(214,138,161,0.08); }
html[data-theme="rose"] .msg-row.me .msg-bubble,
body[data-theme="rose"] .msg-row.me .msg-bubble { color: #ffffff; }
html[data-theme="rose"] .msg-row.other .msg-bubble,
body[data-theme="rose"] .msg-row.other .msg-bubble { color: #69454f; border: 1px solid rgba(214,138,161,0.10); }
html[data-theme="rose"] #msgInput,
body[data-theme="rose"] #msgInput { color: #69454f; background: #ffffff; }
html[data-theme="rose"] .filter-btn.active,
body[data-theme="rose"] .filter-btn.active { color: #c77791; }

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.theme-card {
  background: var(--sec-bg);
  border: 1px solid var(--sec-border);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.theme-card:hover, .theme-card:active { transform: translateY(-2px); }
.theme-card.active {
  border-color: var(--primary);
  box-shadow: 0 10px 28px rgba(0,0,0,0.14);
}
.theme-preview {
  height: 118px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
  position: relative;
}
.theme-preview.tp-classic { background: linear-gradient(180deg, #1c3341, #2a4759); }
.theme-preview.tp-whatsapp { background: linear-gradient(180deg, #f7f5f2, #ece5dd); }
.theme-preview.tp-future { background: linear-gradient(180deg, #0f1730, #111827); }
.theme-preview.tp-sunset { background: linear-gradient(180deg, #ffe0c4, #f0d0ff); }
.theme-preview.tp-aurora { background: linear-gradient(180deg, #0d2630, #0a1b22); }
.theme-preview.tp-midnight { background: linear-gradient(180deg, #0d1328, #070b16); }
.theme-preview.tp-rose { background: linear-gradient(180deg, #fff4f6, #f6e4df); }
.theme-preview::before { content: ''; position: absolute; inset: 10px 10px auto 10px; height: 14px; border-radius: 999px; background: rgba(255,255,255,0.18); }
.theme-preview.tp-whatsapp::before { background: rgba(18,140,126,0.18); }
.theme-preview.tp-future::before { background: rgba(103,232,249,0.18); }
.theme-preview.tp-sunset::before { background: rgba(226,109,79,0.18); }
.theme-preview.tp-aurora::before { background: rgba(19,198,179,0.18); }
.theme-preview.tp-midnight::before { background: rgba(123,97,255,0.18); }
.theme-preview.tp-rose::before { background: rgba(214,138,161,0.18); }
.theme-preview .pv-bubble { position: absolute; border-radius: 14px; height: 18px; }
.theme-preview .pv-bubble.left { left: 10px; top: 38px; width: 90px; background: rgba(255,255,255,0.86); }
.theme-preview .pv-bubble.right { right: 10px; top: 64px; width: 72px; background: rgba(255,255,255,0.22); }
.theme-preview.tp-whatsapp .pv-bubble.left { background: #fff; }
.theme-preview.tp-whatsapp .pv-bubble.right { background: #d9fdd3; }
.theme-preview.tp-future .pv-bubble.left { background: rgba(255,255,255,0.08); }
.theme-preview.tp-future .pv-bubble.right { background: linear-gradient(135deg,#7c5cff,#00c2ff); }
.theme-preview.tp-sunset .pv-bubble.left { background: linear-gradient(180deg,#ff9f68,#8f4d8c); }
.theme-preview.tp-sunset .pv-bubble.right { background: linear-gradient(180deg,#9a67ea,#8d5a31); }
.theme-preview.tp-aurora .pv-bubble.left { background: rgba(255,255,255,0.10); }
.theme-preview.tp-aurora .pv-bubble.right { background: linear-gradient(135deg,#13c6b3,#4f7cff); }
.theme-preview.tp-midnight .pv-bubble.left { background: rgba(255,255,255,0.08); }
.theme-preview.tp-midnight .pv-bubble.right { background: linear-gradient(135deg,#7b61ff,#00a9ff); }
.theme-preview.tp-rose .pv-bubble.left { background: #fffdfc; }
.theme-preview.tp-rose .pv-bubble.right { background: linear-gradient(135deg,#d68aa1,#e8b69b); }
.theme-card-title { font-size: 15px; font-weight: 800; color: var(--text); }
.theme-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.6; }
.theme-selected-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.14);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  margin-top: 10px;
}
html[data-theme="future"] .theme-selected-badge { background: rgba(124,92,255,0.14); }
html[data-theme="classic"] .theme-selected-badge { background: rgba(0,122,255,0.14); }
html[data-theme="sunset"] .theme-selected-badge { background: rgba(226,109,79,0.14); color:#e26d4f; }
html[data-theme="aurora"] .theme-selected-badge { background: rgba(19,198,179,0.14); color:#13c6b3; }
html[data-theme="midnight"] .theme-selected-badge { background: rgba(123,97,255,0.14); color:#a99bff; }
html[data-theme="rose"] .theme-selected-badge { background: rgba(214,138,161,0.14); color:#c77791; }

.room-avatar, .user-avatar, .chat-avatar, .nav-avatar, .mavatar, .ps-avatar, .full-modal-avatar { color: var(--text); }

.refresh-glyph{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  font-size:20px;
  line-height:1;
  font-weight:700;
}
html[data-theme="whatsapp"] .refresh-glyph,
body[data-theme="whatsapp"] .refresh-glyph{ color:#111b21; }
html[data-theme="future"] .refresh-glyph,
body[data-theme="future"] .refresh-glyph{ color:#dbeafe; }

.room-pin-btn{margin-inline-start:10px;width:34px;height:34px;border:none;border-radius:12px;background:rgba(255,255,255,.08);color:var(--text);font-size:16px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.room-pin-btn.active{background:rgba(93,95,239,.2);box-shadow:0 0 0 1px rgba(93,95,239,.25) inset}
.room-pin-state{display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;padding:2px 7px;border-radius:999px;background:rgba(93,95,239,.14);margin-inline-end:6px}
html[data-theme="whatsapp"] .room-pin-btn{background:#ebf6ef;color:#128c7e}
html[data-theme="whatsapp"] .room-pin-state{background:#dcf8c6;color:#128c7e}
.room-settings-sheet{display:flex;flex-direction:column;gap:14px}
.rs-block{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:14px}
.rs-block-title{font-weight:900;font-size:14px;margin-bottom:10px}
.rs-member-list{display:flex;flex-direction:column;gap:10px;max-height:360px;overflow:auto;padding-inline-end:4px}
.rs-member-card{display:flex;align-items:center;gap:12px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04);border-radius:16px;padding:10px 12px;cursor:pointer}
.rs-member-card.selected{border-color:rgba(93,95,239,.35);background:rgba(93,95,239,.08)}
.rs-member-avatar{width:42px;height:42px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.08);font-weight:800;flex:0 0 auto}
.rs-member-avatar img{width:100%;height:100%;object-fit:cover}
.rs-member-meta{min-width:0;flex:1}
.rs-member-name{font-weight:800;font-size:14px}
.rs-member-sub{font-size:12px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rs-member-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.rs-toolbar{display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap;margin-bottom:10px}
.rs-search{flex:1 1 240px;min-width:180px}
.rs-toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rs-stats{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.rs-stat-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);font-size:12px}
html[data-theme="whatsapp"] .rs-stat-chip{background:#f1f8f4;border-color:#ddeee2;color:#111b21}
html[data-theme="sunset"] .rs-stat-chip{background:#f6ede3;border-color:#e1cdb8;color:#6a365f}
.rs-owner-card{display:flex;align-items:center;gap:12px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.03);border-radius:16px;padding:10px 12px;margin-bottom:12px}
.rs-owner-badge{margin-inline-start:auto;padding:7px 12px;border-radius:999px;background:rgba(93,95,239,.16);border:1px solid rgba(93,95,239,.28);font-size:12px;font-weight:900}
.rs-check{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700}
html[data-theme="whatsapp"] .rs-block{background:#fff;border-color:#e6e6e6}
html[data-theme="whatsapp"] .rs-member-card{background:#fff;border-color:#e7e7e7}
html[data-theme="whatsapp"] .rs-member-card.selected{background:#f5fff8;border-color:#b9e7c7}
html[data-theme="whatsapp"] .rs-owner-card{background:#fff;border-color:#e7e7e7}
html[data-theme="whatsapp"] .rs-owner-badge{background:#e8f5e9;border-color:#cfe8d0;color:#1f6b35}

.pinned-bar{display:none !important;}

.ls-action-tag{margin-inline-start:auto;align-self:center;background:rgba(93,95,239,.14);border:1px solid rgba(93,95,239,.25);padding:5px 10px;border-radius:999px;font-size:12px;font-weight:800;white-space:nowrap}
.rs-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 16px;border:1px solid rgba(255,255,255,.08);border-radius:18px;background:rgba(255,255,255,.04)}
.rs-hero-title{font-weight:900;font-size:16px}
.rs-hero-sub{margin-top:4px;color:var(--text-muted);font-size:12px}
.rs-hero-badges{display:flex;gap:8px;flex-wrap:wrap}
.rs-pill{display:inline-flex;align-items:center;justify-content:center;padding:7px 11px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);font-size:12px;font-weight:800}
.rs-grid{display:grid;grid-template-columns:1fr;gap:14px}
@media (min-width: 820px){.rs-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr)}}
html[data-theme="whatsapp"] .rs-hero, html[data-theme="whatsapp"] .rs-pill{background:#fff;border-color:#e5e7eb}
html[data-theme="sunset"] .rs-hero{background:#fffbfb;border-color:#f1d8e8}
html[data-theme="sunset"] .rs-pill{background:#ffe8df;border-color:#e3c5a7;color:#6f375f}
html[data-theme="sunset"] .ls-action-tag{background:#ffe8df;border-color:#e4aac9;color:#6f375f}

.rs-flex-title{display:flex;align-items:center;justify-content:space-between;gap:10px}
.rs-count-pill{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;background:rgba(93,95,239,.12);border:1px solid rgba(93,95,239,.22);font-size:12px;font-weight:800;color:var(--text)}
.rs-member-search{width:100%;margin-bottom:12px}
.rs-member-list{display:flex;flex-direction:column;gap:10px;max-height:420px;overflow:auto;padding-right:2px}
.sticky-owner{position:sticky;top:0;z-index:2;box-shadow:0 12px 28px rgba(0,0,0,.18)}
.rs-member-card{justify-content:space-between;flex-wrap:wrap}
.rs-member-meta{flex:1 1 180px;min-width:0}
.rs-member-badges{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.rs-state-badge{display:inline-flex;align-items:center;justify-content:center;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);color:var(--text)}
.rs-state-badge.on{background:rgba(34,197,94,.15);border-color:rgba(34,197,94,.3)}
.rs-state-badge.off{background:rgba(148,163,184,.15);border-color:rgba(148,163,184,.28);color:var(--text-muted)}
.rs-state-badge.admin{background:rgba(251,191,36,.16);border-color:rgba(251,191,36,.34)}
.rs-action-btn{height:38px;padding:0 14px;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);color:var(--text);font:inherit;font-size:12px;font-weight:800;cursor:pointer}
.rs-action-btn.primary{background:linear-gradient(135deg,#5d5fef,#7c3aed);border-color:transparent;color:#fff}
.rs-action-btn.secondary{background:rgba(255,255,255,.07)}
.rs-action-btn.danger{background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.28);color:#ffd5d5}
.rs-action-btn:disabled{opacity:.55;cursor:not-allowed}
html[data-theme="whatsapp"] .rs-count-pill{background:#e9f9ef;border-color:#caebd5;color:#14532d}
html[data-theme="whatsapp"] .rs-state-badge{background:#fff;border-color:#e5e7eb;color:#1f2937}
html[data-theme="whatsapp"] .rs-state-badge.on{background:#e8fff0;border-color:#b9e7c7;color:#166534}
html[data-theme="whatsapp"] .rs-state-badge.off{background:#f8fafc;border-color:#e2e8f0;color:#64748b}
html[data-theme="whatsapp"] .rs-state-badge.admin{background:#fff7d6;border-color:#f6d66d;color:#8a5b00}
html[data-theme="whatsapp"] .rs-action-btn{background:#fff;border-color:#d7d7d7;color:#1f2937}
html[data-theme="whatsapp"] .rs-action-btn.primary{background:#22c55e;border-color:#22c55e;color:#fff}
html[data-theme="whatsapp"] .rs-action-btn.danger{background:#fff1f2;border-color:#fecdd3;color:#be123c}
html[data-theme="sunset"] .rs-count-pill{background:#efe1d2;border-color:#dbc0a6;color:#6a3458}
html[data-theme="sunset"] .rs-state-badge{background:#fffbfb;border-color:#f1d8e8;color:#6a3458}
html[data-theme="sunset"] .rs-state-badge.on{background:#e8d3bc;border-color:#cfa57f;color:#6a3458}
html[data-theme="sunset"] .rs-state-badge.off{background:#f6eee6;border-color:#f1d8e8;color:#95628c}
html[data-theme="sunset"] .rs-state-badge.admin{background:#f0dbc2;border-color:#d8b189;color:#7d3f70}
html[data-theme="sunset"] .rs-action-btn{background:#fffaf4;border-color:#dbc0a6;color:#6a3458}
html[data-theme="sunset"] .rs-action-btn.primary{background:linear-gradient(135deg,#8b5a2b,#7d3f70);border-color:#7d3f70;color:#fff}
html[data-theme="sunset"] .rs-action-btn.danger{background:#ffe7eb;border-color:#ebb2c4;color:#8d335f}

.voice-player{display:flex;align-items:center;gap:10px;background:rgba(0,0,0,.18);padding:10px 12px;border-radius:14px;margin-top:6px;max-width:280px}
.vp-main{flex:1;min-width:0}
.vp-label{font-size:12px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;color:var(--text)}
.voice-player.is-voice .vp-label{display:none}
.voice-player .vp-waveform{margin-top:0}

.pb-action-btn,
.pb-edit-btn,
.pb-change-pass-btn {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  border-radius: 16px;
  cursor: pointer;
  box-sizing: border-box;
}
.pb-action-btn + .pb-action-btn,
.pb-edit-btn + .pb-change-pass-btn,
.pb-change-pass-btn + .pb-edit-btn,
.pb-edit-btn + .pb-edit-btn { margin-top: 10px; }
.pb-change-pass-btn { min-height: 54px; }

.bulk-select-bar{
  position:fixed;
  left:12px;
  right:12px;
  bottom:calc(env(safe-area-inset-bottom, 0px) + 88px);
  z-index:10060;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:18px;
  background:rgba(10,16,30,.92);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 18px 40px rgba(0,0,0,.32);
  backdrop-filter:blur(10px);
}
.bulk-select-meta{font-size:14px;font-weight:800;color:#fff;}
.bulk-select-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.bulk-btn{
  border:0;
  border-radius:12px;
  padding:10px 14px;
  background:rgba(255,255,255,.12);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.bulk-btn.danger{background:rgba(220,53,69,.9);}
body.selection-mode .msg-bubble{cursor:pointer;}
.msg-row.selectable .msg-bubble{position:relative;padding-inline-start:44px;}
.msg-row.selectable .msg-bubble::before{
  content:'';
  position:absolute;
  inset-inline-start:14px;
  top:50%;
  width:18px;
  height:18px;
  transform:translateY(-50%);
  border-radius:50%;
  border:2px solid rgba(255,255,255,.8);
  background:transparent;
}
.msg-row.selected .msg-bubble{
  outline:2px solid var(--primary, #7c5cff);
  background:rgba(124,92,255,.16);
}
.msg-row.selected .msg-bubble::before{
  background:var(--primary, #7c5cff);
  border-color:var(--primary, #7c5cff);
  box-shadow:inset 0 0 0 4px rgba(255,255,255,.95);
}
@media (max-width:640px){
  .bulk-select-bar{flex-direction:column;align-items:stretch;bottom:calc(env(safe-area-inset-bottom, 0px) + 82px);}
  .bulk-select-actions{justify-content:space-between;}
  .bulk-btn{flex:1 1 0;}
}

.image-lightbox-trigger {
  display:block;
  border:none;
  padding:0;
  margin:0;
  background:transparent;
  cursor:pointer;
  width:100%;
  text-align:inherit;
}
.image-lightbox-trigger .chat-thumbnail { display:block; }
#imageLightbox,
#videoLightbox {
  padding: 20px;
  align-items: center;
  justify-content: center;
}
#imageLightbox .full-modal-close,
#videoLightbox .full-modal-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px) + 8px);
  left: max(16px, env(safe-area-inset-left, 0px) + 8px);
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.16);
}
#imageLightbox #lbImage,
#videoLightbox #lbVideo {
  display:block;
}
.chat-video-card{max-width:min(82vw,320px);display:flex;flex-direction:column;gap:8px}
.video-lightbox-trigger{position:relative;border:none;background:transparent;padding:0;cursor:pointer;display:block;width:100%;text-align:inherit}
.chat-video-thumb{display:block;width:100%;max-height:240px;object-fit:cover;border-radius:16px;background:#000;box-shadow:0 10px 26px rgba(0,0,0,.18)}
.chat-video-play{position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:58px;height:58px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.54);color:#fff;font-size:24px;font-weight:900;border:1px solid rgba(255,255,255,.22);pointer-events:none;box-shadow:0 10px 28px rgba(0,0,0,.28)}
.chat-video-caption{font-size:12px;line-height:1.5;opacity:.92;word-break:break-word}

/* Mobile scroll fix for profile/settings pages */
html:has(body.admin-body),
body.admin-body {
  overflow-y: auto !important;
}

@supports (-webkit-touch-callout: none) {
  body.admin-body,
  body.admin-body .admin-shell {
    transform: translateZ(0);
  }
}

html[dir="ltr"] body { direction:ltr; }
html[dir="ltr"] .main-header,
html[dir="ltr"] .bottom-nav,
html[dir="ltr"] .filter-tabs { direction:ltr; }
html[dir="ltr"] .chat-name,
html[dir="ltr"] .chat-type,
html[dir="ltr"] .room-top,
html[dir="ltr"] .room-sub,
html[dir="ltr"] .room-name,
html[dir="ltr"] .profile-static-wrapper,
html[dir="ltr"] .pb-box,
html[dir="ltr"] .pb-row,
html[dir="ltr"] .modal-body,
html[dir="ltr"] .popup-menu { direction:ltr; text-align:left; }
html[dir="ltr"] .popup-menu { right:auto; left:20px; }
html[dir="ltr"] .msg-row.me { justify-content:flex-end; direction:ltr; }
html[dir="ltr"] .msg-row.other { justify-content:flex-start; direction:ltr; }
html[dir="ltr"] .msg-row.other .msg-container,
html[dir="ltr"] .msg-row.me .msg-container { direction:ltr; text-align:left; }
html[dir="ltr"] .msg-meta { margin-right:0; margin-left:12px; }
html[dir="ltr"] .sample-bubble.in { margin-left:auto; margin-right:0; border-bottom-right-radius:6px; border-bottom-left-radius:18px; }
html[dir="ltr"] .sample-bubble.out { margin-right:auto; margin-left:0; border-bottom-left-radius:6px; border-bottom-right-radius:18px; }

.reaction-option img { width: 24px; height: 24px; object-fit: contain; display:block; }
.reaction-option-mstar { padding: 0; }
.reaction-chip-mstar { padding-inline: 8px 10px; }
.mstar-glyph { width: 18px; height: 18px; object-fit: contain; display:block; }
.mstar-request-card{margin-top:8px;padding:12px 12px 10px;border-radius:16px;border:1px solid rgba(250,204,21,.35);background:linear-gradient(180deg,rgba(250,204,21,.14),rgba(245,158,11,.08));display:flex;flex-direction:column;gap:10px}
.mstar-request-head{display:flex;align-items:center;gap:8px;font-weight:800;color:#f8d54c}
.mstar-request-icon{width:22px;height:22px;object-fit:contain;display:block}
.mstar-request-body{font-size:14px;line-height:1.9;color:var(--text-primary)}
.mstar-request-actions{display:flex;align-items:center;justify-content:flex-end}
.mstar-request-approve-btn{appearance:none;border:none;border-radius:12px;padding:10px 14px;font-weight:800;cursor:pointer;background:linear-gradient(135deg,#facc15,#f59e0b);color:#241400;box-shadow:0 8px 20px rgba(245,158,11,.28)}
.mstar-request-approve-btn:disabled{opacity:.7;cursor:wait}
.mstar-request-state{padding:8px 12px;border-radius:999px;font-size:12px;font-weight:800;background:rgba(255,255,255,.08);color:var(--text-primary)}
.mstar-request-state.approved,.mstar-request-card.approved .mstar-request-state{background:rgba(34,197,94,.18);color:#bbf7d0}
.mstar-request-state.pending,.mstar-request-card.pending .mstar-request-state{background:rgba(250,204,21,.18);color:#fde68a}

html.page-scroll-unlocked, body.page-scroll-unlocked, body.page-scroll-unlocked.admin-body, body.page-scroll-unlocked.pref-body {
  height: auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
body.page-scroll-unlocked .admin-shell,
body.page-scroll-unlocked .pref-shell {
  height: auto !important;
  max-height: none !important;
  min-height: 100dvh !important;
  overflow-y: visible !important;
  overflow-x: hidden !important;
}

.account-switcher-wrap{display:flex;flex-direction:column;gap:14px}
.account-switcher-list{display:flex;flex-direction:column;gap:10px}
.account-slot-card{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;border:1px solid var(--glass-border);border-radius:16px;background:rgba(255,255,255,.04)}
.account-slot-main{display:flex;align-items:center;gap:10px;min-width:0}
.acc-avatar{width:44px;height:44px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.08);flex:0 0 44px}
.acc-avatar img{width:100%;height:100%;object-fit:cover}
.account-slot-meta{min-width:0}
.account-slot-name{font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-slot-sub{font-size:12px;opacity:.72;direction:ltr;text-align:left}
.account-slot-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.account-slot-badge{padding:6px 10px;border-radius:999px;background:rgba(34,197,94,.16);color:#86efac;font-size:12px;font-weight:700}
.account-add-box{padding:14px;border:1px solid var(--glass-border);border-radius:18px;background:rgba(255,255,255,.03)}
.account-add-title{font-weight:800;margin-bottom:10px}
.account-entry-mode{display:flex;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.account-entry-btn{border:1px solid var(--glass-border);background:rgba(255,255,255,.04);color:inherit;padding:9px 12px;border-radius:12px;cursor:pointer}
.account-entry-btn.active{background:rgba(59,130,246,.15);border-color:rgba(59,130,246,.35)}
.account-add-grid{display:grid;grid-template-columns:1fr;gap:10px}
.account-add-grid input{width:100%;padding:12px 14px;border-radius:14px;border:1px solid var(--glass-border);background:rgba(255,255,255,.04);color:inherit}
.account-add-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}

/* v124 account switch buttons + postchain */
.account-slot-actions{gap:10px}
.mini-action-btn,.account-slot-btn{
  border:none;border-radius:14px;padding:9px 14px;font:inherit;font-size:12px;font-weight:900;
  background:rgba(255,255,255,.08);color:inherit;cursor:pointer;transition:.18s transform,.18s opacity,.18s background;
  box-shadow:0 6px 18px rgba(0,0,0,.12)
}
.mini-action-btn:hover,.account-slot-btn:hover{transform:translateY(-1px)}
.account-slot-actions [data-account-switch]{background:linear-gradient(135deg,#4f8cff,#7c3aed);color:#fff}
.account-slot-actions [data-account-remove],.mini-action-btn.danger{background:rgba(239,68,68,.16);color:#ffe2e2}
.account-slot-card{padding:14px 15px;border-radius:18px}
.account-slot-name{font-size:14px}
.account-slot-badge{padding:7px 11px;font-weight:800}
@media (max-width:640px){
  .account-slot-card{flex-direction:column;align-items:stretch}
  .account-slot-actions{justify-content:stretch}
  .account-slot-actions > *{flex:1}
}

.posts-page{padding:16px 14px 120px;display:flex;flex-direction:column;gap:14px}
.posts-hero{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px;border-radius:24px}
.posts-hero-title{font-size:20px;font-weight:900}
.posts-hero-sub{font-size:12px;opacity:.72;margin-top:6px}
.posts-hero-actions{display:flex;gap:10px;flex-wrap:wrap}
.posts-primary-btn,.posts-ghost-btn{border:none;border-radius:16px;padding:12px 16px;font:inherit;font-weight:800;cursor:pointer}
.posts-primary-btn{background:linear-gradient(135deg,#833ab4 0%,#c13584 45%,#e1306c 70%,#fd1d1d 100%);color:#fff}
.posts-ghost-btn{background:rgba(255,255,255,.08);color:inherit}
.posts-feed{display:flex;flex-direction:column;gap:14px}
.post-card{border-radius:24px;overflow:hidden;padding:0}
.post-head{display:flex;gap:12px;align-items:flex-start;padding:16px 16px 8px}
.post-author-avatar{width:52px;height:52px;border-radius:50%;overflow:hidden;background:rgba(255,255,255,.08);display:grid;place-items:center;font-weight:900;flex:0 0 52px}
.post-author-avatar img{width:100%;height:100%;object-fit:cover}
.post-author-meta{flex:1;min-width:0}
.post-author-name{font-weight:900;font-size:15px;display:flex;align-items:center;gap:6px;flex-wrap:wrap;color:#ffffff}
.post-author-sub,.post-author-time{font-size:12px;opacity:1;margin-top:4px;color:#ffffff}
.post-author-time{direction:ltr;unicode-bidi:embed;display:inline-block}
.post-owner-actions{display:flex;gap:8px;flex-wrap:wrap}
.post-media-wrap{padding:0 16px 8px}
.post-media.image,.post-media.video{display:block;width:100%;border:none;background:transparent;padding:0;cursor:pointer}
.post-media img,.post-media video{width:100%;max-height:440px;object-fit:cover;border-radius:22px;display:block;background:#000}
.post-caption{padding:0 16px 12px;line-height:1.9;font-size:14px;white-space:pre-wrap;word-break:break-word}
.post-caption-wrap{padding:0 16px 12px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.post-caption-wrap .post-caption{padding:0;width:100%}
.post-caption-clamp.is-collapsed{display:-webkit-box;display:box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;max-height:calc(1.9em * 3)}
.post-caption-clamp.is-expanded{display:block;overflow:visible}
.post-caption-toggle{border:none;background:rgba(255,255,255,.08);color:var(--accent);padding:8px 12px;border-radius:999px;font:inherit;font-size:12px;font-weight:800;cursor:pointer;transition:transform .18s ease,opacity .18s ease,background .18s ease}
.post-caption-toggle:hover{background:rgba(255,255,255,.14);transform:translateY(-1px)}
.post-caption-toggle:active{transform:translateY(0)}
.post-actions-row{display:flex;gap:10px;padding:0 16px 16px;flex-wrap:wrap}
.post-action-btn{border:none;border-radius:14px;padding:10px 14px;display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.08);color:inherit;font:inherit;font-weight:800;cursor:pointer}
.post-action-btn.active{background:rgba(239,68,68,.16)}
.post-mstar-btn{background:rgba(250,204,21,.12)}
.post-composer{display:flex;flex-direction:column;gap:12px}
.post-caption-input{width:100%;border:none;border-radius:18px;background:rgba(255,255,255,.06);color:inherit;padding:14px;font:inherit}
.post-composer-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.post-media-name{font-size:12px;opacity:.74}
.post-composer-preview{min-height:40px;border-radius:18px;overflow:hidden;background:rgba(255,255,255,.04);display:flex;align-items:center;justify-content:center}
.post-composer-preview img,.post-composer-preview video{max-width:100%;max-height:300px;display:block}

html.page-scroll-unlocked,
body.page-scroll-unlocked,
body.page-scroll-unlocked.admin-body,
body.page-scroll-unlocked.pref-body,
body.page-scroll-unlocked .admin-shell,
body.page-scroll-unlocked .pref-shell,
body.page-scroll-unlocked .card,
body.page-scroll-unlocked .pref-card,
body.page-scroll-unlocked main {
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y pinch-zoom !important;
  scrollbar-width: thin;
}
body.page-scroll-unlocked .admin-shell,
body.page-scroll-unlocked .pref-shell {
  display:block !important;
}
@media (pointer:fine) {
  body.page-scroll-unlocked .admin-shell,
  body.page-scroll-unlocked .pref-shell,
  body.page-scroll-unlocked .card,
  body.page-scroll-unlocked .pref-card,
  body.page-scroll-unlocked main {
    scroll-behavior: auto !important;
  }
}

.pb-mstar-btn{background:linear-gradient(135deg,#facc15,#f59e0b)!important;color:#241400}.pb-username-btn{background:linear-gradient(135deg,#38bdf8,#2563eb)!important;color:#fff}

/* v126 stronger page scroll */
html.page-scroll-unlocked, body.page-scroll-unlocked { overflow-y:auto !important; overflow-x:hidden !important; height:auto !important; min-height:100dvh !important; touch-action:pan-y pinch-zoom !important; }
body.page-scroll-unlocked .admin-shell,
body.page-scroll-unlocked .pref-shell,
body.page-scroll-unlocked .card,
body.page-scroll-unlocked .pref-card,
body.page-scroll-unlocked .settings-card,
body.page-scroll-unlocked main {
  overflow-y:auto !important;
  overflow-x:hidden !important;
  max-height:none !important;
  height:auto !important;
  min-height:min(100dvh,100%) !important;
  -webkit-overflow-scrolling:touch !important;
  overscroll-behavior:contain !important;
  touch-action:pan-y pinch-zoom !important;
}

.compose-hero-btn.tertiary{
  background:linear-gradient(135deg,#833ab4 0%,#c13584 45%,#e1306c 70%,#fd1d1d 100%);
  color:#fff;
}
.pb-change-pass-btn{background:linear-gradient(135deg,#ef4444,#b91c1c)!important;color:#fff}
.msg-day-separator{
  position:sticky;
  top:10px;
  z-index:4;
  align-self:center;
  margin:14px auto 10px;
  padding:7px 14px;
  border-radius:14px;
  background:rgba(17,24,39,.86);
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  font-size:12px;
  font-weight:800;
  letter-spacing:.2px;
  box-shadow:0 8px 20px rgba(0,0,0,.18);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.stories-rail{display:flex;gap:12px;overflow-x:auto;padding:2px 2px 8px;margin-bottom:14px;-webkit-overflow-scrolling:touch}
.story-chip{flex:0 0 auto;border:none;background:transparent;color:inherit;padding:0;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;min-width:82px}
.story-chip-avatar{width:78px;height:78px;border-radius:50%;padding:3px;display:grid;place-items:center;background:linear-gradient(135deg,#833ab4 0%,#e1306c 50%,#fd1d1d 100%);overflow:hidden;box-sizing:border-box;flex-shrink:0}
.story-chip.seen .story-chip-avatar{background:linear-gradient(135deg,#22c55e,#16a34a)}
.story-chip-avatar img,.story-chip-avatar span{width:100%;height:100%;min-width:100%;min-height:100%;border-radius:50%;display:grid;place-items:center;background:rgba(15,23,42,.96);object-fit:cover;object-position:center center;font-weight:900;overflow:hidden}
.story-chip-name{font-size:12px;font-weight:800;max-width:84px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.story-chip-count{font-size:11px;opacity:.72}
.story-viewer{position:fixed;inset:0;z-index:10030;display:flex;align-items:center;justify-content:center;padding:18px}
.story-viewer-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.72)}
.story-viewer-card{position:relative;z-index:1;width:min(520px,96vw);max-height:92vh;border-radius:28px;padding:16px;display:flex;flex-direction:column;gap:12px;overflow:hidden}
.story-viewer-close{position:absolute;top:12px;left:12px;z-index:2}
.story-viewer-progress{display:flex;gap:6px;padding-inline-start:44px}
.story-progress-item{flex:1;height:4px;border-radius:999px;background:rgba(255,255,255,.22)}
.story-progress-item.active{background:#fff}
.story-viewer-head{display:flex;align-items:center;min-height:22px;padding-inline-start:44px}
.story-viewer-author{display:flex;align-items:center;gap:8px;font-weight:900;flex-wrap:wrap}
.story-viewer-time{font-size:12px;opacity:.72;font-weight:700}
.story-viewer-media{min-height:240px;max-height:56vh;display:grid;place-items:center;border-radius:22px;overflow:hidden;background:rgba(255,255,255,.06)}
.story-viewer-media img,.story-viewer-media video{max-width:100%;max-height:56vh;border-radius:22px}
.story-viewer-caption{font-size:14px;line-height:1.8;min-height:20px}
.story-viewer-actions{display:flex;gap:10px;flex-wrap:wrap}
.story-expire-select{width:100%;margin-top:8px;border-radius:14px;padding:12px 14px;background:rgba(255,255,255,.08);color:inherit;border:1px solid rgba(255,255,255,.08);font:inherit}
.story-stats-summary{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.story-stats-pill{padding:10px 14px;border-radius:999px;background:rgba(255,255,255,.08);font-weight:800}
.story-stats-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.story-stats-card{border-radius:22px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.06);padding:14px}
.story-stats-title{font-weight:900;margin-bottom:10px}
.story-stats-list{display:flex;flex-direction:column;gap:10px;max-height:320px;overflow:auto}
.story-stats-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px;border-radius:16px;background:rgba(255,255,255,.04)}
.story-stats-user{display:flex;align-items:center;gap:10px;min-width:0}
.story-stats-name{font-weight:800}
.story-stats-time{font-size:12px;opacity:.72;white-space:nowrap}
html.page-scroll-unlocked, body.page-scroll-unlocked{scroll-behavior:smooth}
@media (max-width:720px){
  .story-stats-columns{grid-template-columns:1fr}
  .story-chip-avatar{width:72px;height:72px}
}

.story-chip-avatar > img{display:block;aspect-ratio:1/1}

/* v127p: M-Star profile yellow box text to white */
.pb-mstar-btn,
.pb-mstar-btn *,
.profile-mstar-btn,
.profile-mstar-btn *,
.profile-tab-wrapper .pb-action-btn.pb-mstar-btn,
.profile-tab-wrapper .pb-action-btn.pb-mstar-btn *,
.profile-tab-wrapper .pb-action-btn[data-action="mstar"],
.profile-tab-wrapper .pb-action-btn[data-action="mstar"] *{
  color:#ffffff !important;
  fill:#ffffff !important;
}

/* v127s social profile */
.posts-search-result-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--text);border-radius:14px;text-align:right}
.posts-search-result-item:hover{background:rgba(255,255,255,.06)}
.posts-search-avatar{width:42px;height:42px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.08);flex:none}
.posts-search-avatar img{width:100%;height:100%;object-fit:cover}
.social-profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.social-profile-tile{border:none;background:rgba(255,255,255,.04);border-radius:18px;overflow:hidden;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center}
.social-profile-tile img,.social-profile-tile video{width:100%;height:100%;object-fit:cover}
.social-profile-stat strong{display:block;font-size:32px;line-height:1}
.social-profile-stat span{display:block;color:var(--text-muted);margin-top:6px}
.social-follow-btn.following{background:rgba(255,255,255,.09)!important;color:var(--text)!important}

.social-profile-header{display:grid;grid-template-columns:minmax(96px,144px) 1fr;gap:18px;align-items:center;margin-bottom:18px}
.social-profile-avatar-ring{width:clamp(96px,18vw,144px);height:clamp(96px,18vw,144px);border-radius:50%;padding:4px;background:linear-gradient(135deg,#f58529,#feda77,#dd2a7b,#8134af,#515bd4)}
.social-profile-avatar-inner{width:100%;height:100%;border-radius:50%;overflow:hidden;background:#111827;display:flex;align-items:center;justify-content:center}
.social-profile-avatar-fallback{font-size:40px}
.social-profile-header-main{min-width:0}
.social-profile-header-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.social-profile-header-name{font-size:clamp(24px,3vw,34px);font-weight:900;line-height:1.2;min-width:0}
.social-profile-header-handle{color:var(--text-muted);font-size:clamp(14px,2vw,18px);word-break:break-word}
.social-profile-header-bio{color:var(--text-muted);margin-top:8px;line-height:1.8;word-break:break-word}
.social-profile-contact-name{margin-top:8px;font-weight:700;word-break:break-word}
.social-profile-stats-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:18px}
.social-profile-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}
.social-profile-actions > button{flex:1 1 160px;min-width:0}
@media (max-width: 768px){
  #socialProfileModal > .glass{width:min(100vw,100vw) !important;max-height:100vh !important;border-radius:18px !important;padding:14px !important}
  .social-profile-header{grid-template-columns:1fr;gap:14px;text-align:center}
  .social-profile-avatar-ring{margin:0 auto;width:96px;height:96px}
  .social-profile-avatar-fallback{font-size:34px}
  .social-profile-header-top{justify-content:center}
  .social-profile-header-name{font-size:22px}
  .social-profile-header-handle{font-size:14px}
  .social-profile-header-bio{font-size:14px;line-height:1.7}
  .social-profile-stats-row{gap:8px}
  .social-profile-stat strong{font-size:24px}
  .social-profile-actions{gap:8px}
  .social-profile-actions > button{flex:1 1 100%;width:100%}
  .social-profile-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
}
@media (max-width: 420px){
  #socialProfileModal > .glass{padding:12px !important;border-radius:14px !important}
  .social-profile-header-name{font-size:20px}
  .social-profile-stats-row{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* v127t */
.posts-top-search{width:100%}
.posts-search-wrap-top .wallpaper-btn::placeholder{color:rgba(255,255,255,.68)}
.posts-search-result-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--text);border-radius:14px;text-align:right}
.posts-search-result-item:hover{background:rgba(255,255,255,.06)}
.posts-search-avatar{width:42px;height:42px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.08);flex:none}
.posts-search-avatar img{width:100%;height:100%;object-fit:cover}
.social-profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.social-profile-tile{border:none;background:rgba(255,255,255,.04);border-radius:18px;overflow:hidden;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center}
.social-profile-tile img,.social-profile-tile video{width:100%;height:100%;object-fit:cover}
.social-follow-btn.following{background:rgba(255,255,255,.09)!important;color:var(--text)!important}
.mstar-request-card{box-shadow:0 14px 40px rgba(250,204,21,.16)}
.mstar-request-card .mstar-request-state{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border-radius:12px;background:rgba(255,255,255,.08);font-weight:800}
.mstar-request-card.approved .mstar-request-state{background:rgba(34,197,94,.14);color:#86efac}
.mstar-request-card.declined .mstar-request-state{background:rgba(239,68,68,.14);color:#fca5a5}

/* v127u */
.post-card{
  background:rgba(0,0,0,.52) !important;
  border:1px solid rgba(255,255,255,.08) !important;
  box-shadow:0 14px 34px rgba(0,0,0,.28) !important;
}
.post-head,.post-caption,.post-actions-row{
  position:relative;
  z-index:2;
}
.mstar-request-card{
  background:linear-gradient(180deg, rgba(31,41,55,.82), rgba(17,24,39,.92)) !important;
  border:1px solid rgba(250,204,21,.42) !important;
  box-shadow:0 18px 48px rgba(0,0,0,.30), 0 0 0 1px rgba(250,204,21,.06) inset !important;
  overflow:hidden;
}
.mstar-request-card::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at top right, rgba(250,204,21,.16), transparent 34%),
             radial-gradient(circle at bottom left, rgba(245,158,11,.12), transparent 28%);
  pointer-events:none;
}
.mstar-request-title{
  color:#fde68a !important;
}
.mstar-request-body{
  color:#fff !important;
}
.mstar-request-approve-btn{
  background:linear-gradient(180deg,#facc15,#eab308) !important;
  color:#111827 !important;
  border:none !important;
  font-weight:900 !important;
}
.mstar-request-decline-btn{
  border-color:#ef4444 !important;
  color:#fca5a5 !important;
  background:rgba(127,29,29,.18) !important;
  font-weight:800 !important;
}

/* v127v */
.post-mstar-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.post-mstar-glyph{
  width:18px;
  height:18px;
  object-fit:contain;
  display:inline-block;
  vertical-align:middle;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.18));
}

/* v127w */
.posts-top-icon-btn{
  min-width:88px;
  height:58px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-weight:800;
}
.posts-top-icon-btn .ui-icon{
  width:18px;
  height:18px;
}

html[data-theme="whatsapp"] .posts-top-search,
body[data-theme="whatsapp"] .posts-top-search,
html[data-theme="rose"] .posts-top-search,
body[data-theme="rose"] .posts-top-search{
  background:rgba(255,255,255,.92) !important;
  border-color:rgba(17,27,33,.08) !important;
}
html[data-theme="whatsapp"] .posts-top-icon-btn,
body[data-theme="whatsapp"] .posts-top-icon-btn,
html[data-theme="rose"] .posts-top-icon-btn,
body[data-theme="rose"] .posts-top-icon-btn{
  background:rgba(255,255,255,.92) !important;
  border-color:rgba(17,27,33,.10) !important;
  color:#111827 !important;
  box-shadow:0 6px 18px rgba(17,27,33,.08);
}
html[data-theme="whatsapp"] .posts-top-icon-btn .ui-icon,
body[data-theme="whatsapp"] .posts-top-icon-btn .ui-icon,
html[data-theme="rose"] .posts-top-icon-btn .ui-icon,
body[data-theme="rose"] .posts-top-icon-btn .ui-icon{
  filter:none !important;
}
html[data-theme="whatsapp"] #postsUserSearchInput,
body[data-theme="whatsapp"] #postsUserSearchInput,
html[data-theme="rose"] #postsUserSearchInput,
body[data-theme="rose"] #postsUserSearchInput{
  background:#ffffff !important;
  color:#111827 !important;
  border-color:rgba(17,27,33,.10) !important;
}
html[data-theme="whatsapp"] #postsUserSearchInput::placeholder,
body[data-theme="whatsapp"] #postsUserSearchInput::placeholder,
html[data-theme="rose"] #postsUserSearchInput::placeholder,
body[data-theme="rose"] #postsUserSearchInput::placeholder{
  color:rgba(17,27,33,.56) !important;
}
html[data-theme="whatsapp"] #postsUserSearchResults,
body[data-theme="whatsapp"] #postsUserSearchResults,
html[data-theme="rose"] #postsUserSearchResults,
body[data-theme="rose"] #postsUserSearchResults{
  background:rgba(255,255,255,.98) !important;
  border-color:rgba(17,27,33,.08) !important;
}
html[data-theme="whatsapp"] .posts-search-result-item,
body[data-theme="whatsapp"] .posts-search-result-item,
html[data-theme="rose"] .posts-search-result-item,
body[data-theme="rose"] .posts-search-result-item{
  color:#111827 !important;
}
html[data-theme="whatsapp"] .posts-search-result-item:hover,
body[data-theme="whatsapp"] .posts-search-result-item:hover,
html[data-theme="rose"] .posts-search-result-item:hover,
body[data-theme="rose"] .posts-search-result-item:hover{
  background:rgba(17,27,33,.05) !important;
}
html[data-theme="whatsapp"] .posts-search-avatar,
body[data-theme="whatsapp"] .posts-search-avatar,
html[data-theme="rose"] .posts-search-avatar,
body[data-theme="rose"] .posts-search-avatar{
  background:rgba(17,27,33,.06) !important;
  color:#111827 !important;
}

/* v1283 gifts */
.mstar-gift-card{
  background:linear-gradient(180deg, rgba(16,18,24,.92), rgba(7,9,14,.96));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 48px rgba(0,0,0,.30);
}
.mstar-gift-card .mstar-request-state.claimed,
.mstar-gift-card.claimed .mstar-request-state{
  background:rgba(34,197,94,.14);
  color:#bbf7d0;
}

.paid-dm-modal{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;padding:8px 4px 2px}
.paid-dm-modal__hero{width:92px;height:92px;border-radius:28px;background:linear-gradient(180deg,rgba(250,204,21,.18),rgba(245,158,11,.1));display:flex;align-items:center;justify-content:center;box-shadow:0 16px 38px rgba(245,158,11,.18);border:1px solid rgba(250,204,21,.24)}
.paid-dm-modal__icon{width:48px;height:48px;object-fit:contain;filter:drop-shadow(0 10px 18px rgba(0,0,0,.16))}
.paid-dm-modal__title{font-size:18px;font-weight:900;color:var(--text)}
.paid-dm-modal__text{font-size:14px;line-height:1.9;color:var(--text-muted)}
.paid-dm-modal__text strong{color:#facc15}
.paid-dm-modal__actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;width:100%;margin-top:6px}
.paid-dm-modal__btn{min-width:120px;border:none;border-radius:14px;padding:12px 18px;font-weight:800;cursor:pointer;transition:transform .16s ease,opacity .16s ease,box-shadow .16s ease}
.paid-dm-modal__btn:hover{transform:translateY(-1px)}
.paid-dm-modal__btn.secondary{background:rgba(148,163,184,.16);color:var(--text)}
.paid-dm-modal__btn.primary{background:linear-gradient(135deg,#facc15,#f59e0b);color:#111827;box-shadow:0 14px 30px rgba(245,158,11,.24)}
@media (max-width: 520px){
  .paid-dm-modal__hero{width:82px;height:82px;border-radius:24px}
  .paid-dm-modal__actions{flex-direction:column}
  .paid-dm-modal__btn{width:100%}
}

/* v128 native smooth scroll for settings page */
html:has(body.settings-native-scroll),
body.settings-native-scroll{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  height:auto !important;
  min-height:100vh !important;
  min-height:100dvh !important;
  scroll-behavior:auto !important;
}
body.settings-native-scroll .admin-shell{
  overflow-y:visible !important;
  overflow-x:hidden !important;
  height:auto !important;
  max-height:none !important;
  min-height:100dvh !important;
  -webkit-overflow-scrolling:touch !important;
  scroll-behavior:auto !important;
}
body.settings-native-scroll .card,
body.settings-native-scroll .password-card,
body.settings-native-scroll .privacy-card{
  overflow:visible !important;
  transform:translateZ(0);
}
@media (pointer:fine){
  body.settings-native-scroll{
    overscroll-behavior-y:auto !important;
  }
}

/* v130 settings responsiveness + block button */
body.settings-native-scroll,
body.settings-native-scroll .admin-shell,
body.settings-native-scroll .card{
  contain:none !important;
  will-change:auto !important;
  transform:none !important;
}
body.settings-native-scroll .admin-shell{padding-bottom:28px}
.posts-ghost-btn.danger{background:rgba(239,68,68,.14);color:#ffd7d7;border:1px solid rgba(239,68,68,.24)}

.banned-user-badge{display:inline-flex;align-items:center;justify-content:center;padding:2px 8px;border-radius:999px;background:rgba(239,68,68,.16);color:#ffb4b4;border:1px solid rgba(239,68,68,.3);font-size:11px;font-weight:800;margin-right:6px}
.store-shell{max-width:1100px;margin:0 auto;padding:24px 18px 36px}
.store-topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.store-hero{padding:22px;border-radius:28px;background:linear-gradient(135deg,rgba(17,24,39,.92),rgba(30,41,59,.92));border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);margin-bottom:20px}
.store-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px}
.store-card{padding:16px;border-radius:22px;background:rgba(255,255,255,.04);border:1px solid var(--glass-border);display:flex;flex-direction:column;gap:12px;box-shadow:var(--glass-shadow)}
.store-card img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:18px;background:rgba(255,255,255,.06)}
.store-price{font-weight:900;color:#facc15}
.store-actions{display:flex;gap:10px;flex-wrap:wrap}
.store-section{margin-top:28px}
.store-table{width:100%;border-collapse:collapse}
.store-table th,.store-table td{padding:10px 8px;border-bottom:1px solid rgba(255,255,255,.08);text-align:right}
.store-login-card{max-width:420px;margin:64px auto;padding:22px;border-radius:26px;background:rgba(255,255,255,.04);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}

.store-nav-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:44px;padding:12px 16px;border-radius:16px;text-decoration:none;font-weight:900;transition:transform .18s ease,box-shadow .18s ease,opacity .18s ease;border:1px solid rgba(255,255,255,.14);box-shadow:0 14px 32px rgba(0,0,0,.16);backdrop-filter:blur(10px)}
.store-nav-btn:hover{transform:translateY(-1px);opacity:1}
.store-nav-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:999px;background:rgba(255,255,255,.14);font-size:15px}
.store-nav-back{background:linear-gradient(135deg,rgba(59,130,246,.24),rgba(37,99,235,.12));color:#dbeafe}
.store-nav-orders{background:linear-gradient(135deg,rgba(250,204,21,.22),rgba(245,158,11,.12));color:#fef3c7}
.store-hero-actions{display:flex;gap:10px;flex-wrap:wrap}
@media (max-width:720px){.store-nav-btn{width:100%}.store-topbar .row.wrap{width:100%}}

.store-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:rgba(250,204,21,.14);color:#fde68a;font-size:12px;font-weight:800}
@media (max-width:720px){.store-shell{padding:18px 12px 32px}.store-hero{padding:18px;border-radius:22px}}

.store-balance-chip{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(34,197,94,.14);color:#bbf7d0;font-size:13px;font-weight:800}
.store-filter-row{display:flex;gap:8px;flex-wrap:wrap}
.store-filter-row .pill.active{background:rgba(250,204,21,.18);color:#fde68a;border-color:rgba(250,204,21,.32)}
.store-detail-card{display:grid;grid-template-columns:minmax(280px,380px) minmax(0,1fr);gap:18px;padding:18px;border-radius:28px;background:rgba(255,255,255,.04);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}
.store-detail-media img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:24px;background:rgba(255,255,255,.06)}
.store-detail-fallback{width:100%;aspect-ratio:1/1;border-radius:24px;background:rgba(255,255,255,.05);display:flex;align-items:center;justify-content:center;font-size:72px}
.store-detail-box{margin-top:12px;padding:14px;border-radius:18px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}
.store-status-pill{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;background:color-mix(in srgb, var(--status-color, #94a3b8) 16%, transparent);border:1px solid color-mix(in srgb, var(--status-color, #94a3b8) 42%, transparent);color:var(--status-color, #e2e8f0);font-size:12px;font-weight:800;white-space:nowrap}
.store-status-pill.paid{--status-color:#22c55e}
.store-admin-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.store-admin-form textarea,.store-admin-form input[type='file']{grid-column:1/-1}
.store-order-form{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;min-width:220px}
@media (max-width:860px){.store-detail-card{grid-template-columns:1fr}.store-admin-form{grid-template-columns:1fr}}

.posts-notif-badge{position:absolute;top:6px;right:8px;min-width:12px;height:12px;border-radius:999px;background:#ef4444;box-shadow:0 0 0 2px rgba(8,12,20,.75);font-size:0;color:transparent}
.post-comments-wrap{margin-top:12px;border-top:1px solid rgba(255,255,255,.08);padding-top:12px}
.post-comments-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.post-comments-title{font-size:13px;font-weight:800;color:var(--text-main)}
.post-comments-list{display:flex;flex-direction:column;gap:10px;max-height:260px;overflow:auto;padding-left:2px}
.post-comment-item{padding:10px 12px;border-radius:16px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.06)}
.post-comment-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}
.post-comment-author{font-size:13px;font-weight:800;color:var(--text-main)}
.post-comment-time{font-size:11px;color:var(--text-muted)}
.post-comment-body{font-size:13px;line-height:1.8;color:var(--text-main);white-space:pre-wrap;word-break:break-word}
.post-comment-form{display:flex;gap:8px;align-items:flex-end;margin-top:12px}
.post-comment-input{flex:1;min-height:44px;max-height:120px;resize:vertical;border-radius:14px;border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.05);color:var(--text-main);padding:10px 12px;font:inherit}
.post-comment-submit{border:none;border-radius:14px;padding:12px 14px;font:inherit;font-weight:800;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;cursor:pointer}
.post-comment-open-btn{display:inline-flex;align-items:center;gap:6px}
.post-comment-thread{display:flex;flex-direction:column;gap:10px}
.post-comment-item.is-reply{margin-right:18px;background:rgba(255,255,255,.04);border-style:dashed}
.post-comment-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.post-comment-content{flex:1;min-width:0}
.post-comment-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:8px}
.post-comment-action{border:none;background:rgba(255,255,255,.08);color:var(--text-main);border-radius:999px;padding:6px 10px;font:inherit;font-size:12px;cursor:pointer}
.post-comment-action.danger{background:rgba(239,68,68,.16);color:#fecaca}
.post-comment-edited{font-size:11px;color:var(--text-muted);margin-top:4px}
.post-comment-form{flex-wrap:wrap}
.post-comment-form-meta{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px;padding:8px 10px;border-radius:12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.06)}
.post-comment-form-hint{font-size:12px;color:var(--text-muted)}
.post-comment-form-cancel{border:none;background:transparent;color:#fca5a5;font:inherit;font-weight:700;cursor:pointer}
.posts-notif-list{display:flex;flex-direction:column;gap:10px}
.posts-notif-item{padding:12px 14px;border-radius:18px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.07);display:flex;align-items:flex-start;gap:10px;cursor:pointer}
.posts-notif-item.unread{border-color:rgba(239,68,68,.55);box-shadow:0 0 0 1px rgba(239,68,68,.15) inset}
.posts-notif-icon{width:38px;height:38px;display:flex;align-items:center;justify-content:center;border-radius:12px;background:rgba(255,255,255,.08);font-size:18px;flex:0 0 38px}
.posts-notif-content{flex:1;min-width:0}
.posts-notif-title{font-size:13px;line-height:1.8;color:var(--text-main)}
.posts-notif-time{font-size:11px;color:var(--text-muted);margin-top:4px}

/* v1284b postchain search + media close */
.posts-top-search{display:flex;flex-direction:column;gap:10px}
.posts-top-bar{width:100%}
.posts-user-search-input{display:block;width:100%;min-width:0;font-weight:800;letter-spacing:0}
.posts-user-search-input::placeholder{font-size:15px}
.posts-user-search-results{max-height:min(52vh,360px);overflow:auto}
@media (max-width: 760px){
  .posts-top-bar{flex-direction:column;align-items:stretch !important;gap:12px !important}
  .posts-top-actions{display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%}
  .posts-top-icon-btn{width:100%;justify-content:center;padding:12px 10px;border-radius:16px}
  .posts-user-search-input{height:54px !important;font-size:16px !important}
}
#imageLightbox .full-modal-close,
#videoLightbox .full-modal-close{
  right:max(16px, env(safe-area-inset-right, 0px) + 8px);
  left:auto;
  z-index:10008 !important;
  box-shadow:0 12px 28px rgba(0,0,0,.26);
}
#imageLightbox .full-modal-close::before,
#videoLightbox .full-modal-close::before{
  content:"✕";
  color:#fff;
  font-size:20px;
  font-weight:900;
  line-height:1;
}
#imageLightbox .full-modal-close img,
#videoLightbox .full-modal-close img{display:none}

.file-lightbox-card{width:min(94vw,980px);height:min(88vh,780px);display:flex;flex-direction:column;background:rgba(7,14,27,.96);border:1px solid rgba(255,255,255,.12);border-radius:24px;overflow:hidden;box-shadow:0 18px 70px rgba(0,0,0,.45)}
.file-lightbox-head{padding:18px 20px 12px;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;justify-content:space-between;gap:12px}
.file-lightbox-title{font-size:15px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-lightbox-body{flex:1;min-height:0;padding:12px;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01))}
.file-lightbox-frame{width:100%;height:100%;border:none;border-radius:18px;background:#fff}
.file-lightbox-fallback{width:min(92%,420px);padding:24px;border-radius:24px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);text-align:center;display:flex;flex-direction:column;gap:14px;align-items:center}
.file-lightbox-icon{width:74px;height:74px;border-radius:22px;background:rgba(255,255,255,.09);display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:900;letter-spacing:.4px}
.file-lightbox-name{font-size:14px;font-weight:800;word-break:break-word}
.file-lightbox-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.file-lightbox-btn{border:none;border-radius:14px;padding:12px 18px;font-weight:800;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:linear-gradient(135deg,var(--primary),var(--primary-2));color:#fff;box-shadow:0 10px 28px rgba(0,0,0,.24)}
.file-lightbox-btn.secondary{background:rgba(255,255,255,.08);color:var(--text)}
.file-attachment-trigger{background:none;border:none;padding:0;text-align:inherit;color:inherit;cursor:pointer;width:100%}
@media (max-width: 768px){
  .file-lightbox-card{width:100vw;height:100vh;max-width:none;max-height:none;border-radius:0}
  .file-lightbox-head{padding:18px 64px 12px 16px}
  .file-lightbox-body{padding:10px}
}


.store-topbar{position:sticky;top:0;z-index:20;padding:14px 0 8px;background:linear-gradient(180deg,rgba(10,14,24,.94),rgba(10,14,24,.72),rgba(10,14,24,0))}
.store-topbar .brand{font-size:20px;font-weight:950;letter-spacing:-.02em}
.store-topbar .row.wrap{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.store-nav-btn{position:relative;overflow:hidden;min-width:138px;padding:12px 18px;border-radius:18px;border:1px solid rgba(255,255,255,.16);background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.05));box-shadow:0 18px 36px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08)}
.store-nav-btn::before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(255,255,255,.14),transparent 45%,transparent 55%,rgba(255,255,255,.06));pointer-events:none}
.store-nav-btn:hover{transform:translateY(-2px) scale(1.01);box-shadow:0 24px 44px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.1)}
.store-nav-icon{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:999px;background:rgba(255,255,255,.14)}
.store-nav-back{background:linear-gradient(135deg,rgba(59,130,246,.28),rgba(37,99,235,.16));color:#eff6ff}
.store-nav-orders{background:linear-gradient(135deg,rgba(250,204,21,.28),rgba(245,158,11,.16));color:#fff7d6}
.store-section-focus{animation:storePulse 1.35s ease}
@keyframes storePulse{0%{transform:translateY(0);box-shadow:0 0 0 rgba(250,204,21,0)}25%{transform:translateY(-2px);box-shadow:0 0 0 4px rgba(250,204,21,.14)}100%{transform:translateY(0);box-shadow:0 0 0 rgba(250,204,21,0)}}
@media (max-width:720px){.store-topbar{padding-top:10px}.store-topbar .brand{width:100%;margin-bottom:4px}.store-nav-btn{width:auto;min-width:0;flex:1}}


.post-action-btn.disabled,.post-action-btn:disabled{opacity:.55;cursor:not-allowed;filter:grayscale(.18)}
.store-top-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.store-nav-btn{isolation:isolate}
.store-nav-btn .store-nav-icon{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:12px;background:rgba(255,255,255,.14);box-shadow:inset 0 1px 0 rgba(255,255,255,.14)}
.store-nav-back{background:linear-gradient(135deg,rgba(59,130,246,.32),rgba(30,64,175,.18));border-color:rgba(96,165,250,.34)}
.store-nav-orders{background:linear-gradient(135deg,rgba(245,158,11,.28),rgba(217,119,6,.16));border-color:rgba(251,191,36,.34)}
.store-nav-btn span:last-child{position:relative;z-index:1}
.store-nav-btn::after{content:'';position:absolute;inset:auto -18% -55% auto;width:86px;height:86px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.14),transparent 62%);pointer-events:none;transform:translateY(8px)}
.store-nav-btn:active{transform:translateY(0) scale(.99)}
.store-section-focus{animation:storeSectionPulse 1.4s ease}
@keyframes storeSectionPulse{0%{box-shadow:0 0 0 0 rgba(250,204,21,.0)}25%{box-shadow:0 0 0 4px rgba(250,204,21,.08)}100%{box-shadow:0 0 0 0 rgba(250,204,21,0)}}
@media (max-width:720px){.store-top-actions{width:100%}.store-nav-btn{flex:1;justify-content:center}}


/* v1284 store management scroll + luxury fixes */
body.store-page{overflow-y:auto !important;overflow-x:hidden !important;height:auto !important;min-height:100dvh !important;-webkit-overflow-scrolling:touch !important;}
body.store-page .store-shell{max-width:1180px;overflow:visible !important;padding-bottom:42px;}
body.store-page .store-section, body.store-page .store-hero{overflow:visible !important;}
body.store-page .store-topbar{backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding-inline:4px;margin-bottom:22px;}
body.store-page .store-nav-btn{border-radius:20px;background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.06));box-shadow:0 18px 42px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.16);font-weight:900;}
body.store-page .store-nav-btn:hover{transform:translateY(-1px);box-shadow:0 20px 48px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.2);}
body.store-page .glass{overflow-x:auto;overflow-y:visible;}
body.store-page .store-table{min-width:840px;}
body.store-page .store-admin-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start;}
body.store-page .store-admin-form textarea,body.store-page .store-admin-form input[type="file"],body.store-page .store-admin-form button,body.store-page .store-admin-form label{grid-column:1/-1;}
body.store-page .store-admin-form button{position:sticky;bottom:12px;z-index:2;}
@media (max-width:720px){body.store-page .store-admin-form{grid-template-columns:1fr;}body.store-page .store-table{min-width:720px;}}

#saveRes.success{color:#86efac;font-weight:800}
body.store-page, html{scroll-behavior:auto !important}
body.store-page .store-topbar{padding-inline:6px}
body.store-page .store-admin-form button{position:static !important;bottom:auto !important}
body.store-page .store-shell, body.store-page .store-section, body.store-page .store-hero, body.store-page .glass{contain:none !important}
body.store-page .store-shell{padding-bottom:56px}
body.store-page .table, body.store-page .glass{max-width:100%;overflow:auto}


/* v1311 responsive nav, social profile, store, repost */
.bottom-nav{gap:4px;padding:6px 8px;overflow:hidden}
.nav-item{flex:1 1 0;min-width:0;padding:0 6px;justify-content:center}
.nav-item .nav-icon,.nav-item .nav-avatar{flex-shrink:0}
.nav-label{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-avatar{width:24px;height:24px}
@media (max-width:720px){
  .bottom-nav{left:12px;right:12px;bottom:12px;height:60px;border-radius:22px;padding:5px 4px}
  .nav-item{padding:0 2px}
  .nav-label{font-size:10px;margin-top:3px}
  .nav-avatar{width:22px;height:22px}
}

#socialProfileModal > .glass{width:min(920px,96vw)!important;max-height:min(92vh,calc(100dvh - 24px))!important;overflow:auto!important;padding:16px!important}
.social-profile-topbar{display:flex;justify-content:flex-start;align-items:center;margin-bottom:14px;position:sticky;top:0;z-index:3;padding-bottom:8px;background:linear-gradient(180deg,rgba(7,12,22,.94),rgba(7,12,22,.65),transparent)}
.social-profile-back-btn{min-height:42px;padding:10px 16px!important}
.social-profile-header{align-items:start}
.social-profile-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.social-profile-tile{min-width:0}
@media (max-width:860px){
  .social-profile-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
}
@media (max-width:520px){
  #socialProfileModal > .glass{width:min(100vw - 10px,100vw)!important;max-height:calc(100dvh - 10px)!important;border-radius:20px!important;padding:12px!important}
  .social-profile-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .social-profile-header-top,.social-profile-actions{justify-content:center}
  .social-profile-stat strong{font-size:20px}
  .social-profile-header-bio,.social-profile-contact-name{font-size:13px}
}

.post-repost-banner{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(96,165,250,.12);border:1px solid rgba(96,165,250,.24);color:#bfdbfe;font-size:12px;font-weight:800;margin-bottom:12px}
.post-repost-shell{margin-top:12px;padding:12px;border-radius:18px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}
.post-repost-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.post-author-avatar.small{width:38px;height:38px}
.post-author-name.small{font-size:13px}
.post-author-meta.repost{flex:1;min-width:0}
.post-repost-caption{margin-top:10px;line-height:1.8;color:var(--text-main);word-break:break-word}
.post-repost-media-wrap{border-radius:16px;overflow:hidden;background:rgba(255,255,255,.05)}
.post-repost-media-wrap img,.post-repost-media-wrap video{width:100%;display:block;max-height:360px;object-fit:cover}
.post-action-btn.reposted{border-color:rgba(96,165,250,.32);background:rgba(96,165,250,.12);color:#bfdbfe}
.post-action-btn span{pointer-events:none}

@media (max-width:720px){
  .store-shell{padding:14px 10px 28px}
  .store-topbar{align-items:stretch}
  .store-topbar .brand{font-size:22px}
  .store-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .store-card{padding:10px;border-radius:16px;gap:8px;min-width:0}
  .store-card img{border-radius:12px}
  .store-card .store-chip{font-size:10px;padding:5px 7px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .store-card .hint{font-size:11px;min-height:auto;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .store-card .store-price{font-size:12px}
  .store-card .store-actions{gap:6px;flex-direction:column;align-items:stretch}
  .store-card .store-actions form{width:100%}
  .store-card .store-actions input[type='number']{max-width:100%!important;width:100%}
  .store-card .pill,.store-card .btn-primary{width:100%;text-align:center;justify-content:center;font-size:11px;padding:10px 8px}
  .store-detail-card{padding:12px;border-radius:18px;gap:12px}
}
@media (max-width:520px){
  .store-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .store-card{padding:8px;border-radius:14px}
  .store-card > div[style*='font-size:18px']{font-size:12px!important;line-height:1.5}
  .store-card .hint{display:none}
}


@media (max-width:720px){
  .store-top-actions{gap:8px}
  .store-nav-btn{min-height:38px;padding:9px 10px;border-radius:14px;font-size:12px}
  .store-nav-btn .store-nav-icon{width:24px;height:24px;border-radius:9px;font-size:12px}
  .store-chip{font-size:10px;padding:5px 8px}
  .store-balance-chip{font-size:11px;padding:6px 10px}
  .store-filter-row{gap:6px}
  .store-filter-row .pill{font-size:11px;padding:8px 10px}
  .store-card .store-actions .pill,.store-card .store-actions .btn-primary{min-height:34px;padding:8px 6px;font-size:10px}
  .store-card .store-actions input[type='number']{min-height:34px;padding:6px 8px;font-size:11px}
}
@media (max-width:520px){
  .store-topbar .brand{font-size:20px}
  .store-nav-btn{padding:8px 8px;font-size:11px;gap:6px}
  .store-nav-btn .store-nav-icon{width:22px;height:22px}
  .store-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .store-card .store-actions{gap:4px}
  .store-card .store-chip{font-size:9px;padding:4px 6px}
  .store-card .store-price{font-size:11px}
}


/* v1315 spacing + restricted room + compact store */
#pageChats,.room-list,.user-list,.saved-list{padding-bottom:96px}
.room-item,.user-item,.saved-item{margin-bottom:8px}
.room-ban-state{min-height:52vh;display:flex;flex-direction:column;align-items:center;justify-content:center}
@media (max-width:640px){
  .store-card .store-actions{gap:4px!important}
  .store-card .store-actions .pill,.store-card .store-actions .btn-primary{min-height:30px!important;padding:7px 6px!important;font-size:9px!important;border-radius:12px!important}
  .store-card .store-actions input[type='number']{min-height:30px!important;font-size:10px!important;padding:5px 6px!important}
  .store-card .store-card-title{font-size:11px!important;line-height:1.4}
}


/* v1323 mobile profile modal fix */
#fullProfileModal{padding:12px;align-items:center;justify-content:center}
#fullProfileModal .full-modal-card{width:min(420px,96vw);max-height:min(92vh,calc(100dvh - 24px));overflow:auto;padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))}
#fullProfileModal .full-modal-close{z-index:5}
@media (max-width: 640px){
  #fullProfileModal{padding:8px;align-items:flex-start}
  #fullProfileModal .full-modal-card{
    width:calc(100vw - 16px);
    max-width:none;
    max-height:calc(100dvh - 16px);
    min-height:auto;
    border-radius:22px;
    padding:58px 14px calc(18px + env(safe-area-inset-bottom,0px)) 14px !important;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  #fullProfileModal .full-modal-close{
    position:sticky;
    top:0;
    left:0;
    margin-inline-start:auto;
    margin-bottom:8px;
    width:38px;
    height:38px;
    background:rgba(0,0,0,.42);
    backdrop-filter:blur(8px);
    border:1px solid rgba(255,255,255,.12);
  }
  #fullProfileModal #fpAvatar{width:84px !important;height:84px !important;min-height:84px !important;margin-top:0 !important}
  #fullProfileModal .pb-box{margin-top:12px !important}
  #fullProfileModal .pb-row{padding:10px 0}
  #fullProfileModal .pb-label{font-size:12px}
  #fullProfileModal .pb-value{font-size:13px;line-height:1.7;word-break:break-word}
  #fullProfileModal #fpContactBtn,
  #fullProfileModal #fpDeleteContactBtn,
  #fullProfileModal #fpBlockBtn{min-height:44px;font-size:13px}
}


.modal.cloud-modal { align-items: center; }
.modal.cloud-modal .modal-card { width: min(96vw, 1240px); max-width: 1240px; max-height: min(92vh, 920px); }
.modal.cloud-modal .modal-body { padding: 0; overflow: hidden; }
.cloud-modal-shell { display:flex; flex-direction:column; height:min(78vh, 760px); min-height:420px; }
.cloud-modal-toolbar { position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 18px; border-bottom:1px solid var(--glass-border); background:linear-gradient(180deg, rgba(10,16,28,.98), rgba(10,16,28,.92)); }
.cloud-modal-title { font-size:18px; font-weight:800; }
.cloud-close-btn { min-width:46px; height:46px; border-radius:14px; border:1px solid var(--glass-border); background:rgba(255,255,255,.06); color:var(--text); cursor:pointer; font:inherit; font-size:18px; }
.cloud-modal-scroll { flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; padding:18px; }
.cloud-hero-card { padding:16px; border-radius:18px; border:1px solid var(--glass-border); background:rgba(255,255,255,.04); }
.cloud-hero-grid { display:grid; gap:12px; grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:14px; }
.cloud-stat-card { padding:14px; border-radius:16px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.06); }
.cloud-stat-label { font-size:12px; color:var(--text-muted); margin-bottom:6px; }
.cloud-stat-value { font-size:17px; font-weight:800; word-break:break-word; }
.cloud-progress { height:12px; border-radius:999px; overflow:hidden; background:rgba(255,255,255,.08); margin-top:14px; }
.cloud-progress > span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#60a5fa,#8b5cf6); }
.cloud-section { margin-top:18px; }
.cloud-section-title { font-size:16px; font-weight:800; margin-bottom:10px; }
.cloud-files-list { display:grid; gap:10px; }
.cloud-file-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 14px; border-radius:16px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.06); }
.cloud-file-meta { min-width:0; }
.cloud-file-name { font-weight:700; word-break:break-word; }
.cloud-file-sub { margin-top:4px; color:var(--text-muted); font-size:12px; }
.cloud-file-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cloud-file-btn { min-height:40px; border-radius:12px; border:1px solid var(--glass-border); background:rgba(255,255,255,.05); color:var(--text); padding:0 14px; cursor:pointer; font:inherit; }
.cloud-file-btn.danger { background:rgba(220,38,38,.12); color:#fecaca; border-color:rgba(239,68,68,.35); }
.cloud-status-inline { margin-top:10px; padding:12px 14px; border-radius:14px; background:rgba(34,197,94,.12); border:1px solid rgba(34,197,94,.3); color:#dcfce7; font-weight:700; }
.cloud-empty-note { padding:18px; text-align:center; border:1px dashed rgba(255,255,255,.12); border-radius:16px; color:var(--text-muted); }
@media (min-width: 768px) {
  .modal.cloud-modal { padding:24px; }
  .modal.cloud-modal .modal-card { width: calc(100vw - 48px); max-width: none; height: calc(100vh - 48px); max-height: none; border-radius: 28px; }
  .modal.cloud-modal .modal-header { padding:22px 24px; }
  .cloud-modal-shell { height: calc(100vh - 165px); min-height: 520px; }
}
@media (max-width: 767px) {
  .modal.cloud-modal .modal-card { width: 94vw; max-width: 94vw; max-height: 88vh; border-radius: 22px; }
  .cloud-modal-shell { height: min(72vh, 640px); min-height: 360px; }
  .cloud-hero-grid { grid-template-columns:1fr; }
  .cloud-file-item { flex-direction:column; align-items:stretch; }
  .cloud-file-actions { justify-content:flex-start; }
}


/* v1327 settings scroll + cloud modal recovery */
html:has(body.settings-native-scroll),
body.settings-native-scroll,
body.settings-native-scroll.admin-body{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  height:auto !important;
  min-height:100vh !important;
  min-height:100dvh !important;
  display:block !important;
  position:static !important;
  -webkit-overflow-scrolling:touch !important;
}
body.settings-native-scroll .admin-shell{
  display:block !important;
  overflow:visible !important;
  overflow-x:hidden !important;
  min-height:100dvh !important;
  height:auto !important;
  max-height:none !important;
  padding-bottom:max(110px, calc(env(safe-area-inset-bottom) + 56px)) !important;
}
body.settings-native-scroll .card,
body.settings-native-scroll .password-card,
body.settings-native-scroll .privacy-card,
body.settings-native-scroll .row{
  overflow:visible !important;
  max-height:none !important;
}
@media (max-width: 820px){
  body.settings-native-scroll .admin-top{
    position:sticky;
    top:0;
    background:linear-gradient(180deg, rgba(5,10,20,.96), rgba(5,10,20,.84));
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
  }
  body.settings-native-scroll .card{margin-bottom:96px !important;}
}
.modal.cloud-modal{padding:12px;}
.modal.cloud-modal .modal-card{
  width:min(96vw, 1240px);
  max-width:1240px;
  max-height:min(94vh, 980px);
  overflow:hidden;
}
.modal.cloud-modal .modal-header{display:none;}
.modal.cloud-modal .modal-body{
  padding:0 !important;
  overflow:hidden !important;
  max-height:none !important;
}
.cloud-modal-shell{
  display:flex;
  flex-direction:column;
  height:min(84vh, 860px);
  min-height:440px;
}
.cloud-modal-scroll{
  flex:1 1 auto;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  padding:18px;
}
@media (min-width:768px){
  .modal.cloud-modal{padding:24px;}
  .modal.cloud-modal .modal-card{
    width:calc(100vw - 48px);
    max-width:none;
    height:calc(100vh - 48px);
    max-height:none;
    border-radius:28px;
  }
  .cloud-modal-shell{height:calc(100vh - 48px); min-height:0;}
}
@media (max-width:767px){
  .modal.cloud-modal .modal-card{
    width:94vw;
    max-width:94vw;
    max-height:90vh;
    border-radius:22px;
  }
  .cloud-modal-shell{height:min(78vh, 720px); min-height:380px;}
}


.room-bulk-select-bar{top:calc(env(safe-area-inset-top,0px) + 118px);bottom:auto;z-index:1005}
body.room-selection-mode .room-item{cursor:pointer;}
.room-item.selectable{position:relative;padding-inline-start:58px;}
.room-item.selectable::before{content:'';position:absolute;inset-inline-start:20px;top:50%;width:18px;height:18px;transform:translateY(-50%);border-radius:50%;border:2px solid rgba(255,255,255,.78);background:transparent;}
.room-item.selected{background:rgba(124,92,255,.14);outline:2px solid var(--primary, #7c5cff);outline-offset:-2px;}
.room-item.selected::before{background:var(--primary, #7c5cff);border-color:var(--primary, #7c5cff);box-shadow:inset 0 0 0 4px rgba(255,255,255,.96);}
@media (max-width:640px){.room-bulk-select-bar{top:calc(env(safe-area-inset-top,0px) + 108px);bottom:auto;}}


.room-actions{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-right:8px;margin-left:2px;}
.room-actions-btn{width:36px;height:36px;border:none;border-radius:12px;background:rgba(255,255,255,.06);color:var(--text);font-size:22px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;}
.room-actions-menu{position:absolute;top:42px;left:0;z-index:40;min-width:168px;padding:8px;border-radius:16px;background:var(--bg-elevated);border:1px solid var(--glass-border);box-shadow:0 18px 40px rgba(0,0,0,.24);}
.room-actions-item{width:100%;border:none;background:transparent;color:var(--text);padding:11px 12px;border-radius:12px;text-align:right;cursor:pointer;font-size:14px;}
.room-actions-item:hover{background:rgba(255,255,255,.06);}
.room-actions-item.danger{color:#ef4444;}
html[dir="ltr"] .room-actions-menu{left:auto;right:0;}

.voice-player{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.voice-player .vp-main{min-width:0;flex:1}
.voice-player .vp-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.voice-player .vp-skip,.voice-player .vp-speed{border:none;background:rgba(255,255,255,.14);color:inherit;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800;line-height:1;cursor:pointer;flex:0 0 auto}
.voice-player .vp-skip:hover,.voice-player .vp-speed:hover{filter:brightness(1.08)}
.voice-player .vp-speed{min-width:42px}
.voice-player .vp-label{margin-bottom:0}
html[data-theme="whatsapp"] .voice-player .vp-skip,html[data-theme="whatsapp"] .voice-player .vp-speed{background:rgba(17,27,33,.10)}

.view-chat, .view-chat *, .messages-area { box-sizing: border-box; }
.view-chat { overflow: hidden; overscroll-behavior-x: none; }
html, body { overflow-x: hidden; }


/* v1340 Samsung settings scroll fix */
html.samsung-settings-scroll-fix,
body.samsung-settings-scroll-fix,
body.samsung-settings-scroll-fix.admin-body,
body.samsung-settings-scroll-fix.settings-native-scroll{
  height:auto !important;
  min-height:100% !important;
  min-height:100vh !important;
  min-height:100dvh !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  position:static !important;
  overscroll-behavior-y:auto !important;
  touch-action:auto !important;
  -webkit-overflow-scrolling:touch !important;
}
body.samsung-settings-scroll-fix .admin-shell,
body.samsung-settings-scroll-fix.settings-native-scroll .admin-shell{
  display:block !important;
  height:auto !important;
  min-height:auto !important;
  max-height:none !important;
  overflow:visible !important;
  overflow-x:hidden !important;
  transform:none !important;
  contain:none !important;
  padding-bottom:max(140px, calc(env(safe-area-inset-bottom, 0px) + 84px)) !important;
}
body.samsung-settings-scroll-fix .card,
body.samsung-settings-scroll-fix .password-card,
body.samsung-settings-scroll-fix .privacy-card,
body.samsung-settings-scroll-fix .row{
  overflow:visible !important;
  max-height:none !important;
  transform:none !important;
}
body.samsung-settings-scroll-fix input,
body.samsung-settings-scroll-fix textarea,
body.samsung-settings-scroll-fix select{
  scroll-margin-top:96px;
  scroll-margin-bottom:120px;
}
@supports (-webkit-touch-callout: none){
  body.samsung-settings-scroll-fix,
  body.samsung-settings-scroll-fix.admin-body,
  body.samsung-settings-scroll-fix.settings-native-scroll{
    min-height:-webkit-fill-available !important;
  }
}


/* v1343 chat keyboard / iPhone viewport fix */
:root{
  --app-vh: 100dvh;
  --chat-keyboard-offset: 0px;
}
html, body {
  min-height: var(--app-vh);
}
body.app-body {
  width: 100%;
  min-height: var(--app-vh);
  height: auto;
}
body.app-body .view-main,
body.app-body .view-chat {
  min-height: var(--app-vh);
}
body.app-body.chat-open .view-chat {
  height: var(--app-vh) !important;
  max-height: var(--app-vh) !important;
}
body.app-body.chat-open.keyboard-open,
html.keyboard-open,
body.app-body.chat-open.keyboard-open {
  overscroll-behavior: none;
}
body.app-body.chat-open.keyboard-open {
  position: static;
  overflow: hidden !important;
  touch-action: pan-y;
}
body.app-body.chat-open.keyboard-open .view-chat {
  position: relative;
  inset: auto;
  overflow: hidden;
}
body.app-body.chat-open.keyboard-open .messages-area {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
body.app-body.chat-open.keyboard-open .composer-wrapper {
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
body.app-body.chat-open.keyboard-open::after {
  content: none;
}
@supports (height: 100svh) {
  :root { --app-vh: 100svh; }
}

.group-search-box{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.group-search-box .forward-search-input{flex:1;min-width:0}.group-search-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}.group-search-results{display:grid;gap:8px;max-height:min(52vh,420px);overflow:auto;padding-inline-end:2px}.group-search-result-item{width:100%;text-align:right;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.03);border-radius:14px;padding:12px;display:grid;gap:6px}.group-search-result-item.active{border-color:rgba(59,130,246,.7);box-shadow:0 0 0 1px rgba(59,130,246,.25) inset}.group-search-result-top{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;opacity:.9}.group-search-result-snippet{font-size:13px;line-height:1.7;word-break:break-word}
.group-search-result-item,.group-search-result-top,.group-search-result-snippet{color:#fff}
html[data-theme="whatsapp"] .group-search-result-item,html[data-theme="whatsapp"] .group-search-result-top,html[data-theme="whatsapp"] .group-search-result-snippet,body[data-theme="whatsapp"] .group-search-result-item,body[data-theme="whatsapp"] .group-search-result-top,body[data-theme="whatsapp"] .group-search-result-snippet,html[data-theme="sunset"] .group-search-result-item,html[data-theme="sunset"] .group-search-result-top,html[data-theme="sunset"] .group-search-result-snippet,body[data-theme="sunset"] .group-search-result-item,body[data-theme="sunset"] .group-search-result-top,body[data-theme="sunset"] .group-search-result-snippet,html[data-theme="rose"] .group-search-result-item,html[data-theme="rose"] .group-search-result-top,html[data-theme="rose"] .group-search-result-snippet,body[data-theme="rose"] .group-search-result-item,body[data-theme="rose"] .group-search-result-top,body[data-theme="rose"] .group-search-result-snippet{color:#111827}


/* v1350 */
#fullProfileModal .full-modal-card{max-width:min(680px,calc(100vw - 22px));max-height:min(92vh,920px);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;align-items:center}
#fullProfileModal .pb-box{width:100%}
.fp-workhours-card{width:100%;margin-top:16px;padding:14px 14px 12px;border-radius:18px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);overflow:hidden;min-width:0}
.fp-workhours-title{font-weight:900;font-size:16px;margin-bottom:4px}
.fp-workhours-subtitle{color:var(--text-muted);font-size:13px;line-height:1.8;margin-bottom:10px}
.fp-workhours-list{display:grid;gap:10px;width:100%;min-width:0}
.fp-workhours-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;border-radius:14px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.06);min-width:0;width:100%}
.fp-workhours-day{font-weight:800;min-width:86px;max-width:110px}
.fp-workhours-time{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap;color:var(--text-muted);min-width:0;flex:1}
.fp-workhours-empty{padding:12px;border-radius:14px;background:rgba(255,255,255,.03);color:var(--text-muted);text-align:center}
@media (max-width: 640px){
  #fullProfileModal .full-modal-card{max-width:calc(100vw - 12px);padding:18px 14px !important;border-radius:22px}
  .fp-workhours-card{padding:12px}
  .fp-workhours-item{flex-direction:column;align-items:flex-start}
  .fp-workhours-day{min-width:0}
  .fp-workhours-time{width:100%;justify-content:space-between;gap:8px}
}


.ai-quick-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.ai-quick-action{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:8px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.10);color:inherit;text-decoration:none;font-size:12px;font-weight:700;line-height:1.2;max-width:100%;cursor:pointer;transition:transform .15s ease, background .15s ease, border-color .15s ease}
.ai-quick-action:hover,.ai-quick-action:active{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.26);transform:translateY(-1px)}
.msg-row.other .ai-quick-action{color:var(--text)}
.msg-row.me .ai-quick-action{color:#fff}
html[data-theme="whatsapp"] .msg-row.other .ai-quick-action,
body[data-theme="whatsapp"] .msg-row.other .ai-quick-action,
html[data-theme="sunset"] .msg-row.other .ai-quick-action,
body[data-theme="sunset"] .msg-row.other .ai-quick-action,
html[data-theme="rose"] .msg-row.other .ai-quick-action,
body[data-theme="rose"] .msg-row.other .ai-quick-action{border-color:rgba(0,0,0,.12);background:rgba(0,0,0,.05)}
@media (max-width: 640px){
  .ai-quick-actions{gap:6px}
  .ai-quick-action{font-size:11px;padding:7px 10px;min-height:32px}
}

html[data-theme="whatsapp"] .verified-badge,
html[data-theme="whatsapp"] .room-verified-badge,
body[data-theme="whatsapp"] .verified-badge,
body[data-theme="whatsapp"] .room-verified-badge {
  filter: drop-shadow(0 0 1px rgba(29,155,240,0.16)) !important;
}
html[data-theme="whatsapp"] .gold-verified-badge,
html[data-theme="whatsapp"] .gold-room-verified-badge,
body[data-theme="whatsapp"] .gold-verified-badge,
body[data-theme="whatsapp"] .gold-room-verified-badge,
.premium-badge {
  filter: drop-shadow(0 0 1px rgba(245,179,1,0.16)) !important;
}
html[data-theme="rose"] .verified-badge,
html[data-theme="rose"] .room-verified-badge,
body[data-theme="rose"] .verified-badge,
body[data-theme="rose"] .room-verified-badge {
  filter: drop-shadow(0 0 0.4px rgba(0,119,217,0.6)) drop-shadow(0 0 1.8px rgba(255,255,255,0.22)) !important;
}
html[data-theme="rose"] .gold-verified-badge,
html[data-theme="rose"] .gold-room-verified-badge,
body[data-theme="rose"] .gold-verified-badge,
body[data-theme="rose"] .gold-room-verified-badge,
.premium-badge {
  filter: drop-shadow(0 0 0.4px rgba(204,139,0,0.6)) drop-shadow(0 0 1.8px rgba(255,255,255,0.2)) !important;
}

.posts-search-result-item,.post-author-avatar,.post-author-meta,.social-profile-tile,[data-post-user]{touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.social-profile-header-loading{animation:socialProfilePulse 1s ease-in-out infinite alternate;}
@keyframes socialProfilePulse{from{opacity:.82}to{opacity:1}}
