/* ============================================================
   Kykez.com — Main CSS (Dark/Light Glassmorphism)
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:        #667eea;
  --secondary:      #764ba2;
  --accent:         #f093fb;
  --bg-color:       #0f0f1a;
  --bg-secondary:   #1a1a2e;
  --surface:        rgba(255,255,255,0.07);
  --surface-hover:  rgba(255,255,255,0.12);
  --border:         rgba(255,255,255,0.1);
  --text-color:     #e8e8f0;
  --text-muted:     #9999bb;
  --text-inverse:   #0f0f1a;
  --danger:         #ff4757;
  --success:        #2ed573;
  --warning:        #ffa502;
  --coin-color:     #ffd700;
  --blur-bg:        rgba(15,15,26,0.85);
  --card-shadow:    0 8px 32px rgba(0,0,0,0.4);
  --radius:         16px;
  --radius-sm:      8px;
  --radius-lg:      24px;
  --transition:     0.3s ease;
  --font:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
}

/* ── Inline SVG Icon System (cross-platform, no emoji) ────── */
.icon { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; flex-shrink: 0; }
.icon-coin {
  width: 1.1em; height: 1.1em; vertical-align: -0.15em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23FFD700' stroke='%23DAA520' stroke-width='1.5'/%3E%3Ctext x='12' y='16.5' text-anchor='middle' font-size='12' font-weight='bold' fill='%23B8860B' font-family='sans-serif'%3E$%3C/text%3E%3C/svg%3E") center/contain no-repeat;
}
.icon-coin-lg { width: 1.4em; height: 1.4em; }
.icon-heart {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff4757'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.icon-lock {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23667eea'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM12 17c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.icon-hint {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffa502'%3E%3Cpath d='M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7z'/%3E%3C/svg%3E") center/contain no-repeat;
}

[data-theme="light"] {
  --bg-color:      #f0f2ff;
  --bg-secondary:  #ffffff;
  --surface:       rgba(255,255,255,0.85);
  --surface-hover: rgba(255,255,255,0.95);
  --border:        rgba(102,126,234,0.15);
  --text-color:    #1a1a2e;
  --text-muted:    #5c5c7a;
  --text-inverse:  #ffffff;
  --blur-bg:       rgba(240,242,255,0.9);
  --card-shadow:   0 4px 20px rgba(102,126,234,0.15);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-color);
  color: var(--text-color);
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: var(--font); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ── Gradient Background Animation ────────────────────────── */
.gradient-bg {
  background: linear-gradient(135deg, var(--bg-color) 0%, var(--bg-secondary) 50%, var(--bg-color) 100%);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* Respect OS-level "reduce motion" preference — also improves perf on low-end devices */
@media (prefers-reduced-motion: reduce) {
  .gradient-bg { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── Glass Card ────────────────────────────────────────────── */
.glass {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: background var(--transition), box-shadow var(--transition);
}
.glass:hover { background: var(--surface-hover); }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--blur-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  will-change: transform; /* promotes to own GPU compositing layer */
}
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-color);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.nav-icon-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Bottom Tab Bar (Mobile) ───────────────────────────────── */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  background: var(--blur-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  will-change: transform; /* promotes to own GPU compositing layer */
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition);
  position: relative;
}
.tab-item.active { color: var(--primary); }
.tab-item .tab-icon { font-size: 1.3rem; }
.tab-badge {
  position: absolute;
  top: 6px; right: calc(50% - 18px);
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Main Container ────────────────────────────────────────── */
.container { max-width: 480px; margin: 0 auto; padding: 1rem 1.25rem 80px; width: 100%; }
.container-wide {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 80px; /* Reduced top padding */
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .container-wide {
    padding: 1rem 1rem 80px;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .container-wide {
    padding: 1.25rem 1.5rem 80px;
  }
}

@media (min-width: 1025px) {
  .container-wide {
    padding: 1.5rem 2rem 80px;
  }
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text-color); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-muted); }
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-color);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.2);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all var(--transition);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title { font-size: 1.1rem; font-weight: 700; }

/* ── Avatar ────────────────────────────────────────────────── */
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: #fff;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 80px; height: 80px; font-size: 1.75rem; }
.avatar-xl { width: 120px; height: 120px; font-size: 2.5rem; }

/* ── Profile Gradient Border ───────────────────────────────── */
.pro-border {
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
}
.pro-border .avatar { border: 3px solid var(--bg-color); }

/* ── Message Cards ─────────────────────────────────────────── */
.msg-card {
  position: relative;
  overflow: hidden;
}
.msg-card.pinned {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.08));
}
.msg-card.pinned::before {
  content: '📌';
  position: absolute;
  top: 10px; right: 10px;
  font-size: 0.85rem;
}
.msg-body { font-size: 1rem; line-height: 1.6; word-break: break-word; }
.msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.msg-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.msg-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* ── Image message ─────────────────────────────────────────── */
.msg-image-wrap { position: relative; border-radius: var(--radius-sm); overflow: hidden; }
.msg-image-wrap img { width: 100%; display: block; }
.msg-image-wrap.blurred img { filter: blur(40px) brightness(0.5); }
.unblur-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  gap: 0.5rem;
}
.unblur-overlay .coin-cost { color: var(--coin-color); font-weight: 700; }

