/* 1CallMe — Custom Styles */

/* ── Group call emoji reaction animations ───────────────────────────────────── */
@keyframes gcall-float-up {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0)   scale(0.6); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(-20px) scale(1.1); }
  85%  { opacity: 1; transform: translateX(-50%) translateY(-160px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-200px) scale(0.8); }
}
@keyframes gcall-badge-pop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block; line-height: 1; vertical-align: middle;
  user-select: none; pointer-events: none;
}
.icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c2c6d8; border-radius: 9999px; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Page transitions ──────────────────────────────────────────────────────── */
.page-enter { animation: pageSlideIn .22s ease-out both; }
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Glass card ────────────────────────────────────────────────────────────── */
.glass-card {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226,232,240,.5);
}

/* ── VIP styling ───────────────────────────────────────────────────────────── */
.vip-border { border-left: 4px solid #c9a900; }
.vip-badge  { background: linear-gradient(135deg,#c9a900,#ffe16d); color:#221b00; font-weight:700; }
.vip-reply-tag {
  display: inline-flex; align-items: center; gap: 2px;
  background: linear-gradient(135deg,#c9a900,#ffe16d);
  color: #221b00; font-size: 9px; font-weight: 800;
  padding: 1px 6px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em;
  vertical-align: middle; flex-shrink: 0;
}
.vip-conv-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg,#c9a900,#ffe16d);
  color: #221b00; font-size: 9px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; line-height: 1;
}

/* ── Ring animation (incoming call overlay) ────────────────────────────────── */
@keyframes ring-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,80,203,.5); }
  60%  { box-shadow: 0 0 0 20px rgba(0,80,203,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,80,203,0); }
}
.ring-animation {
  position: absolute; inset: 0; border-radius: 50%;
  animation: ring-pulse 1.4s ease-out infinite;
  pointer-events: none; z-index: 0;
}
#incoming-caller-avatar { position: relative; z-index: 1; }

/* ── Active call overlay — voice call ───────────────────────────────────────── */
@keyframes call-ring-outer {
  0%   { transform: scale(1);   opacity: .5; }
  80%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}
@keyframes call-ring-inner {
  0%   { transform: scale(1);   opacity: .35; }
  80%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
.call-ring-outer {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(255,255,255,.18);
  animation: call-ring-outer 2s ease-out infinite;
  pointer-events: none;
}
.call-ring-inner {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(255,255,255,.22);
  animation: call-ring-inner 2s ease-out infinite .5s;
  pointer-events: none;
}
#active-call-overlay.voice-call {
  background: linear-gradient(160deg, #0a1628 0%, #0d2b55 45%, #0050cb 100%);
}
#active-call-overlay.video-call {
  background: #000;
}

/* ── Camera crop handles ────────────────────────────────────────────────────── */
.cam-ch {
  position: absolute; width: 18px; height: 18px;
  background: #fff; border: 2px solid rgba(0,0,0,0.35); border-radius: 3px;
  z-index: 5; touch-action: none;
}
.cam-eh {
  position: absolute; background: rgba(255,255,255,0.75); border-radius: 10px;
  z-index: 5; touch-action: none;
}
.cam-eh[data-h="t"], .cam-eh[data-h="b"] { width: 32px; height: 10px; }
.cam-eh[data-h="l"], .cam-eh[data-h="r"] { width: 10px; height: 32px; }
.signed-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #6200ea; color: #fff;
  padding: 2px 10px; border-radius: 9999px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar-link {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px; font-size: 14px; font-weight: 400;
  color: #424656; border-right: 4px solid transparent;
  transition: all .15s ease; cursor: pointer; text-decoration: none;
}
.sidebar-link:hover  { background: #eceef0; color: #191c1e; }
.sidebar-link.active { color: #0050cb; font-weight: 700; border-right-color: #0050cb; background: #f2f4f6; }

/* ── Sidebar (desktop fixed) ───────────────────────────────────────────────── */
#app-sidebar {
  width: 280px; flex-shrink: 0; height: 100vh;
  background: #fff; border-right: 1px solid #c2c6d8;
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; z-index: 40;
  overflow: hidden;
}
.has-sidebar { margin-left: 280px; }

@media (max-width: 768px) {
  #app-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
  }
  #app-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    /* Must be above the bottom nav (z-100) so the sidebar isn't obscured */
    z-index: 200;
  }
  .has-sidebar { margin-left: 0; }
}


/* ── Page column layout (wrap screens) — static bottom nav ─────────────────── */
.page-col {
  display: flex; flex-direction: column;
  height: 100dvh; height: 100vh; /* bounded so page-body can scroll */
}
.page-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ── Bottom nav ────────────────────────────────────────────────────────────── */
.bottom-nav {
  /* Static in page-col layout — not fixed */
  display: none; /* hidden on desktop */
  background: #fff;
  border-top: 1px solid #e2e4ec;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}
@media (max-width: 767px) {
  .bottom-nav {
    display: flex;
    position: sticky;
    bottom: 0;
  }
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 4px 6px;
  color: #727687; cursor: pointer;
  font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  transition: color .15s; border: none; background: transparent;
}
.bottom-nav-item.active { color: #0050cb; }

/* ── Mobile page header + breadcrumb ──────────────────────────────────────── */
.mobile-page-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; min-height: 52px;
  background: #fff; border-bottom: 1px solid #e2e4ec;
  position: sticky; top: 0; z-index: 30;
}

/* ── FAB ───────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  /* clear the sticky bottom nav height (~57px) + gap */
  bottom: calc(57px + env(safe-area-inset-bottom, 0px) + 16px);
  right: 20px;
  width: 56px; height: 56px; border-radius: 50%;
  background: #0050cb; color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,80,203,.4);
  z-index: 90; transition: transform .2s, box-shadow .2s;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 16px rgba(0,80,203,.5); }