/* ── Audio player ──────────────────────────────────────────── */
.audio-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.audio-waveform { flex: 1; height: 36px; }
.pitch-badge {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Kykez Audio Player (KAP) ──────────────────────────────── */
.kap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.55rem 0.9rem;
  user-select: none;
  -webkit-user-select: none;
}
.kap-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  padding: 0;
  line-height: 1;
  transition: transform 0.1s, background 0.15s;
}
.kap-btn:active { transform: scale(0.88); }
.kap-btn:disabled { opacity: 0.4; cursor: default; }
.kap-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.kap-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 34px;
  cursor: pointer;
  overflow: hidden;
}
.kap-bar {
  width: 3px;
  flex-shrink: 0;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.08s;
  transform-origin: bottom;
}
.kap-bar.kap-played { background: var(--primary); opacity: 0.85; }
.kap-bar.kap-cur {
  background: var(--primary);
  animation: kapBounce 0.55s ease-in-out infinite alternate;
}
@keyframes kapBounce {
  from { transform: scaleY(0.55); }
  to   { transform: scaleY(1.15); }
}
.kap-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kap-time {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.kap-label {
  font-size: 0.63rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.8;
}
/* inbox detail: hide any lingering native player */
.msg-detail-audio audio { display: none !important; }

/* ── Reel Card ─────────────────────────────────────────────── */
.reel-card {
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.reel-header { display: flex; align-items: center; gap: 0.75rem; padding-bottom: 0.75rem; }
.reel-user { font-weight: 700; font-size: 0.95rem; }
.reel-time { font-size: 0.75rem; color: var(--text-muted); }
.reel-caption { font-size: 0.95rem; line-height: 1.6; margin-bottom: 0.75rem; }
.reel-caption .hashtag { color: var(--primary); font-weight: 600; }
.reel-media { border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 0.75rem; }
.reel-media img { width: 100%; display: block; }
.reel-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.reel-action-btn {
  display: flex; align-items: center; gap: 0.3rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.9rem; font-weight: 600;
  transition: all 0.2s;
}
.reel-action-btn:hover { color: var(--primary); }
.reel-action-btn.liked { color: var(--danger); }
.reel-action-btn .heart-icon { display: inline-block; }
.reel-action-btn.liked .heart-icon { animation: heartPop 0.35s cubic-bezier(0.17,0.89,0.32,1.49); }
@keyframes heartPop {
  0%  { transform: scale(1); }
  40% { transform: scale(1.5); }
  70% { transform: scale(0.9); }
  100%{ transform: scale(1); }
}

/* ── Poll ──────────────────────────────────────────────────── */
.poll-container { margin: 0.75rem 0; }
.poll-option {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition);
}
.poll-option:hover { border-color: var(--primary); }
.poll-option.voted { border-color: var(--primary); }
.poll-option.winner { border-color: var(--success); }
.poll-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(102,126,234,0.15), rgba(118,75,162,0.08));
  border-radius: var(--radius-sm);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  z-index: 0;
}
.poll-label { position: relative; z-index: 1; font-weight: 600; font-size: 0.9rem; }
.poll-pct { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 0.8rem; font-weight: 700; color: var(--primary); z-index: 1; }

/* ── Comments Sheet ────────────────────────────────────────── */
.comments-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 2000;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 75vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  padding: 1rem;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
.comments-sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 40px; height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 0 auto 1rem;
}
.sheet-overlay {
  position: fixed; inset: 0; z-index: 1999;
  background: rgba(0,0,0,0.5);
  display: none;
}
.sheet-overlay.open { display: block; }

/* ── Coins ─────────────────────────────────────────────────── */
.coin-icon { color: var(--coin-color); }
.coins-display {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 20px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--coin-color);
}
.coins-package {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.coins-package:hover { border-color: var(--primary); background: var(--surface-hover); transform: translateY(-2px); }
.coins-package.popular {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
}
.coins-package.popular::before {
  content: 'POPULAR';
  position: absolute;
  top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 0.62rem; font-weight: 800;
  padding: 2px 10px; border-radius: 20px;
  letter-spacing: 0.08em;
}
.coins-amount { font-size: 2rem; font-weight: 800; color: var(--coin-color); }
.coins-price  { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Kykez+ Badge ──────────────────────────────────────────── */
.plus-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.65rem; font-weight: 800;
  padding: 2px 7px; border-radius: 10px;
  letter-spacing: 0.05em;
}
.verified-badge { color: var(--primary); font-size: 0.9rem; }

/* ── Profile Page ──────────────────────────────────────────── */
.profile-hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  position: relative;
}
.profile-stats { display: flex; justify-content: center; gap: 2rem; margin-top: 1rem; }
.stat-item { text-align: center; }
.stat-value { font-size: 1.4rem; font-weight: 800; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* ── Message Submission Page ───────────────────────────────── */
.submission-hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.submission-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23fff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.4;
}
.submission-hero h1 { font-size: 1.3rem; font-weight: 800; color: #fff; position: relative; z-index: 1; }
.submission-hero p  { color: rgba(255,255,255,0.85); font-size: 0.9rem; margin-top: 0.4rem; position: relative; z-index: 1; }

/* ── Message type selector ─────────────────────────────────── */
.type-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.type-tab {
  flex: 1;
  padding: 0.65rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.type-tab.active { border-color: var(--primary); background: rgba(102,126,234,0.12); color: var(--primary); }
.type-tab:hover  { border-color: var(--primary); color: var(--primary); }

/* ── Record Audio Button ───────────────────────────────────── */
.record-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--danger), #ff6b81);
  color: #fff;
  font-size: 1.75rem;
  border: none;
  margin: 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 rgba(255,71,87,0.4);
  transition: all var(--transition);
}
.record-btn.recording {
  animation: pulse 1s infinite;
  background: linear-gradient(135deg, #ff4757, #c0392b);
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,71,87,0.6); }
  70%  { box-shadow: 0 0 0 20px rgba(255,71,87,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,71,87,0); }
}

/* ── Blog ──────────────────────────────────────────────────── */
.blog-card { overflow: hidden; transition: transform var(--transition); }
.blog-card:hover { transform: translateY(-4px); }
.blog-card-img { width: 100%; height: 180px; object-fit: cover; }
.blog-card-body { padding: 1rem; }
.blog-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; line-height: 1.4; }
.blog-card-excerpt { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.blog-card-meta { display: flex; justify-content: space-between; margin-top: 0.75rem; font-size: 0.75rem; color: var(--text-muted); }
.category-pill {
  background: rgba(102,126,234,0.15);
  color: var(--primary);
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── AdSense Container ─────────────────────────────────────── */
.ad-container {
  min-height: auto;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 1rem 0;
  overflow: hidden;
}
.ad-container.hidden { display: none; }

/* ── GDPR Consent ──────────────────────────────────────────── */
.consent-banner {
  position: fixed;
  bottom: 80px; left: 1rem; right: 1rem;
  z-index: 3000;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  animation: slideUp 0.4s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.consent-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 70px; right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--card-shadow);
  animation: toastIn 0.3s ease;
  display: flex; align-items: center; gap: 0.5rem;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 200px; gap: 1rem; color: var(--text-muted);
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }

/* ── Unread pulse ──────────────────────────────────────────── */
.unread-dot {
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.5; transform: scale(0.7); }
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 500px;
  padding: 1.5rem;
  transform: translateY(40px);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 1.25rem; }

/* ── Social Export Card Preview ────────────────────────────── */
.export-card {
  aspect-ratio: 9/16;
  max-width: 270px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 20px 60px rgba(102,126,234,0.4);
}
.export-card .brand { font-size: 1.5rem; margin-bottom: 1.5rem; opacity: 0.9; }
.export-card .msg-text { font-size: 1.1rem; line-height: 1.5; margin-bottom: 1.5rem; }
.export-card .reply-text { font-size: 0.9rem; opacity: 0.85; margin-top: 1rem; border-top: 1px solid rgba(255,255,255,0.3); padding-top: 1rem; }

/* ── Daily Reward Banner ───────────────────────────────────── */
.daily-reward-banner {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,165,0,0.1));
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1rem;
}
.daily-reward-banner:hover { background: linear-gradient(135deg, rgba(255,215,0,0.22), rgba(255,165,0,0.15)); }
.daily-reward-banner .reward-icon { font-size: 2rem; }
.daily-reward-banner .reward-text { font-weight: 700; font-size: 0.9rem; }
.daily-reward-banner .reward-sub  { font-size: 0.75rem; color: var(--text-muted); }

/* ── Kykez+ Promo Card ─────────────────────────────────────── */
.plus-promo {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius);
  padding: 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.plus-promo::before {
  content: '✦';
  position: absolute;
  right: -10px; top: -20px;
  font-size: 8rem;
  opacity: 0.08;
}
.plus-promo h3 { font-size: 1.2rem; font-weight: 800; }
.plus-promo ul { list-style: none; margin: 0.75rem 0; font-size: 0.875rem; opacity: 0.9; }
.plus-promo ul li::before { content: '✓ '; font-weight: 700; }
.plus-promo ul li { margin-bottom: 0.25rem; }

/* ── Report button ─────────────────────────────────────────── */
.report-btn {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 4px;
  transition: all 0.2s;
}
.report-btn:hover { color: var(--danger); background: rgba(255,71,87,0.08); }

/* ── Theme toggle ──────────────────────────────────────────── */
.theme-toggle { font-size: 1.2rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (min-width: 640px) {
  .container { padding: 0 1.5rem 80px; }
  .tab-bar { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .toast-container { bottom: auto; }
}
@media (min-width: 768px) {
  .tab-bar { display: none; }
  .container { padding-bottom: 2rem; }
  .navbar { padding: 0 2rem; }
}

/* ── Magazine / Wide Layout ────────────────────────────────── */
.container-wide { max-width: 1500px; margin: 0 auto; padding: 0 1rem 80px; }

/* ── Responsive Header Navigation ───────────────────────────── */
.desktop-only { display: none !important; }
@media (min-width: 768px) {
  .desktop-only { display: flex !important; }
  .mobile-menu-toggle { display: none !important; }
}

.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem; /* Reduced from 0.8rem 1.25rem */
  padding-top: calc(0.6rem + env(safe-area-inset-top)); /* Reduced from 0.8rem */
  height: auto;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

/* ── FIX 7: Webview context — Flutter SafeArea already handles the status-bar
   inset, so the CSS env(safe-area-inset-top) would add extra empty space.
   The Flutter webview injects ?webview=1 and adds class="webview" to <html>.
   We zero out the redundant CSS safe-area compensation in that context.     */
html.webview .navbar {
  padding-top: 0.6rem;
}
html.webview .tab-bar {
  padding-bottom: 0.5rem; /* remove env(safe-area-inset-bottom) in webview */
}

.navbar-left {
  display: flex; align-items: center; gap: 1rem;
}

/* Lines 885–887 — remove display: flex from here */
.navbar-center {
  align-items: center;
  gap: 1.5rem;
  /* display: flex is intentionally omitted — controlled by .desktop-only */
}

.nav-link {
  font-size: 0.95rem; font-weight: 600; color: var(--text-color);
  text-decoration: none; padding: 0.5rem; border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary); background: rgba(102, 126, 234, 0.1);
}

/* Off-Canvas Menu */
.mobile-menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.mobile-menu-overlay.active { opacity: 1; pointer-events: auto; }

.mobile-menu-drawer {
  position: fixed; top: 0; bottom: 0; left: -300px; width: 280px; max-width: 85vw;
  background: var(--bg-secondary); z-index: 1001; transition: left 0.3s ease;
  display: flex; flex-direction: column; border-right: 1px solid var(--border);
  box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}
.mobile-menu-drawer.active { left: 0; }

.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem; border-bottom: 1px solid var(--border);
}

.mobile-menu-links {
  padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; overflow-y: auto;
}

.mobile-menu-links a {
  display: block; padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  color: var(--text-color); text-decoration: none; font-weight: 600; font-size: 1.05rem;
  transition: background 0.2s ease;
}
.mobile-menu-links a:hover, .mobile-menu-links a.active {
  background: rgba(102, 126, 234, 0.1); color: var(--primary);
}
@media (min-width: 768px) { .container-wide { padding: 0 2rem 2rem; } }

.magazine-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 900px) {
  .magazine-layout { grid-template-columns: 1fr 320px; }
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 900px) { .sidebar { position: sticky; top: 72px; } }

.sidebar-widget {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
}
.sidebar-widget-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}
.sidebar-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.sidebar-cat-link:last-child { border-bottom: none; }
.sidebar-cat-link:hover { color: var(--primary); }
.sidebar-cat-count {
  background: var(--surface-hover);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.sidebar-post-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.sidebar-post-item:last-child { border-bottom: none; }
.sidebar-post-thumb {
  width: 56px; height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.sidebar-post-title {
  font-size: 0.825rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-color);
  transition: color 0.2s;
}
.sidebar-post-title:hover { color: var(--primary); }
.sidebar-post-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
.sidebar-tag {
  display: inline-block;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.15rem;
  transition: all 0.2s;
}
.sidebar-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Featured Hero Post ─────────────────────────────────────── */
.featured-post {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.featured-post-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.featured-post-overlay {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.82));
}
.featured-label {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}
.featured-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.featured-meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
}