@media (min-width: 768px) { .fab { bottom: 24px; } }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  background: #2d3133; color: #eff1f3;
  padding: 12px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  pointer-events: auto; cursor: pointer;
  animation: toastIn .25s ease-out both; max-width: 320px;
}
.toast.success { background: #166534; }
.toast.error   { background: #ba1a1a; }
.toast.info    { background: #003fa4; }
@keyframes toastIn  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:scale(.95); } }

/* ── Spinners & skeletons ──────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid #dae1ff; border-top-color: #0050cb;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg,#e6e8ea 25%,#eceef0 50%,#e6e8ea 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px;
}
@keyframes shimmer { from { background-position:200% 0; } to { background-position:-200% 0; } }

/* ══════════════════════════════════════════════════════════════════════════════
   WHATSAPP-STYLE MESSAGE BUBBLES
   ══════════════════════════════════════════════════════════════════════════ */

/* Chat background (messages list) */
#msgs-list {
  background: #f0f2f5;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23e8eaed' fill-opacity='0.6' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── Message row layout ────────────────────────────────────────────────────── */
.msg-row {
  display: flex; align-items: flex-end;
  padding: 2px 12px; gap: 8px;
  transition: background .1s;
}
.msg-row-out { justify-content: flex-end; }
.msg-row-in  { justify-content: flex-start; }
.msg-selected { background: rgba(0,80,203,.08); }

.msg-bubble-wrap {
  max-width: min(75%, 340px);
  cursor: default; user-select: text;
}
@media (max-width: 480px) {
  .msg-bubble-wrap { max-width: 88%; }
}

/* ── Sender identity line ──────────────────────────────────────────────────── */
.msg-sender-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  margin-bottom: 2px; padding-left: 2px;
}
.sender-name {
  font-size: 12px; font-weight: 700; color: #0050cb;
}
.sender-id {
  font-size: 11px; color: #727687;
}
.signed-badge-sm {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 9px; font-weight: 700; color: #6200ea;
  background: #ede7ff; padding: 1px 5px; border-radius: 999px;
}
.institution-badge-sm {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 9px; font-weight: 700; color: #0050cb;
  background: #dae1ff; padding: 1px 6px; border-radius: 999px;
}
.designation-badge {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 9px; font-weight: 700; color: #00695c;
  background: #e0f2f1; padding: 1px 6px; border-radius: 999px;
}

/* ── Outgoing bubble ───────────────────────────────────────────────────────── */
.bubble-out {
  background: #dcf8c6;
  color: #111;
  border-radius: 12px 12px 4px 12px;
  padding: 6px 10px 4px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  word-break: break-word;
}
.bubble-out::after {
  content: '';
  position: absolute; bottom: 0; right: -7px;
  border: 7px solid transparent;
  border-left-color: #dcf8c6;
  border-bottom: 0; border-right: 0;
}