/* ── Post Grid ──────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
/* post-grid stays 2 cols on mobile — intentional for magazine style */

.post-grid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-grid-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
.post-grid-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.post-grid-body { padding: 0.85rem; }
.post-grid-cat {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.3rem;
}
.post-grid-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-color);
  margin-bottom: 0.4rem;
}
.post-grid-meta { font-size: 0.72rem; color: var(--text-muted); }

/* ── Section Heading ────────────────────────────────────────── */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.section-heading span { flex: 1; }
.section-heading a { font-size: 0.75rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--primary); }

/* ── Advertisement Label ────────────────────────────────────── */
.ad-wrap { margin: 1.25rem 0; }
.ad-label {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  font-weight: 600;
  opacity: 0.7;
}
.ad-container {
  text-align: center;
  min-height: auto;
  background: rgba(0,0,0,0.04);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ── Site Footer ────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem calc(2.5rem + env(safe-area-inset-bottom));
  margin-top: 2rem;
}
@media (min-width: 768px) { .site-footer { padding-bottom: 2.5rem; } }

.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (min-width: 640px) {
  .footer-top {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 2rem;
    align-items: start;
  }
}

.footer-brand { margin-bottom: 0.5rem; text-align: center; }
@media (min-width: 640px) { .footer-brand { text-align: left; } }
.footer-brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.footer-tagline { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; line-height: 1.5; max-width: 220px; }
.footer-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.35rem; }
.footer-links a {
  color: var(--text-muted);
  font-size: 0.84rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.footer-legal-links a { color: var(--text-muted); font-size: 0.78rem; }
.footer-legal-links a:hover { color: var(--primary); }

/* Default: 1 column for screens smaller than 360px */
.footer-grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
}

/* 3 columns for phones 360px+ */
@media (min-width: 360px) {
  .footer-grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 3 columns maintained for desktop (sits next to footer-brand in grid) */
@media (min-width: 640px) {
  .footer-grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { opacity: 0.4; }

/* ── Legal pages prose ──────────────────────────────────────── */
.legal-prose { font-size: 0.9rem; line-height: 1.85; color: var(--text-muted); }
.legal-prose h2 {
  color: var(--text-color);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--primary);
}
.legal-prose h3 { color: var(--text-color); font-size: 0.95rem; font-weight: 700; margin: 1.1rem 0 0.35rem; }
.legal-prose p { margin-bottom: 0.75rem; }
.legal-prose ul { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.legal-prose ul li { margin-bottom: 0.3rem; }
.legal-prose a { color: var(--primary); }
.legal-prose strong { color: var(--text-color); }
.legal-prose .highlight-box {
  background: rgba(102,126,234,0.08);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1rem 0;
}

/* ── Safety Center ──────────────────────────────────────────── */
.safety-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}
.safety-icon { font-size: 2rem; flex-shrink: 0; margin-top: 0.1rem; }
.safety-title { font-weight: 700; margin-bottom: 0.25rem; }
.safety-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ── FAQ accordion ──────────────────────────────────────────── */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}
.faq-question:hover { background: var(--surface-hover); }
.faq-question .faq-arrow { transition: transform 0.3s; font-size: 0.75rem; flex-shrink: 0; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 0 1.25rem 1.25rem; }

/* ── Newsletter / CTA widgets ───────────────────────────────── */
.cta-widget {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius);
  padding: 1.25rem;
  color: #fff;
  text-align: center;
}
.cta-widget h4 { font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem; }
.cta-widget p { font-size: 0.8rem; opacity: 0.85; margin-bottom: 0.85rem; }

/* ── Reply page ─────────────────────────────────────────────── */
.reply-card {
  background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
  border: 1px solid rgba(102,126,234,0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.reply-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ── Admin expanded styles ──────────────────────────────────── */
.stat-trend {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.25rem;
}
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.admin-page-title { font-size: 1.4rem; font-weight: 800; }
.filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filter-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 80px; margin-top: 0.5rem; }
.bar-chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--primary), var(--accent));
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.bar-chart-bar:hover { opacity: 1; }

/* ── Social Card Export (Professional) ─────────────────────── */
.social-card-canvas {
  position: fixed;
  left: -9999px;
  top: -9999px;
  z-index: -1;
}
.export-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.export-card-pro {
  width: 360px;
  min-height: 480px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  box-shadow: 0 20px 60px rgba(102,126,234,0.4);
}
.export-card-pro .card-top {
  padding: 2rem 1.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.export-card-pro .card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}
.export-card-pro .card-user {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.export-card-pro .card-sub {
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
}
.export-card-pro .card-body {
  flex: 1;
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.export-card-pro .card-msg {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 1.5rem;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.6;
  font-weight: 500;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.2);
}
.export-card-pro .card-reply {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.1);
  border-left: 3px solid rgba(255,255,255,0.5);
  border-radius: 0 12px 12px 0;
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  line-height: 1.5;
}
.export-card-pro .card-reply-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.35rem;
  font-weight: 700;
}
.export-card-pro .card-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.export-card-pro .card-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  opacity: 0.9;
}
.export-card-pro .card-cta {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  text-align: right;
}
.export-card-pro .card-image-wrap {
  padding: 1rem 1.5rem;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.export-card-pro .card-image-wrap img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  object-fit: cover;
}
.export-card-pro .card-audio-viz {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.export-card-pro .audio-viz-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 80px;
}
.export-card-pro .audio-viz-bars .bar {
  width: 6px;
  background: rgba(255,255,255,0.7);
  border-radius: 3px;
  animation: audioBar 1.2s ease-in-out infinite alternate;
}
@keyframes audioBar {
  0% { height: 15%; }
  100% { height: 85%; }
}

/* ── Export Modal Enhanced ─────────────────────────────────── */
.export-options {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.export-options .btn { flex: 1; }

/* ── Share Modal ──────────────────────────────────────────── */
.share-card-preview {
  max-width: 280px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ── Responsive fixes ────────────────────────────────────────── */
@media (max-width: 640px) {
  .featured-title { font-size: 1.1rem; }
  .footer-top { grid-template-columns: 1fr; }
  .export-card-pro { width: 300px; min-height: 400px; }
  .export-card-pro .card-msg { font-size: 1rem; padding: 1.25rem; }
}
/* post-grid: 2 cols on all mobile, 1 col only on very small screens */
@media (max-width: 360px) { .post-grid { grid-template-columns: 1fr; } }

/* ── Full-Screen Reels (TikTok / Instagram style) ───────────── */
.reels-body { overflow: hidden !important; background: #000 !important; }
.reels-body .gradient-bg { background: #000 !important; animation: none !important; }

.reels-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  padding-top: calc(0.6rem + env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
  pointer-events: none;
}
.reels-topbar > * { pointer-events: all; }

.reels-pill-btn {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.2s;
}
.reels-pill-btn:hover { background: rgba(255,255,255,0.25); color: #fff; }

.reels-topbar-title {
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.reels-tabs {
  position: fixed;
  top: calc(44px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  gap: 1.5rem;
  pointer-events: all;
}

.reels-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
  position: relative;
  transition: color 0.2s;
}
.reels-tab.active { color: #fff; }
.reels-tab.active::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 2.5px;
  background: #fff;
  border-radius: 2px;
}

.reels-hashtag-bar {
  position: fixed;
  top: calc(88px + env(safe-area-inset-top));
  left: 1rem; right: 1rem;
  z-index: 300;
  display: flex;
  gap: 0.5rem;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 0.6rem;
}
.reels-hashtag-input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}
.reels-hashtag-input::placeholder { color: rgba(255,255,255,0.45); }

.reels-feed {
  position: fixed;
  inset: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #000;
}
.reels-feed::-webkit-scrollbar { display: none; }

.reels-item {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: linear-gradient(160deg, #0f0f1a 0%, #1a1a2e 100%);
}

.reels-bg-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  z-index: 1;
}
.reels-bg-img-blur {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(30px) brightness(0.4);
  transform: scale(1.1);
}

.reels-text-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.reels-anon-msg {
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 800;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
  max-width: 500px;
}

.reels-audio-bg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
}
.reels-audio-icon { font-size: 4rem; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5)); }
.reels-waveform {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
}
.reels-waveform span {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.6);
  animation: none;
  transition: height 0.15s;
}
.reels-waveform span:nth-child(1){ height:20px }
.reels-waveform span:nth-child(2){ height:36px }
.reels-waveform span:nth-child(3){ height:28px }
.reels-waveform span:nth-child(4){ height:44px }
.reels-waveform span:nth-child(5){ height:16px }
.reels-waveform span:nth-child(6){ height:40px }
.reels-waveform span:nth-child(7){ height:24px }
.reels-waveform span:nth-child(8){ height:32px }
.reels-waveform span:nth-child(9){ height:20px }
.reels-waveform span:nth-child(10){ height:36px }
.reels-audio-bg.playing .reels-waveform span {
  animation: audioWaveBar 0.8s ease-in-out infinite alternate;
}
.reels-audio-bg.playing .reels-waveform span:nth-child(2n){ animation-delay: 0.15s; }
.reels-audio-bg.playing .reels-waveform span:nth-child(3n){ animation-delay: 0.3s; }
@keyframes audioWaveBar {
  from { transform: scaleY(0.3); opacity: 0.5; }
  to   { transform: scaleY(1.2); opacity: 1; }
}
.reels-audio-play-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.4);
  transition: background 0.2s, transform 0.15s;
}
.reels-audio-bg:active .reels-audio-play-btn { transform: scale(0.92); }

/* Bottom-left overlay — fills full width, actions overlap on top */
.reels-overlay-left {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.25rem 1rem;
  padding-right: 76px;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  background: linear-gradient(transparent 0%, rgba(0,0,0,0.7) 60%);
  pointer-events: none;
  z-index: 1;
}
.reels-overlay-left > * { pointer-events: all; }

.reels-user-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.reels-user-link {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: #fff;
}
.reels-avatar { display: flex; align-items: center; }
.reels-avatar .avatar {
  width: 36px; height: 36px;
  font-size: 0.9rem;
  border: 2px solid rgba(255,255,255,0.6);
}

.reels-username {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.reels-follow-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.reels-follow-btn.following {
  background: rgba(255,255,255,0.2);
}

.reels-caption {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.92);
  line-height: 1.45;
  margin-bottom: 0.3rem;
}
.reels-caption .hashtag { color: #c9b8ff; font-weight: 700; }
.reels-msg-body {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.3rem;
}
.reels-reply-txt {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 0.3rem;
}
.reels-ago { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-top: 0.25rem; }
.reels-poll { margin-top: 0.5rem; }
.reels-poll .poll-option { background: rgba(0,0,0,0.4); }
.reels-poll .poll-label { color: #fff; }
.reels-poll-votes { font-size: 0.7rem; color: rgba(255,255,255,0.5); margin-top: 0.25rem; }

/* Right-side action buttons — overlaps the overlay-left */
.reels-actions-right {
  position: absolute;
  right: 0; bottom: 80px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  padding-bottom: 0.5rem;
  z-index: 2;
}

.reels-action-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.reels-action-avatar .avatar {
  width: 44px; height: 44px;
  font-size: 1rem;
  border: 2.5px solid #fff;
}
.reels-plus-dot {
  position: absolute;
  bottom: -8px;
  left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
}

.reels-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 1.6rem;
  transition: transform 0.15s;
}
.reels-action-btn:active { transform: scale(0.85); }
.reels-action-btn.liked { filter: none; }
.reels-action-btn .heart-icon.liked { color: var(--danger); }
.reels-action-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.reels-ad-item {
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reels-sentinel { height: 1px; width: 100%; }

.reels-spinner-wrap {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  pointer-events: none;
}

.reels-empty-state {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  text-align: center;
  gap: 0.75rem;
}

/* ── Custom Dialog (replaces native alert/confirm/prompt) ───── */
.kdialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.kdialog-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.kdialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  transform: scale(0.9) translateY(16px);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.kdialog-overlay.open .kdialog {
  transform: scale(1) translateY(0);
}
.kdialog-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.kdialog-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text-color);
}
.kdialog-msg {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.kdialog-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  justify-content: center;
}
.kdialog-actions .btn { flex: 1; max-width: 170px; }