/* ── Incoming bubble ───────────────────────────────────────────────────────── */
.bubble-in {
  background: #fff;
  color: #111;
  border-radius: 12px 12px 12px 4px;
  padding: 6px 10px 4px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  word-break: break-word;
}
.bubble-in::after {
  content: '';
  position: absolute; bottom: 0; left: -7px;
  border: 7px solid transparent;
  border-right-color: #fff;
  border-bottom: 0; border-left: 0;
}
.bubble-in.vip-bubble { border-left: 3px solid #c9a900; }
.bubble-in.vip-bubble::after { border-right-color: #fff; left: -10px; }

/* ── Bubble content ────────────────────────────────────────────────────────── */
.bubble-title {
  font-weight: 700; font-size: 12.5px;
  margin-bottom: 3px; padding-bottom: 4px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.bubble-body {
  font-size: 14px; line-height: 1.45;
}
.bubble-img {
  max-width: 220px; max-height: 220px;
  border-radius: 8px; display: block;
  cursor: pointer; object-fit: cover;
  margin-top: 4px; margin-bottom: 2px;
}
.bubble-audio {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; min-width: 180px;
}
.bubble-file {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; background: rgba(0,0,0,.05);
  border-radius: 6px; font-size: 12px;
  cursor: pointer; margin-top: 4px;
}
.bubble-file:hover { background: rgba(0,0,0,.09); }
.expired-msg {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: #727687; font-style: italic;
}
.signed-badge-in-bubble {
  display: flex; align-items: center; gap: 2px;
  font-size: 9px; font-weight: 700; color: #6200ea; opacity: .8;
  margin-bottom: 3px;
}

/* ── Bubble footer (time + ticks inside bubble) ────────────────────────────── */
.bubble-footer {
  display: flex; align-items: center; gap: 3px;
  margin-top: 3px; justify-content: flex-end; flex-wrap: wrap;
}
.bubble-footer-out { /* outgoing — ticks visible */ }
.bubble-footer-in  { /* incoming — no ticks */ }
.bubble-time {
  font-size: 10px; color: #8a8a8a; white-space: nowrap;
}
.bubble-tick { font-size: 14px; line-height: 1; }
.read-tick   { color: #53bdeb; }
.unread-tick { color: #999; }

/* ── Expiry and DNR tags ───────────────────────────────────────────────────── */
.expiry-tag {
  display: flex; align-items: center; gap: 2px;
  font-size: 9px; color: #d97706;
}
.dnr-tag {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 9px; color: #727687;
  background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 999px;
}

/* ── Context menu ──────────────────────────────────────────────────────────── */
.msg-ctx-menu {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.12);
  overflow: hidden;
  min-width: 160px;
  z-index: 500;
  animation: ctxIn .12s ease-out both;
}
@keyframes ctxIn {
  from { opacity:0; transform:scale(.92); }
  to   { opacity:1; transform:scale(1); }
}
.msg-ctx-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  font-size: 14px; font-weight: 500; color: #191c1e;
  background: transparent; border: none; cursor: pointer;
  text-align: left; transition: background .1s;
}
.msg-ctx-menu button:hover { background: #f2f4f6; }
.msg-ctx-menu button.danger { color: #ba1a1a; }
.msg-ctx-menu button.danger:hover { background: #fff0f0; }
.msg-ctx-menu button + button { border-top: 1px solid #f0f0f0; }

/* ── Selection mode bar ────────────────────────────────────────────────────── */
.sel-bar {
  background: #0050cb; color: #fff;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ── Selection checkbox ────────────────────────────────────────────────────── */
.sel-check {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #727687;
}
.sel-check.checked { color: #0050cb; }

/* ── Media toolbar buttons (reply area) ────────────────────────────────────── */
.media-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: #727687; cursor: pointer; transition: all .12s; background: transparent;
  flex-shrink: 0; border: none; padding: 0;
}
.media-btn:hover { background: #eceef0; color: #0050cb; }
.media-btn.active { color: #ba1a1a; background: #ffdad6; }

/* ── Emoji picker ──────────────────────────────────────────────────────────── */
.emoji-picker-grid {
  display: grid; grid-template-columns: repeat(8,1fr);
  gap: 2px; overflow-y: auto; max-height: 180px;
}
@media (max-width: 400px) { .emoji-picker-grid { grid-template-columns: repeat(6,1fr); } }
.emoji-btn {
  padding: 5px; border-radius: 6px; font-size: 19px;
  line-height: 1; text-align: center; cursor: pointer;
  border: none; background: transparent;
}
.emoji-btn:hover { background: #eceef0; }

/* ── Quoted reply bar ──────────────────────────────────────────────────────── */
.reply-quote-bar {
  padding: 6px 10px;
  background: #f2f4f6;
  border-left: 3px solid #0050cb;
  border-radius: 6px;
  font-size: 12px;
}

/* ── Voice recording ────────────────────────────────────────────────────────── */
.voice-recording-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #ffdad6; border-radius: 10px;
}
.voice-dot {
  width: 10px; height: 10px; flex-shrink: 0;
  background: #ba1a1a; border-radius: 50%;
  animation: voicePulse 1s infinite;
}
@keyframes voicePulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(.7); }
}

/* ── Reply media bar ────────────────────────────────────────────────────────── */
.reply-media-bar {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 12px 0; border-top: 1px solid #f0f0f0;
}

/* ── OTP input ─────────────────────────────────────────────────────────────── */
.otp-input {
  width: 48px; height: 60px; text-align: center;
  font-size: 24px; font-weight: 700;
  border: 2px solid #c2c6d8; border-radius: 8px;
  outline: none; transition: border-color .15s;
  background: #f7f9fb; color: #191c1e;
}
.otp-input:focus { border-color: #0050cb; background: #fff; }

/* ── Settings rows ──────────────────────────────────────────────────────────── */
.settings-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-radius: 12px;
  transition: background .15s;
}
.settings-row:hover { background: var(--md-sys-color-surface-container, #eceef0); }

/* ── PIN boxes ───────────────────────────────────────────────────────────────── */
.pin-box { transition: border-color .15s, box-shadow .15s; }
.pin-box:focus { box-shadow: 0 0 0 3px rgba(0,80,203,.2); }

/* ── Dashboard summary ──────────────────────────────────────────────────────── */
.stat-card { transition: transform .15s; }
.stat-card:hover { transform: translateY(-2px); }
.quick-action { text-align: left; }

/* ── Ads ───────────────────────────────────────────────────────────────────── */
.ad-banner {
  background: #f2f4f6; border-top: 1px solid #e6e8ea;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px; font-size: 13px; min-height: 44px;
}
.ad-label {
  background: transparent; border: 1px solid #727687;
  color: #727687; font-size: 9px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0;
}
.reward-progress { height: 4px; background: #dae1ff; border-radius: 9999px; overflow: hidden; }
.reward-progress-fill { height: 100%; background: #0050cb; border-radius: 9999px; transition: width .5s linear; }

/* ── Pricing ───────────────────────────────────────────────────────────────── */
.pricing-card { transition: transform .2s ease, box-shadow .2s ease; }
.pricing-card:hover { transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgba(0,0,0,.08); }
.pricing-card.featured { transform: scale(1.04); }
.pricing-card.featured:hover { transform: scale(1.04) translateY(-4px); }

/* ── Code blocks ───────────────────────────────────────────────────────────── */
.code-block {
  background: #1e293b; color: #e2e8f0;
  border-radius: 8px; padding: 16px;
  font-family: 'JetBrains Mono',monospace; font-size: 13px; line-height: 1.6;
  overflow-x: auto;
}
.code-key    { color: #b3c5ff; }
.code-value  { color: #a7f3d0; }
.code-method { color: #67e8f9; }
.code-url    { color: #fbbf24; }
.code-comment{ color: #64748b; font-style: italic; }
.api-method  { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 700; font-family: 'JetBrains Mono',monospace; }
.method-post { background: #dbeafe; color: #1d4ed8; }
.method-get  { background: #dcfce7; color: #166534; }
.method-del  { background: #fee2e2; color: #b91c1c; }

/* ── Ring animation ─────────────────────────────────────────────────────────── */
@keyframes ringPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,80,203,.4); }
  70%  { box-shadow: 0 0 0 20px rgba(0,80,203,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,80,203,0); }
}
.ringing { animation: ringPulse 1s ease-out infinite; }

/* ── File attachment chip ───────────────────────────────────────────────────── */
.attachment-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f2f4f6; border: 1px solid #e0e3e5;
  border-radius: 8px; padding: 8px 12px;
  font-size: 13px; color: #191c1e;
}

/* ── Interstitial ad ─────────────────────────────────────────────────────────── */
.ad-interstitial { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
.interstitial-card { background: #fff; border-radius: 16px; max-width: 420px; width: 90%; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,.25); animation: popIn .3s ease-out both; }
@keyframes popIn { from { opacity:0; transform:scale(.92); } to { opacity:1; transform:scale(1); } }

/* ── Profile avatar ─────────────────────────────────────────────────────────── */
.avatar-ring { border: 3px solid transparent; background: linear-gradient(#fff,#fff) padding-box, linear-gradient(135deg,#0050cb,#5f00e3) border-box; }

/* ── Verified badge overlay ──────────────────────────────────────────────────── */
.verified-badge { position: absolute; bottom: 0; right: 0; width: 18px; height: 18px; border-radius: 50%; background: #c9a900; color: #221b00; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 900; border: 2px solid #fff; }

/* ── Signature seal ──────────────────────────────────────────────────────────── */
.sig-seal { background: linear-gradient(135deg,#001849,#001438); border-color: #1a3a7a; }
.sig-seal-ring { border-color: #2a4a9a; background: rgba(0,80,203,.25); }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */

/* Mobile (<480px) tweaks */
@media (max-width: 480px) {
  .otp-input { width: 40px; height: 52px; font-size: 20px; }
  .pricing-card.featured { transform: scale(1); }
  .pricing-card.featured:hover { transform: translateY(-4px); }
  .bubble-img { max-width: 180px; max-height: 180px; }
}

/* Very small (<360px) */
@media (max-width: 360px) {
  .otp-input { width: 36px; height: 48px; font-size: 18px; }
  .msg-ctx-menu { min-width: 140px; }
  .msg-ctx-menu button { padding: 10px 12px; font-size: 13px; }
}

/* Desktop: no static nav needed, page-col just scrolls normally */
@media (min-width: 768px) {
  .page-col { display: block; min-height: auto; }
  .page-body { overflow: visible; }
}

/* ── Msgs-list scrollbar ────────────────────────────────────────────────────── */
#msgs-list::-webkit-scrollbar { width: 4px; }
#msgs-list::-webkit-scrollbar-track { background: transparent; }
#msgs-list::-webkit-scrollbar-thumb { background: #c2c6d8; border-radius: 9999px; }
#msgs-list::-webkit-scrollbar-thumb:hover { background: #8a8fa8; }

/* ── Quoted message preview (inside bubble) ─────────────────────────────────── */
.quoted-preview {
  display: flex; align-items: stretch; gap: 6px;
  border-radius: 6px; padding: 5px 8px; margin-bottom: 5px;
  overflow: hidden; cursor: pointer;
}
.quoted-preview-out {
  background: rgba(0,0,0,.07);
}
.quoted-preview-in {
  background: rgba(0,0,0,.05);
}
.quoted-preview-bar {
  width: 3px; border-radius: 2px; flex-shrink: 0;
  background: #0050cb; align-self: stretch;
}
.quoted-preview-out .quoted-preview-bar { background: #1a7f37; }
.quoted-sender {
  font-size: 11px; font-weight: 700; color: #0050cb;
  margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quoted-preview-out .quoted-sender { color: #1a7f37; }
.quoted-text {
  font-size: 12px; color: #555; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Highlight flash when scrolling to a quoted source message */
.msg-highlight {
  animation: msgFlash 1.2s ease-out both;
}
@keyframes msgFlash {
  0%,20%  { background: rgba(0,80,203,.18); border-radius: 10px; }
  100%    { background: transparent; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   DARK MODE OVERRIDES  (applied when <html class="dark">)
   ══════════════════════════════════════════════════════════════════════════ */

.dark body { background: #0f1117; color: #e2e3ea; }

/* ── Page backgrounds (the most-missed override) ────────────────────────── */
.dark .bg-background  { background-color: #0f1117 !important; }
.dark .bg-surface-dim { background-color: #0d0f14 !important; }
.dark .min-h-screen   { background-color: #0f1117; } /* landing / premium / public pages */

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.dark #app-sidebar { background: #16181f; border-right-color: #2a2c36; }
.dark .sidebar-link { color: #9a9cb0; }
.dark .sidebar-link:hover { background: #1e2028; color: #e2e3ea; }
.dark .sidebar-link.active { color: #b3c5ff; background: #1a2040; border-right-color: #b3c5ff; }

/* ── Bottom nav ────────────────────────────────────────────────────────── */
.dark .bottom-nav { background: #16181f; border-top-color: #2a2c36; }
.dark .bottom-nav-item { color: #6b6d80; }
.dark .bottom-nav-item.active { color: #b3c5ff; }

/* ── Mobile page header ─────────────────────────────────────────────────── */
.dark .mobile-page-header { background: #16181f; border-bottom-color: #2a2c36; }

/* ── Landing / public page nav ──────────────────────────────────────────── */
.dark nav.sticky { background: rgba(15,17,23,.92) !important; border-bottom-color: #2a2c36 !important; }

/* ── Cards / surface containers ─────────────────────────────────────────── */
.dark .bg-white,
.dark .bg-surface-container-lowest  { background-color: #16181f !important; }
.dark .bg-surface-container-low     { background-color: #1a1c24 !important; }
.dark .bg-surface-container         { background-color: #1e2028 !important; }
.dark .bg-surface-container-high    { background-color: #22242e !important; }
.dark .bg-surface-container-highest { background-color: #272930 !important; }
.dark .bg-surface,
.dark .bg-surface-bright            { background-color: #0f1117 !important; }
.dark .bg-primary-fixed             { background-color: #1a2040 !important; }
.dark .bg-primary-fixed .text-primary { color: #b3c5ff !important; }

/* ── Borders ──────────────────────────────────────────────────────────── */
.dark .border-outline-variant { border-color: #2a2c36 !important; }
.dark .border-outline         { border-color: #383b48 !important; }

/* ── Text ─────────────────────────────────────────────────────────────── */
.dark .text-on-surface              { color: #e2e3ea !important; }
.dark .text-on-surface-variant      { color: #8f9099 !important; }
.dark .text-on-background           { color: #e2e3ea !important; }
.dark .text-on-surface-container    { color: #c8c9d2 !important; }

/* ── Inputs ───────────────────────────────────────────────────────────── */
.dark input, .dark textarea, .dark select {
  background-color: #1a1c24 !important; color: #e2e3ea !important;
  border-color: #383b48 !important;
}
.dark input::placeholder, .dark textarea::placeholder { color: #55576a; }
.dark input:focus, .dark textarea:focus, .dark select:focus {
  border-color: #b3c5ff !important; outline-color: #b3c5ff;
}
.dark select option { background: #1e2028; color: #e2e3ea; }

/* ── Modals & overlays ───────────────────────────────────────────────── */
.dark .bg-surface-container-lowest.rounded-2xl,
.dark .bg-surface-container-lowest.rounded-t-2xl { background-color: #16181f !important; }

/* ── Message bubbles ─────────────────────────────────────────────────── */
.dark .bubble-out { background: #163d28; color: #d8f5e5; }
.dark .bubble-out::after { border-left-color: #163d28; }
.dark .bubble-in  { background: #22242e; color: #e2e3ea; }
.dark .bubble-in::after { border-right-color: #22242e; }
.dark .bubble-in.vip-bubble::after { border-right-color: #22242e; }
.dark .bubble-time { color: #6b6d80; }

/* ── Message list background ─────────────────────────────────────────── */
.dark #msgs-list {
  background: #0c0e13;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%231a1c24' fill-opacity='0.6' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── Context menu ────────────────────────────────────────────────────── */
.dark .msg-ctx-menu { background: #1e2028; box-shadow: 0 8px 32px rgba(0,0,0,.6); }
.dark .msg-ctx-menu button { color: #e2e3ea; }
.dark .msg-ctx-menu button:hover { background: #272930; }
.dark .msg-ctx-menu button + button { border-top-color: #2a2c36; }

/* ── OTP inputs ──────────────────────────────────────────────────────── */
.dark .otp-input { background: #1a1c24 !important; border-color: #383b48 !important; color: #e2e3ea !important; }
.dark .otp-input:focus { border-color: #b3c5ff !important; background: #1e2028 !important; }
.dark .pin-box { background: #1a1c24 !important; border-color: #383b48 !important; color: #e2e3ea !important; }
.dark .pin-box:focus { border-color: #b3c5ff !important; background: #1e2028 !important; }

/* ── Reply quote bar ─────────────────────────────────────────────────── */
.dark .reply-quote-bar { background: #1a1c24; border-left-color: #b3c5ff; }

/* ── Attachment chip ─────────────────────────────────────────────────── */
.dark .attachment-chip { background: #1e2028; border-color: #383b48; color: #e2e3ea; }

/* ── Voice recording bar ─────────────────────────────────────────────── */
.dark .voice-recording-bar { background: #2d1a1a; }

/* ── Scrollbars ──────────────────────────────────────────────────────── */
.dark ::-webkit-scrollbar-thumb { background: #383b48; }
.dark #msgs-list::-webkit-scrollbar-thumb { background: #383b48; }

/* ── VIP elements ────────────────────────────────────────────────────── */
.dark .vip-conv-dot { border-color: #16181f; }

/* ── Quoted preview ──────────────────────────────────────────────────── */
.dark .quoted-preview-out { background: rgba(255,255,255,.05); }
.dark .quoted-preview-in  { background: rgba(255,255,255,.04); }
.dark .quoted-text { color: #8f9099; }
.dark .quoted-preview-bar { background: #b3c5ff; }
.dark .quoted-preview-out .quoted-preview-bar { background: #4caf82; }
.dark .quoted-sender { color: #b3c5ff; }
.dark .quoted-preview-out .quoted-sender { color: #4caf82; }

/* ── Glass card ──────────────────────────────────────────────────────── */
.dark .glass-card { background: rgba(22,24,31,.85); border-color: rgba(42,44,54,.7); }

/* ── Pricing cards ───────────────────────────────────────────────────── */
.dark .pricing-card { background: #16181f !important; }
.dark .pricing-card.featured { background: linear-gradient(160deg,#1a2040,#1e2028) !important; }

/* ── Premium / landing page sections ────────────────────────────────── */
.dark .bg-surface-container-low.rounded-2xl { background-color: #1a1c24 !important; }

/* ── Interstitial ────────────────────────────────────────────────────── */
.dark .interstitial-card { background: #16181f; }

/* ── Avatar ring ─────────────────────────────────────────────────────── */
.dark .avatar-ring { background: linear-gradient(#16181f,#16181f) padding-box, linear-gradient(135deg,#b3c5ff,#a77dfd) border-box; }

/* ── Settings / misc utility ─────────────────────────────────────────── */
.dark .bg-amber-100 { background-color: #3d2e00 !important; }
.dark .text-amber-800 { color: #fbbf24 !important; }
.dark .bg-green-50  { background-color: #0d2318 !important; }
.dark .bg-blue-50   { background-color: #0d1a30 !important; }
.dark .bg-purple-50 { background-color: #1a0d30 !important; }
.dark .bg-yellow-50 { background-color: #2a2000 !important; }
.dark .bg-red-50    { background-color: #2d0d0d !important; }
.dark .text-gray-600,.dark .text-gray-700,.dark .text-gray-800 { color: #9a9cb0 !important; }

/* ── Signature seal ──────────────────────────────────────────────────── */
.dark .sig-seal { background: linear-gradient(135deg,#1a2040,#0d1628) !important; border-color: #2a3a6a !important; }
.dark .sig-seal-ring { border-color: #3a4a7a !important; }

/* ── Dividers / horizontal rules ────────────────────────────────────── */
.dark hr, .dark .divide-y > * + * { border-color: #2a2c36; }

/* ── Code block (already dark, ensure text visible) ─────────────────── */
.dark .code-block { background: #0d0f14; }

/* ── Ad banner (hidden but just in case) ────────────────────────────── */
.dark .ad-banner { background: #16181f; border-top-color: #2a2c36; }

/* ── Hover-state backgrounds (Tailwind hover: variants are separate selectors) */
.dark .hover\:bg-surface-container-lowest:hover  { background-color: #16181f !important; }
.dark .hover\:bg-surface-container-low:hover     { background-color: #1a1c24 !important; }
.dark .hover\:bg-surface-container:hover         { background-color: #1e2028 !important; }
.dark .hover\:bg-surface-container-high:hover    { background-color: #22242e !important; }
.dark .hover\:bg-surface-container-highest:hover { background-color: #272930 !important; }
.dark .hover\:bg-yellow-50:hover                 { background-color: #2a2000 !important; }
.dark .hover\:bg-green-50:hover                  { background-color: #0d2318 !important; }
.dark .hover\:bg-blue-50:hover                   { background-color: #0d1a30 !important; }
.dark .hover\:bg-primary-fixed:hover             { background-color: #1a2040 !important; }

/* ── Colored utility text — dark versions of Tailwind palette classes ── */
.dark .text-yellow-700  { color: #fde047 !important; }
.dark .text-green-700   { color: #86efac !important; }
.dark .text-blue-700    { color: #93c5fd !important; }
.dark .text-red-700     { color: #fca5a5 !important; }
.dark .text-indigo-700  { color: #a5b4fc !important; }
.dark .text-indigo-800  { color: #818cf8 !important; }
.dark .text-amber-700   { color: #fcd34d !important; }
.dark .text-teal-700    { color: #5eead4 !important; }
.dark .text-purple-700  { color: #d8b4fe !important; }

/* ── Semantic text colors (Material You — poor contrast on dark bg) ─── */
.dark .text-secondary { color: #cfbcff !important; }
.dark .text-tertiary  { color: #e9c400 !important; }
.dark .text-error     { color: #ff897d !important; }

/* ── Misc dark utility backgrounds ───────────────────────────────────── */
.dark .bg-indigo-50          { background-color: rgba(79,70,229,.15) !important; }
.dark .bg-indigo-100         { background-color: rgba(79,70,229,.20) !important; }
.dark .bg-indigo-200         { background-color: rgba(79,70,229,.28) !important; }
.dark .bg-amber-50           { background-color: rgba(217,119,6,.15) !important; }
/* bg-amber-100 dark override already defined above — kept as #3d2e00 */
.dark .bg-amber-200          { background-color: rgba(217,119,6,.28) !important; }
.dark .bg-teal-50            { background-color: rgba(20,184,166,.15) !important; }
.dark .bg-teal-100           { background-color: rgba(20,184,166,.20) !important; }
.dark .bg-tertiary-container { background-color: #2a2000 !important; }

/* ── Marketplace listing-status ring (Instagram-stories style) ───────── */
@keyframes listing-ring-spin {
  to { transform: rotate(360deg); }
}
.listing-ring-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.listing-ring-wrap::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(#7c3aed, #2563eb, #10b981, #f59e0b, #7c3aed);
  animation: listing-ring-spin 3s linear infinite;
  z-index: 0;
}
.listing-ring-wrap::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-lowest, #fff);
  z-index: 1;
}
.listing-ring-wrap > * {
  position: relative;
  z-index: 2;
}
.dark .listing-ring-wrap::after { background: #16181f; }

/* ── PWA install modal ───────────────────────────────────────────────── */
#install-modal-overlay {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

/* ── Swipe gestures ──────────────────────────────────────────────────────── */

/* Conv list swipe-to-reveal-delete */
.conv-swipe-wrap {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.conv-swipe-inner {
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  will-change: transform;
  position: relative;
  z-index: 1;
}
.conv-swipe-actions {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  display: flex;
  align-items: stretch;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
}
.conv-swipe-wrap.sw-open .conv-swipe-inner  { transform: translateX(-80px); }
.conv-swipe-wrap.sw-open .conv-swipe-actions { pointer-events: auto; }
.conv-delete-btn {
  width: 80px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; font-size: 10px; font-weight: 600;
  color: #fff;
  background: var(--md-sys-color-error, #b3261e);
  border: none; cursor: pointer;
}
.conv-delete-btn:active { opacity: 0.85; }

/* Contact card swipe-to-reveal actions */
.contact-swipe-wrap {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
}
.contact-swipe-inner {
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  will-change: transform;
  position: relative; z-index: 1;
  border-radius: 0.75rem;
  margin-bottom: 0 !important; /* mb handled by wrap */
}
.contact-swipe-actions-mobile {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  display: flex; align-items: center;
  gap: 0; padding: 0;
  pointer-events: none;
  z-index: 0;
}
.contact-swipe-wrap.sw-open .contact-swipe-inner        { transform: translateX(-132px); }
.contact-swipe-wrap.sw-open .contact-swipe-actions-mobile { pointer-events: auto; }
.csw-action-btn {
  width: 44px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; color: #fff;
  font-size: 0;
}
.csw-action-btn .material-symbols-outlined { font-size: 20px; }
.csw-call  { background: #22c55e; }
.csw-msg   { background: var(--md-sys-color-primary, #0050cb); }
.csw-del   { background: var(--md-sys-color-error, #b3261e); width: 44px; }

/* Message bubble swipe-to-reply indicator */
.msg-row { position: relative; }
.msg-swipe-reply-hint {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--md-sys-color-primary-container);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.msg-row-in  .msg-swipe-reply-hint { left: -36px; }
.msg-row-out .msg-swipe-reply-hint { right: -36px; }
.msg-row.sw-replying .msg-swipe-reply-hint { opacity: 1; transform: translateY(-50%) scale(1.15); }

/* Bottom-sheet swipe-to-close drag handle */
.sw-sheet-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--md-sys-color-outline-variant);
  margin: 0 auto 12px;
  flex-shrink: 0;
}

/* Nav swipe pulse (brief highlight of active tab on swipe) */
@media (max-width: 767px) {
  .bottom-nav { touch-action: pan-y; }
}

/* ── Status ring ─────────────────────────────────────────────────────────── */
@keyframes status-ring-spin {
  to { transform: rotate(360deg); }
}
.status-ring-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.status-ring-wrap::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #0050cb 0%, #5f00e3 50%, #0050cb 100%);
  animation: status-ring-spin 7s linear infinite;
  z-index: 0;
}
.status-ring-wrap::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-lowest, #fff);
  z-index: 1;
}
.status-ring-wrap > * { position: relative; z-index: 2; }
.dark .status-ring-wrap::after { background: #16181f; }

/* Viewed — muted, static */
.status-ring-viewed::before {
  background: #9aa0b8;
  animation: none;
}

/* Card variant — inner mask matches gradient card bg */
.status-ring-card::after {
  background: #0050cb;
}

/* ── Status story full-screen viewer ───────────────────────────────────── */
#status-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #000;
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
}
#status-viewer-overlay .sv-progress-bar {
  display: flex;
  gap: 3px;
  padding: 10px 12px 6px;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
}
#status-viewer-overlay .sv-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.35);
  overflow: hidden;
  position: relative;
}
#status-viewer-overlay .sv-seg-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: #fff;
  transition: none;
}
#status-viewer-overlay .sv-seg-fill.animating {
  transition: width linear;
}
#status-viewer-overlay .sv-header {
  position: absolute;
  top: 28px; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  z-index: 10;
}
#status-viewer-overlay .sv-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  opacity: .85;
  line-height: 1;
  font-family: 'Material Symbols Outlined', sans-serif;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
#status-viewer-overlay .sv-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
#status-viewer-overlay .sv-media-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
}
#status-viewer-overlay .sv-media-vid {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#status-viewer-overlay .sv-text-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
  font-size: clamp(1.4rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
#status-viewer-overlay .sv-mkt-card {
  max-width: 380px;
  width: 90%;
  background: #1a1a2e;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
#status-viewer-overlay .sv-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 16px 20px;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
  color: #fff;
  font-size: 0.95rem;
  z-index: 5;
}
/* Tap zones */
#status-viewer-overlay .sv-tap-prev,
#status-viewer-overlay .sv-tap-next {
  position: absolute;
  top: 0; bottom: 0;
  width: 35%;
  z-index: 8;
  cursor: pointer;
}
#status-viewer-overlay .sv-tap-prev { left: 0; }
#status-viewer-overlay .sv-tap-next { right: 0; }

/* ── Status viewers panel (author only, slides up inside the overlay) ───── */
.sv-viewers-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--md-sys-color-surface-container-lowest, #fff);
  border-radius: 20px 20px 0 0;
  padding: 10px 16px 28px;
  z-index: 20;
  max-height: 48vh;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
  animation: svPanelIn .2s ease-out both;
}
@keyframes svPanelIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.sv-viewers-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--md-sys-color-outline-variant);
  margin: 0 auto 12px;
}

/* ── Status creation modal ──────────────────────────────────────────────── */
#status-create-sheet .sc-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--md-sys-color-surface-container);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  transition: border-color .15s, background .15s;
  flex: 1;
}
#status-create-sheet .sc-type-btn.active,
#status-create-sheet .sc-type-btn:hover {
  border-color: var(--md-sys-color-primary);
  background: color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent);
}
#status-create-sheet .sc-bg-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .15s;
}
#status-create-sheet .sc-bg-swatch:hover,
#status-create-sheet .sc-bg-swatch.active {
  transform: scale(1.2);
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}

/* ── Storage progress bar ───────────────────────────────────────────────── */
.storage-bar-wrap {
  height: 6px;
  border-radius: 3px;
  background: var(--md-sys-color-surface-container-high);
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--md-sys-color-primary);
  transition: width .4s ease;
}
.storage-bar-fill.warn  { background: #f59e0b; }
.storage-bar-fill.danger{ background: #ef4444; }

/* ── VIP tier ring for status story viewer header ───────────────────────── */
@keyframes sv-vip-spin {
  to { transform: rotate(360deg); }
}
.sv-vip-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sv-vip-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  animation: sv-vip-spin 3s linear infinite;
  z-index: 0;
}
.sv-vip-ring::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: #000;
  z-index: 1;
}
.sv-vip-ring > * { position: relative; z-index: 2; }
/* Pro — gold/amber */
.sv-vip-ring.pro::before {
  background: conic-gradient(#f59e0b, #fbbf24, #fde68a, #d97706, #f59e0b);
}
/* Institutional — purple/royal-blue */
.sv-vip-ring.institutional::before {
  background: conic-gradient(#7c3aed, #a78bfa, #818cf8, #0050cb, #7c3aed);
}

/* ── VIP tier ring for listing contexts (conversations, contacts, members) ── */
@keyframes vip-listing-spin {
  to { transform: rotate(360deg); }
}
.vip-listing-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vip-listing-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  animation: vip-listing-spin 6s linear infinite;
  z-index: 0;
}
.vip-listing-ring::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-lowest, #fff);
  z-index: 1;
}
.vip-listing-ring > * { position: relative; z-index: 2; }
.dark .vip-listing-ring::after { background: #16181f; }
.vip-listing-ring.pro::before {
  background: conic-gradient(from 0deg, #d97706 0%, #fbbf24 50%, #d97706 100%);
}
.vip-listing-ring.institutional::before {
  background: conic-gradient(from 0deg, #7c3aed 0%, #818cf8 50%, #7c3aed 100%);
}

/* ── Communities ──────────────────────────────────────────────────────────── */
.community-card {
  background: var(--md-sys-color-surface, #fff);
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0/.08);
  border: 1px solid var(--md-sys-color-outline-variant, #cac4d0);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s ease;
}
.community-card:hover {
  box-shadow: 0 4px 12px 0 rgb(0 0 0/.14);
}
.community-cover {
  height: 8rem;
  background: linear-gradient(to bottom right, rgb(0 80 203/.20), rgb(0 80 203/.40));
  position: relative;
  background-size: cover;
  background-position: center;
}
.community-badge {
  display: inline-flex;
  align-items: center;
  gap: .125rem;
  padding: .125rem .375rem;
  border-radius: 9999px;
  font-size: .625rem;
  font-weight: 700;
}
.badge-public {
  background: #dcfce7;
  color: #166534;
}
.badge-private {
  background: #fef3c7;
  color: #92400e;
}
.badge-vip-pro {
  background: linear-gradient(to right, #facc15, #f59e0b);
  color: #713f12;
}
.badge-vip-inst {
  background: linear-gradient(to right, #a855f7, #6366f1);
  color: #fff;
}
.comm-member-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #fff;
  margin-left: -.5rem;
}
.comm-member-avatar:first-child {
  margin-left: 0;
}
#community-info-panel {
  position: fixed;
  inset-block: 0;
  right: 0;
  width: 100%;
  max-width: 24rem;
  background: var(--md-sys-color-surface-container-lowest, #fff);
  box-shadow: 0 25px 50px -12px rgb(0 0 0/.25);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
}
#community-info-panel.open {
  transform: translateX(0);
}
.comm-member-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-bottom: 1px solid rgb(var(--md-sys-color-outline-variant-rgb, 202 196 208)/.40);
}
.comm-member-row:last-child {
  border-bottom: none;
}
.comm-tab-btn {
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: background-color .15s ease, color .15s ease;
}
.comm-tab-btn.active {
  background: var(--md-sys-color-primary, #0050cb);
  color: var(--md-sys-color-on-primary, #fff);
}
.comm-tab-btn:not(.active) {
  color: var(--md-sys-color-on-surface-variant, #49454f);
}
.comm-tab-btn:not(.active):hover {
  background: var(--md-sys-color-surface-container, #ece6f0);
}

/* ── Communities — dark mode overrides ───────────────────────────────────── */
.dark .community-card {
  background: #16181f;
  box-shadow: 0 1px 4px 0 rgb(0 0 0 / .5);
}
.dark #community-info-panel {
  background: #16181f;
}
.dark .badge-public {
  background: rgba(22, 101, 52, .25);
  color: #86efac;
}
.dark .badge-private {
  background: rgba(120, 53, 15, .30);
  color: #fcd34d;
}
.dark .badge-vip-pro {
  background: linear-gradient(to right, rgba(202, 138, 4, .25), rgba(180, 83, 9, .25));
  color: #fde68a;
}
.dark .comm-member-avatar {
  border-color: #16181f;
}
.dark .comm-tab-btn:not(.active) {
  color: #9a9cb0;
}
.dark .comm-tab-btn:not(.active):hover {
  background: #1e2028;
}

/* ── Identifier tags (settings) ──────────────────────────────────────────── */
.id-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 9999px;
  font-size: .75rem; font-weight: 600; border: 1px solid;
}
.id-chip.phone   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.id-chip.matric  { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.id-chip.staff   { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.id-chip.email   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.id-chip.account { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.id-chip.custom  {
  background: var(--md-sys-color-surface-container, #ece6f0);
  color: var(--md-sys-color-on-surface-variant, #49454f);
  border-color: var(--md-sys-color-outline-variant, #cac4d0);
}

/* ── Dispatch / delivery cards ──────────────────────────────────────────── */
.delivery-card {
  background: var(--md-sys-color-surface-container-lowest, #fff);
  border-radius: 1rem; border: 1px solid var(--md-sys-color-outline-variant, #cac4d0);
  padding: 1rem; margin-bottom: .75rem;
}
.delivery-card > * + * { margin-top: .5rem; }
.delivery-card.stale { border-color: #fcd34d; background: rgba(251,191,36,.07); }

.dispatch-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 9999px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.dispatch-type-badge.community {
  background: rgba(0,80,203,.1);
  color: var(--md-sys-color-primary, #0050cb);
}
.dispatch-type-badge.document { background: #ddd6fe; color: #5b21b6; }
.dispatch-type-badge.info     { background: #99f6e4; color: #0f766e; }
.dark .dispatch-type-badge.document { background: rgba(139,92,246,.2); color: #c4b5fd; }
.dark .dispatch-type-badge.info     { background: rgba(20,184,166,.2); color: #5eead4; }