/* ── Notification Bell ──────────────────────────────────────── */
.nav-icon-btn[id="notifBell"] .tab-badge {
  min-width: 16px;
  height: 16px;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 4px;
  background: var(--danger);
  color: #fff;
}

/* ── Avatar with background image ───────────────────────────── */
.avatar[style*="background-image"] {
  background-size: cover;
  background-position: center;
  color: transparent;
}

/* ── Mobile form controls consistency ────────────────────────── */
@media (max-width: 480px) {
  .form-control { font-size: 1rem; }
  .msg-actions { gap: 0.3rem; }
  .msg-actions .btn-sm { padding: 0.3rem 0.5rem; font-size: 0.72rem; }
}

/* ============================================================
   PREMIUM OVERHAUL — New Components
   ============================================================ */

/* ── Responsive Typography (respects system a11y font settings) */
html { font-size: clamp(0.875em, 1vw + 0.75em, 1.125em); }
@media (min-width: 768px) { html { font-size: clamp(0.9375em, 0.9vw + 0.6875em, 1.125em); } }
.btn { font-size: clamp(0.8rem, 2vw, 0.95rem); }
.btn-lg { font-size: clamp(0.9rem, 2.5vw, 1.05rem); }
h1 { font-size: clamp(1.4rem, 5vw, 2rem); }
h2 { font-size: clamp(1.15rem, 4vw, 1.5rem); }

/* ── Universal Bottom Sheet (replaces all modal-overlays) ─── */
.bottom-sheet-overlay {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.bottom-sheet-overlay.open { opacity: 1; pointer-events: all; }
.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 4001;
  background: var(--bg-secondary);
  border-radius: 28px 28px 0 0;
  max-height: 92vh;
  overflow-y: auto;
  padding: 0 1.25rem 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.35);
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle {
  width: 44px; height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 14px auto 20px;
}
.bottom-sheet-title {
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  text-align: center;
}

/* ── Export Bottom Sheet ───────────────────────────────────── */
.export-sheet-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.export-sheet-card {
  width: min(280px, 80vw);
  aspect-ratio: 9/16;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #4a2880, #667eea);
  box-shadow: 0 16px 48px rgba(102,126,234,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  color: #fff;
}
.export-sheet-card .label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.8;
}
.export-sheet-card .msg-preview {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  font-weight: 700;
  line-height: 1.4;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 1rem;
  width: 100%;
}
.export-sheet-card .brand-footer {
  font-size: 0.65rem;
  opacity: 0.6;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.export-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.export-sheet-actions .btn { font-size: clamp(0.85rem, 2.5vw, 0.95rem); }

/* ── Inbox Chat-List Style ─────────────────────────────────── */
.inbox-chat-list { display: flex; flex-direction: column; gap: 0; }
.inbox-chat-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.18s;
  position: relative;
  text-decoration: none;
  color: var(--text-color);
}
.inbox-chat-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.inbox-chat-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.inbox-chat-item:only-child { border-radius: var(--radius); }
.inbox-chat-item:hover { background: var(--surface-hover); }
.inbox-chat-item.unread { background: rgba(102,126,234,0.06); }
.inbox-chat-item.pinned { background: rgba(102,126,234,0.08); border-left: 3px solid var(--primary); }

.inbox-type-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.inbox-type-icon.text { background: rgba(102,126,234,0.15); }
.inbox-type-icon.image { background: rgba(46,213,115,0.15); }
.inbox-type-icon.audio { background: rgba(240,147,251,0.15); }

.inbox-chat-body { flex: 1; min-width: 0; }
.inbox-chat-name {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.18rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.inbox-chat-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.inbox-chat-item.unread .inbox-chat-preview { color: var(--text-color); font-weight: 500; }
.inbox-chat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}
.inbox-chat-time { font-size: 0.7rem; color: var(--text-muted); }
.inbox-unread-badge {
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulseDot 2s infinite;
}

/* ── Inbox Detail Bottom Sheet ─────────────────────────────── */
.msg-detail-sheet .msg-body-full {
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  line-height: 1.65;
  margin-bottom: 1rem;
  word-break: break-word;
}
.msg-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}
.msg-detail-actions .btn { font-size: clamp(0.78rem, 2.5vw, 0.88rem); }

/* ── Hint Result Toast (rich) ─────────────────────────────── */
.hint-toast {
  background: var(--bg-secondary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
}
.hint-toast-row { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; }
.hint-toast-label { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.hint-toast-value { font-weight: 700; color: var(--text-color); }

/* ── Floating Reels Home Button ────────────────────────────── */
.reels-float-home {
  position: fixed;
  z-index: 500;
  bottom: calc(32px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: background 0.2s, transform 0.15s;
  touch-action: none;
  user-select: none;
  text-decoration: none;
}
.reels-float-home:active { cursor: grabbing; transform: translateX(-50%) scale(0.92); }
.reels-float-home:hover { background: rgba(255,255,255,0.28); color: #fff; }

/* ── Onboarding Hero (Premium) ─────────────────────────────── */
.onboarding-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1a0d3d 0%, #2d1266 40%, #0d0d20 100%);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.onboarding-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(102,126,234,0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(240,147,251,0.2) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(118,75,162,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.onboarding-hero .hero-stars {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.onboarding-hero .hero-stars::before,
.onboarding-hero .hero-stars::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%; left: -50%;
  background-image: radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 15% 60%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 85%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(2px 2px at 90% 10%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 45%, rgba(255,255,255,0.3) 0%, transparent 100%);
  background-repeat: no-repeat;
  animation: twinkle 6s ease-in-out infinite alternate;
}
.onboarding-hero .hero-stars::after { animation-delay: 3s; opacity: 0.6; }
@keyframes twinkle {
  0% { opacity: 0.4; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.02); }
}
.onboarding-hero .hero-icon {
  font-size: clamp(2.5rem, 8vw, 4rem);
  margin-bottom: 0.75rem;
  position: relative; z-index: 1;
  animation: floatIcon 4s ease-in-out infinite;
}
@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.onboarding-hero h1 {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 0%, #c9b8ff 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15;
  position: relative; z-index: 1;
  margin-bottom: 0.65rem;
}
.onboarding-hero p {
  color: rgba(255,255,255,0.72);
  font-size: clamp(0.88rem, 2.5vw, 1rem);
  line-height: 1.65;
  max-width: 380px;
  margin: 0 auto 1.5rem;
  position: relative; z-index: 1;
}
.onboarding-hero .hero-cta {
  display: flex; gap: 0.75rem;
  justify-content: center; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.onboarding-hero .btn-hero-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  box-shadow: 0 6px 24px rgba(102,126,234,0.5);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 700;
}
.onboarding-hero .btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(102,126,234,0.6); }
.onboarding-hero .btn-hero-ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
}
.onboarding-hero .btn-hero-ghost:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* Social proof strip under hero */
.social-proof-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.proof-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.15rem;
}
.proof-value { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 900; color: var(--primary); }
.proof-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.proof-divider { width: 1px; height: 36px; background: var(--border); }

/* ── Feature Cards (onboarding) ────────────────────────────── */
.feature-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.feature-card-icon { font-size: clamp(1.4rem, 4vw, 1.75rem); margin-bottom: 0.4rem; }
.feature-card-title { font-weight: 700; font-size: clamp(0.7rem, 2vw, 0.8rem); line-height: 1.2; }
.feature-card-desc { font-size: clamp(0.62rem, 1.5vw, 0.7rem); color: var(--text-muted); margin-top: 0.2rem; line-height: 1.3; }

/* ── Profile Extra Options ─────────────────────────────────── */
.profile-option-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}
.profile-option-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.18s;
  text-decoration: none;
  color: var(--text-color);
}
.profile-option-item:last-child { border-bottom: none; }
.profile-option-item:hover { background: var(--surface-hover); }
.profile-option-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.profile-option-icon.purple { background: rgba(102,126,234,0.15); }
.profile-option-icon.gold { background: rgba(255,215,0,0.15); }
.profile-option-icon.green { background: rgba(46,213,115,0.15); }
.profile-option-icon.red { background: rgba(255,71,87,0.15); }
.profile-option-icon.blue { background: rgba(30,144,255,0.15); }
.profile-option-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
}
.profile-option-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ── Auth Page Redesign ────────────────────────────────────── */
.auth-page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.auth-tab-bar {
  display: flex;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 0.55rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.forgot-link {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  color: var(--primary);
  margin-top: -0.6rem;
  margin-bottom: 1rem;
}

/* ── Skeleton Loading Screens ─────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full { width: 100%; }
.skeleton-card {
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }

/* ── More Apps Page Style (in profile) ────────────────────── */
.app-list-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.18s;
  text-decoration: none;
  color: var(--text-color);
}
.app-list-item:last-child { border-bottom: none; }
.app-list-item:hover { background: var(--surface-hover); }
.app-icon-thumb {
  width: 52px; height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.app-list-name { font-weight: 700; font-size: 0.9rem; }
.app-list-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ── Smooth page transitions ───────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter { animation: fadeSlideUp 0.3s ease forwards; }

/* ── Pinned badge override ─────────────────────────────────── */
.pinned-star { font-size: 0.72rem; }

/* ── Coin balance animation ────────────────────────────────── */
@keyframes coinPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); color: var(--coin-color); }
  100% { transform: scale(1); }
}
.coin-pop { animation: coinPop 0.4s ease; }

/* ── In-app update banner (fixed bottom toast) ─────────────── */
.update-banner {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 2rem), 480px);
  background: linear-gradient(135deg, #1a2e1a, #0d1f0d);
  border: 1px solid rgba(46,213,115,0.5);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 9000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: slideUpFade 0.4s ease;
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.update-banner-text {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6ee7a0;
  line-height: 1.3;
}
.update-banner-btn {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.update-banner-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem;
  flex-shrink: 0;
}

/* ── Blog coin rewards card ────────────────────────────────── */
.blog-rewards-card {
  background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(240,147,251,0.08));
  border: 1px solid rgba(102,126,234,0.3);
  border-radius: var(--radius);
  overflow: hidden;
}
.blog-rewards-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
}
.blog-rewards-icon { font-size: 1.8rem; flex-shrink: 0; }
.blog-rewards-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.2rem; }
.blog-rewards-sub { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.blog-reward-claimed {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  color: #22c55e;
  margin-top: 1rem;
}
.blog-reward-claimed--done {
  color: var(--text-muted);
  background: var(--surface);
  border-color: var(--border);
}

/* ── Password strength bars ────────────────────────────────── */
.pwd-strength-bar { transition: background 0.3s ease; }

/* ── Reels body overrides (from reels.php — moved here) ───── */
.reels-body { overflow: hidden; background: #000; }
.reels-body .gradient-bg { background: #000 !important; }

/* ═══════════════════════════════════════════════════════════
   INBOX — Chat-Like List View & Detail Bottom Sheet
   ═══════════════════════════════════════════════════════════ */

/* ── Inbox header row ──────────────────────────────────────── */
.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.inbox-header-left { display: flex; align-items: center; gap: 0.75rem; }
.inbox-title {
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  font-weight: 800;
  line-height: 1.2;
}
.inbox-unread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.inbox-filter-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 0.75rem;
  scrollbar-width: none;           /* keeps it hidden on Firefox */
  -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
  scroll-snap-type: x mandatory;   /* optional: snaps buttons into place */
}
.inbox-filter-row::-webkit-scrollbar { display: none; } /* hidden but still scrollable */
.inbox-filter-btn {
  scroll-snap-align: start;        /* pairs with scroll-snap-type above */
  flex-shrink: 0;                  /* prevents buttons from squishing */
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.inbox-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.inbox-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Inbox chat list item ──────────────────────────────────── */
.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), transform 0.15s, border-color var(--transition);
  position: relative;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text-color);
}
.inbox-item:hover { background: var(--surface-hover); transform: translateX(3px); }
.inbox-item:active { transform: translateX(0); }
.inbox-item.unread {
  border-color: rgba(102,126,234,0.4);
  background: rgba(102,126,234,0.05);
}
.inbox-item.pinned { border-color: var(--primary); }
.inbox-item-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: var(--surface-hover);
}
.inbox-item-avatar.type-text  { background: rgba(102,126,234,0.15); }
.inbox-item-avatar.type-image { background: rgba(240,147,251,0.15); }
.inbox-item-avatar.type-audio { background: rgba(46,213,115,0.15);  }
.inbox-item-body { flex: 1; min-width: 0; }
.inbox-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}
.inbox-item-name {
  font-weight: 700;
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  color: var(--text-color);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-item-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.inbox-item-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-item-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.inbox-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--surface-hover);
  color: var(--text-muted);
}
.inbox-type-chip.text  { background: rgba(102,126,234,0.12); color: var(--primary); }
.inbox-type-chip.image { background: rgba(240,147,251,0.12); color: var(--accent); }
.inbox-type-chip.audio { background: rgba(46,213,115,0.12);  color: var(--success); }
.inbox-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.inbox-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px rgba(102,126,234,0.6);
}
.inbox-pin-icon { font-size: 0.8rem; color: var(--primary); }

/* ── Message Detail Bottom Sheet ───────────────────────────── */
.msg-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 8900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.msg-detail-overlay.open { opacity: 1; pointer-events: all; }

.msg-detail-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border);
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  padding-bottom: env(safe-area-inset-bottom, 16px);
  overscroll-behavior: contain;
}
.msg-detail-sheet.open { transform: translateY(0); }

.msg-detail-handle-row {
  display: flex;
  justify-content: center;
  padding: 12px 0 0;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.msg-detail-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
.msg-detail-inner { padding: 1.25rem 1rem 1.5rem; }

.msg-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}
.msg-detail-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(102,126,234,0.12);
  color: var(--primary);
}
.msg-detail-time { font-size: 0.78rem; color: var(--text-muted); }

.msg-detail-content {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.msg-detail-text {
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  line-height: 1.7;
  color: var(--text-color);
  word-break: break-word;
}
.msg-detail-question {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.msg-detail-reply {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(102,126,234,0.07);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
}
.msg-detail-reply strong { color: var(--primary); }

.msg-detail-image-wrap { text-align: center; margin-bottom: 0.75rem; }
.msg-detail-image-wrap img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.msg-detail-image-wrap.blurred img { filter: blur(24px); }

.msg-detail-audio {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.msg-detail-audio audio { display: none !important; } /* replaced by .kap */
.msg-detail-audio { flex-wrap: wrap; }

.msg-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.msg-detail-actions .btn {
  flex: 1;
  min-width: 140px;
  font-size: clamp(0.75rem, 2.5vw, 0.85rem);
}
.msg-detail-actions .btn-danger-ghost {
  background: rgba(255,71,87,0.08);
  color: var(--danger);
  border: 1px solid rgba(255,71,87,0.25);
}
.msg-detail-actions .btn-danger-ghost:hover { background: rgba(255,71,87,0.15); }

.msg-detail-hint-box {
  padding: 0.85rem 1rem;
  background: rgba(255,165,2,0.08);
  border: 1px solid rgba(255,165,2,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.msg-detail-hint-box strong { color: var(--warning); }

/* ── Hint reveal bottom sheet ──────────────────────────────── */
.hint-reveal-card {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255,165,2,0.08), rgba(102,126,234,0.06));
  border: 1px solid rgba(255,165,2,0.3);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.hint-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}
.hint-row:last-child { border-bottom: none; }
.hint-label { font-weight: 600; color: var(--text-muted); min-width: 80px; }
.hint-value { color: var(--text-color); font-weight: 500; }

/* ── Coin cost badge ───────────────────────────────────────── */
.cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,215,0,0.15);
  color: var(--coin-color);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(255,215,0,0.3);
}

/* ── Empty & loading states ────────────────────────────────── */
.inbox-empty {
  text-align: center;
  padding: 3rem 1rem;
}
.inbox-empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.inbox-empty-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.inbox-empty-sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.5rem; }

/* ── Inbox skeleton ─────────────────────────────────────────── */
.inbox-skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.skeleton-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite;
  flex-shrink: 0;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite;
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================ */

/* Use GPU-compositable transform instead of background-position
   for the gradient animation — dramatically reduces paint cost.
   The pseudo-element trick keeps visual output identical.     */
.gradient-bg {
  position: relative;
  isolation: isolate;
}
.gradient-bg::before {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: -1;
  background: linear-gradient(135deg,
    var(--bg-color) 0%,
    var(--bg-secondary) 50%,
    var(--bg-color) 100%);
  background-size: 300% 300%;
  animation: gradientShift 12s ease infinite;
  will-change: background-position;
  pointer-events: none;
}
/* The original gradient-bg background is now static (no animation) */
.gradient-bg {
  background: var(--bg-color);
  animation: none;
}

/* content-visibility: auto defers rendering of below-fold sections
   until the user scrolls near them — major LCP improvement on
   long pages (magazine layout, blog listing).                 */
.sidebar,
.site-footer,
.plus-promo,
#featureGrid {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px; /* estimated height hint */
}

/* Prevent layout thrash from lazy-loaded sidebar images */
.sidebar-post-thumb {
  aspect-ratio: 56 / 48;
  width: 56px;
}

/* Preload font via @font-face display swap (backup for browsers
   that don't honour the Google Fonts display=swap param)     */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
}

/* Touch targets — 44px minimum recommended by WCAG 2.5.5    */
.tab-item,
.nav-icon-btn,
.btn-sm {
  min-height: 44px;
  min-width: 44px;
}
.btn-sm {
  min-height: 36px; /* exception for compact UI */
}

/* Ad slots: reserve minimum height to prevent CLS (Cumulative
   Layout Shift) — one of the Core Web Vitals Google tracks.  */
.ad-wrap .adsbygoogle {
  min-height: 90px;
}
.sidebar-ad-slot .adsbygoogle {
  min-height: 250px;
}