/* radar_dashboard_v2.css — dashboard-2 visual design v6 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════════════════════════════════
   THEME TOKENS
═══════════════════════════════════════════ */
:root {
  --radius: calc(1.25rem + 16px);

  /* Safe-area insets (non-zero only on iPhone notch/Dynamic Island) */
  --safe-top:    env(safe-area-inset-top,    0px);
  --safe-right:  env(safe-area-inset-right,  0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left,   0px);

  /* Header: base height + status-bar height on notched phones */
  --header-base-h: 64px;
  --header-h: calc(var(--header-base-h) + var(--safe-top));

  /* Full-viewport height (dvh avoids iOS Safari bottom-bar jump) */
  --app-h:  100dvh;
  --main-h: calc(var(--app-h) - var(--header-h));

  --bg:           #f3f5ff;
  --fg:           #1a1c2e;
  --card:         #ffffff;
  --primary:      #4f6ef7;
  --secondary:    #eef0fb;
  --sec-fg:       #3a3d5c;
  --muted:        #e8eaf6;
  --muted-fg:     #7b7f9e;
  --border:       #e2e5f5;
  --glass-bg:     rgba(255,255,255,0.75);
  --glass-border: rgba(255,255,255,0.6);
  --glass-shadow: rgba(79,110,247,0.06);
  --glass-blur:   40px;
  --feed-bg:      #0f172a;

  --risk-high:    #dc2626;
  --risk-high-bg: #fee2e2;
  --risk-mid:     #d97706;
  --risk-mid-bg:  #fef3c7;
  --risk-low:     #16a34a;
  --risk-low-bg:  #dcfce7;

  --scrollbar: rgba(79,110,247,0.15);
}
[data-theme="dark"] {
  --bg:           #0f1117;
  --fg:           #e8eaf5;
  --card:         #161922;
  --primary:      #7c9fff;
  --secondary:    #1e2235;
  --sec-fg:       #c8ccee;
  --muted:        #191e2f;
  --muted-fg:     #8088b0;
  --border:       #2a3050;
  --glass-bg:     rgba(20,25,45,0.65);
  --glass-border: rgba(255,255,255,0.10);
  --glass-shadow: rgba(0,0,0,0.30);
  --feed-bg:      #04080f;

  --risk-high:    #f87171;
  --risk-high-bg: #2d1b1b;
  --risk-mid:     #fbbf24;
  --risk-mid-bg:  #2d2210;
  --risk-low:     #4ade80;
  --risk-low-bg:  #0f2d1b;

  --scrollbar: rgba(124,159,255,0.20);
}

/* ═══════════════════════════════════════════
   BASE + BACKGROUND
═══════════════════════════════════════════ */
html {
  height: 100%;
  background: #000;        /* fills status-bar zone before page paints */
  overflow: hidden;
}
body {
  height: 100%;
  margin: 0; padding: 0;
  overflow: hidden;
  font-family: 'Vazirmatn', system-ui, sans-serif;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(139,92,246,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 75%, rgba(59,130,246,0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 10%, rgba(20,184,166,0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 10% 85%, rgba(251,146,60,0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

.page { display: flex; flex-direction: column; height: var(--app-h); min-height: var(--app-h); overflow: hidden; }

/* ═══════════════════════════════════════════
   GLASS CARD
═══════════════════════════════════════════ */
.glass-card {
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(226,229,245,0.80);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 2px 16px rgba(79,110,247,0.07);
}
[data-theme="dark"] .glass-card {
  background: rgba(22,25,34,0.90);
  border-color: rgba(42,48,80,0.80);
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.glass-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  /* safe-top pushes content below status bar; glass bg fills behind it */
  padding: var(--safe-top) 24px 0;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 1000;
  position: sticky; top: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.80);
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  flex-shrink: 0;
}

.glass-search {
  flex: 1;
  max-width: 380px;
  margin: 0 auto;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--fg);
  padding: 8px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.glass-search:focus { border-color: var(--primary); }
.glass-search::placeholder { color: var(--muted-fg); }

/* ── Search wrapper + dropdown ── */
.search-wrap {
  flex: 1;
  max-width: 380px;
  margin: 0 auto;
  position: relative;
}
.search-wrap .glass-search {
  width: 100%;
  max-width: none;
  margin: 0;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  overflow: hidden;
  z-index: 2000;
  /* animation */
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.search-dropdown.sd-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.sd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.sd-item:last-child { border-bottom: none; }
.sd-item:hover, .sd-item:focus, .sd-item.sd-active { background: rgba(79,110,247,0.08); outline: none; }
[data-theme="dark"] .sd-item:hover,
[data-theme="dark"] .sd-item.sd-active { background: rgba(255,255,255,0.07); }

.sd-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--muted-fg);
  border: 1.5px solid var(--glass-border);
}
.sd-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.sd-text { flex: 1; min-width: 0; }
.sd-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  direction: ltr;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sd-meta {
  font-size: 11px;
  color: var(--muted-fg);
  margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sd-posts-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--secondary, rgba(79,110,247,0.1));
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sd-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-fg);
}

.sd-loader {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted-fg);
  font-size: 13px;
}
.sd-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: sd-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes sd-spin { to { transform: rotate(360deg); } }

/* highlight matched text */
.sd-username mark, .sd-meta mark {
  background: none;
  color: var(--primary);
  font-weight: 700;
}

.cta-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--primary); color: #fff;
  font-family: inherit; font-size: 0.8rem; font-weight: 500;
  border: none; cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.cta-pill:hover { opacity: 0.9; transform: scale(1.02); }
.cta-pill span { position: relative; z-index: 1; }

.btn-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  cursor: pointer; transition: transform 0.2s;
  flex-shrink: 0;
}
.btn-icon:hover { transform: scale(1.05); }

/* ═══════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════ */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: var(--main-h);
  overflow: hidden;
}
.explorer-panel {
  display: grid;
  grid-template-columns: 40% 60%;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.1);
}

/* ═══════════════════════════════════════════
   FEED COLUMN
═══════════════════════════════════════════ */
.feed-col {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--feed-bg);
}
.feed-inner {
  position: absolute;
  top: 0; left: 0; right: 0;
  transition: transform .38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
.post-slide {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #030710;
}
.post-media { width: 100%; height: 100%; object-fit: cover; display: block; }

/* pause overlay */
/* pause-overlay removed — hold-to-pause hides all UI via body.vid-holding */
.pause-overlay { display: none !important; }

/* Instagram-style hold-to-pause: hide all slide UI, show only pure video.
   !important needed: mobile media query has .post-slide.active .post-caption-glass{opacity:1}
   which comes later in the file and would win without !important */
body.vid-holding .reel-actions,
body.vid-holding .post-caption-glass,
body.vid-holding .post-caption-fade,
body.vid-holding .risk-badge,
body.vid-holding .vp-wrap,
body.vid-holding .filter-bar,
body.vid-holding .feed-nav,
body.vid-holding .silver-counter {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.18s ease !important;
}
/* Restore UI on release */
.reel-actions, .post-caption-glass, .post-caption-fade,
.risk-badge, .vp-wrap, .filter-bar, .feed-nav {
  transition: opacity 0.18s ease;
}

/* caption fade + glass */
.post-caption-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 280px;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.40) 40%, transparent 100%);
  pointer-events: none;
  z-index: 3;
}
.post-caption-glass {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 4;
  padding: 12px 72px 12px 16px; /* right clearance for 48px reel-actions at right:12px */
}
.caption-profile-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.caption-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.55); flex-shrink: 0; }
.caption-username { color: #fff; font-weight: 600; font-size: 0.875rem; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.caption-username:hover { text-decoration: underline; }
.caption-text {
  color: rgba(255,255,255,0.88);
  font-size: 0.80rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  direction: rtl;
  text-align: right;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1);
}
.caption-text.caption-expanded {
  display: block;
  overflow: hidden; /* keep hidden during animation; JS clears inline max-height after */
  -webkit-line-clamp: unset;
}

/* ── Analysis button row ── */
.analysis-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr; /* force LTR so analysis=left, share=right regardless of page dir */
}
.analysis-open-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: 999px;
  /* Liquid glass base */
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: none;
  box-shadow: none;
  color: #fff;
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  direction: rtl;
  transition: transform 0.13s ease, filter 0.13s ease;
  -webkit-tap-highlight-color: transparent;
}
.analysis-open-btn:active { transform: scale(0.96); filter: brightness(0.92); }
.analysis-btn-high { background: rgba(220, 38, 38, 0.58); }
.analysis-btn-mid  { background: rgba(202, 138, 4, 0.58); }
.analysis-btn-low  { background: rgba(22, 163, 74, 0.58); }
/* risk badge — left side of video */
.risk-badge {
  position: absolute; top: 16px; left: 16px; z-index: 10;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500;
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: none;
  box-shadow: none;
}
.risk-high   { background: rgba(224,85,85,0.58);  color: #fff; }
.risk-caution{ background: rgba(217,119,6,0.58);  color: #fff; }
.risk-safe   { background: rgba(22,163,74,0.58);  color: #fff; }

/* nav buttons — left side, vertically centered */
.feed-nav {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 20;
}
.nav-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: none;
  box-shadow: none;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s; font-size: 18px;
}
.nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.24); }
.nav-btn:disabled { opacity: 0.30; cursor: not-allowed; }

/* ── Filter bar — overlaid on video, right side ── */
.filter-bar {
  position: absolute; top: 16px; right: 16px; z-index: 20;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}

.fpill-wrap { position: relative; }

.filter-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.50);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer; color: var(--fg);
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  white-space: nowrap;
}
[data-theme="dark"] .filter-pill {
  background: rgba(30,34,60,0.88);
  border-color: rgba(255,255,255,0.12);
  color: var(--fg);
}
.filter-pill:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(0,0,0,0.16); }
.fp-label { color: var(--muted-fg); font-weight: 400; }
.fp-value { font-weight: 700; color: var(--fg); }
.fp-value.high { color: var(--risk-high); }
.fp-value.mid  { color: var(--risk-mid); }
.fp-value.low  { color: var(--risk-low); }

.filter-dropdown {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(220,225,245,0.90);
  border-radius: var(--radius);
  padding: 6px;
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: flex-end;
  box-shadow: 0 8px 32px rgba(79,110,247,0.12);
  max-width: 300px;
  min-width: 160px;
}
[data-theme="dark"] .filter-dropdown {
  background: rgba(22,25,34,0.97);
  border-color: rgba(42,48,80,0.80);
}
.filter-dropdown.hidden { display: none; }

.filter-option {
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 0.80rem; font-weight: 500;
  cursor: pointer; border: none; background: transparent;
  color: var(--muted-fg); font-family: inherit;
  transition: all 0.15s;
  display: flex; align-items: center; gap: 6px;
  width: 100%;
}
.filter-option:hover { color: var(--fg); background: rgba(79,110,247,0.06); }
.filter-option.active {
  background: rgba(255,255,255,0.70); color: var(--fg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
[data-theme="dark"] .filter-option.active { background: rgba(255,255,255,0.12); }
/* checkbox filter options */
.filter-option input[type=checkbox] { accent-color: var(--primary); width: 14px; height: 14px; cursor: pointer; flex-shrink: 0; }
.fdd-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fdd-high { background: var(--risk-high); }
.fdd-mid  { background: var(--risk-mid); }
.fdd-low  { background: var(--risk-low); }

/* ═══════════════════════════════════════════
   ANALYSIS COLUMN
═══════════════════════════════════════════ */
.analysis-col {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(243,245,255,0.60);
  backdrop-filter: blur(8px);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
[data-theme="dark"] .analysis-col { background: rgba(0,0,0,0.15); }
.analysis-col::-webkit-scrollbar { width: 5px; }
.analysis-col::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 999px; }

.a-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; color: var(--muted-fg);
  font-size: 0.875rem; text-align: center; padding: 32px;
}

.a-content { display: flex; flex-direction: column; gap: 10px; }

.a-header-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.a-username { font-size: 1.15rem; font-weight: 700; color: var(--fg); }

.a-risk-tag {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; flex-shrink: 0;
}
.art-high { background: var(--risk-high-bg); color: var(--risk-high); }
.art-mid  { background: var(--risk-mid-bg);  color: var(--risk-mid);  }
.art-low  { background: var(--risk-low-bg);  color: var(--risk-low);  }

.a-chips-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.chip {
  padding: 5px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 500;
  background: var(--secondary); color: var(--sec-fg);
}
.chip-warning { background: var(--risk-mid-bg); color: var(--risk-mid); }
.chip-danger  { background: var(--risk-high-bg); color: var(--risk-high); }

.flags-row { display: flex; gap: 8px; flex-wrap: wrap; }
.flag-tag {
  padding: 5px 13px; border-radius: 999px; font-size: 0.80rem; font-weight: 500;
}
.flag-gray { background: #f1f5f9; color: #475569; }
[data-theme="dark"] .flag-gray { background: rgba(255,255,255,0.08); color: var(--muted-fg); }

.gs-label { font-size: 0.80rem; font-weight: 600; color: var(--muted-fg); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.gs-body  { font-size: 0.90rem; line-height: 1.75; color: var(--fg); }
.gs-body.sec-caution        { color: var(--risk-mid); }
.gs-body.sec-strong-warning { color: var(--risk-high); }
.gs-list  { list-style: none; padding: 0; }
.gs-list li { display: flex; gap: 8px; font-size: 0.90rem; color: var(--fg); line-height: 1.65; margin-bottom: 8px; }
.bullet { color: var(--primary); flex-shrink: 0; margin-top: 2px; }

.score-row { display: flex; gap: 8px; flex-wrap: wrap; }
.score-chip {
  padding: 7px 14px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.score-high { background: var(--risk-high-bg); color: var(--risk-high); }
.score-mid  { background: var(--risk-mid-bg);  color: var(--risk-mid);  }
.score-low  { background: var(--risk-low-bg);  color: var(--risk-low);  }

.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-btn {
  flex: 1; padding: 10px 16px; border-radius: var(--radius);
  background: rgba(255,255,255,0.90);
  border: 1px solid rgba(226,229,245,0.90);
  color: var(--fg); font-size: 0.85rem;
  font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.action-btn:hover { background: #fff; box-shadow: 0 2px 12px rgba(79,110,247,0.10); }
[data-theme="dark"] .action-btn { background: rgba(30,34,60,0.70); border-color: var(--border); }

/* ═══════════════════════════════════════════
   RADAR PANEL
═══════════════════════════════════════════ */
aside.radar-panel {
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
[data-theme="dark"] aside.radar-panel { background: rgba(0,0,0,0.10); }
aside.radar-panel::-webkit-scrollbar { width: 5px; }
aside.radar-panel::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 999px; }

.gc-title {
  font-size: 0.875rem; font-weight: 600; margin-bottom: 10px;
}

/* ── Radar circle ── */
.radar-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.radar {
  position: relative;
  width: min(100%, 260px); aspect-ratio: 1;
  border-radius: 50%; overflow: hidden;
  border: 1px solid rgba(120,220,255,0.35);
  background:
    radial-gradient(circle at 50% 50%, rgba(112,241,255,.34) 0%, rgba(112,241,255,.16) 28%, rgba(112,241,255,.08) 44%, transparent 64%),
    #0a2740;
  box-shadow: 0 0 60px rgba(112,241,255,.22), 0 0 160px rgba(112,241,255,.10), inset 0 0 60px rgba(0,0,0,.20);
}
.radar::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 0;
  background:
    linear-gradient(to right, transparent 49.85%, rgba(145,235,255,.28) 50%, transparent 50.15%),
    linear-gradient(to bottom, transparent 49.85%, rgba(145,235,255,.28) 50%, transparent 50.15%),
    repeating-radial-gradient(circle at center, rgba(145,235,255,.26) 0px, rgba(145,235,255,.26) 1px, transparent 1px, transparent 64px);
}
.sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(140,248,255,.62) 0deg, rgba(140,248,255,.26) 22deg, rgba(140,248,255,.00) 70deg, transparent 360deg);
  filter: blur(.6px); opacity: .95;
  animation: spin calc(var(--sweep-ms, 5800) * 1ms) linear infinite; z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes bobA { 0%,100%{transform:translate(-50%,-50%)} 50%{transform:translate(-50%,-57%)} }
@keyframes bobB { 0%,100%{transform:translate(-50%,-50%)} 35%{transform:translate(-50%,-55%) rotate(-1deg)} 70%{transform:translate(-50%,-52%) rotate(1deg)} }
@keyframes bobC { 0%,100%{transform:translate(-50%,-50%)} 45%{transform:translate(-50%,-55%)} 80%{transform:translate(-50%,-58%)} }

.radar-dot {
  position: absolute; border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(142,246,223,0.80); background: #17314a;
  cursor: pointer; z-index: 2; transition: box-shadow 0.22s;
}
.radar-dot img { width: 100%; height: 100%; object-fit: cover; }
.radar-dot.active { border-color: #5df1ca; box-shadow: 0 0 0 3px rgba(87,241,202,.35), 0 0 22px rgba(87,241,202,.70); }

/* ── Live activity section ── */
.activity-section { padding-top: 12px; }

.live-indicator {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-bottom: 10px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
  position: relative; flex-shrink: 0;
}
.live-dot::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%; background: #ef4444;
  animation: ping 1s infinite;
}
@keyframes ping {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}
.live-label { font-size: 0.75rem; font-weight: 600; color: var(--fg); }

.activity-items { display: flex; flex-direction: column; gap: 4px; max-height: 140px; overflow: hidden; }
.activity-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius);
  background: rgba(0,0,0,0.03); font-size: 0.70rem;
  transition: all 0.4s;
}
[data-theme="dark"] .activity-item { background: rgba(255,255,255,0.03); }
.activity-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.activity-dot-info    { background: #3b82f6; }
.activity-dot-danger  { background: #ef4444; }
.activity-dot-success { background: #22c55e; }
.activity-time { color: var(--muted-fg); font-family: monospace; flex-shrink: 0; }
.activity-text { color: rgba(26,28,46,0.70); flex: 1; }
[data-theme="dark"] .activity-text { color: rgba(232,234,245,0.70); }

/* ── Risk list ── */
.risk-user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s;
  border: none; background: transparent; width: 100%;
  text-align: right; font-family: inherit;
}
.risk-user-row:hover { background: rgba(255,255,255,0.30); }
[data-theme="dark"] .risk-user-row:hover { background: rgba(255,255,255,0.05); }
.risk-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.risk-user-info { flex: 1; min-width: 0; }
.risk-username { font-size: 0.80rem; font-weight: 600; color: var(--fg); }
.risk-desc { font-size: 0.70rem; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.risk-score {
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 700;
}
.rb-high { background: var(--risk-high-bg); color: var(--risk-high); }
.rb-mid  { background: var(--risk-mid-bg);  color: var(--risk-mid);  }
.rb-low  { background: var(--risk-low-bg);  color: var(--risk-low);  }

/* ── Case summary ── */
.case-summary { min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; }
.cs-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); margin-bottom: 4px; }
.cs-name { font-size: 0.95rem; font-weight: 700; color: var(--fg); }
.cs-meta { font-size: 0.75rem; color: var(--muted-fg); }

/* ═══════════════════════════════════════════
   SCROLLBAR (global)
═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); }

/* ── Video progress bar ── */
.vp-wrap {
  position: absolute;
  bottom: 74px; left: 0; right: 0;
  height: 22px; /* tall touch target */
  z-index: 6;
  cursor: pointer;
  padding: 9px 16px 0;
}
.vp-track {
  width: 100%; height: 3px;
  background: rgba(255,255,255,0.28);
  border-radius: 999px;
  position: relative; overflow: hidden;
  direction: ltr;
}
.vp-fill {
  height: 100%;
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  width: 0%;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   SHEET PEEK — hidden on desktop
═══════════════════════════════════════════ */
.sheet-peek { display: none; }

/* ═══════════════════════════════════════════
   MUTE TOAST
═══════════════════════════════════════════ */
#speedToast {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  background: rgba(0,0,0,0.60);
  border-radius: 14px;
  padding: 10px 22px;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
#speedToast.show { opacity: 1; }

/* ── Loading spinner ── */
.vid-spinner {
  display: none;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: rgba(255,255,255,0.88);
  animation: vid-spin 0.75s linear infinite;
  z-index: 9;
  pointer-events: none;
}
.post-slide.buffering .vid-spinner { display: block; }
@keyframes vid-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* ── Feed full-screen loader (shown during filter-change fetch) ── */
.feed-loader {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.feed-loader-spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: vid-spin 0.75s linear infinite;
  /* reuse vid-spin keyframes (same transform-based rotation) */
  transform: translate(0, 0); /* reset translate so spin works correctly */
  animation-name: feed-loader-spin;
}
@keyframes feed-loader-spin { to { transform: rotate(360deg); } }

#muteToast {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
}
#muteToast.show { animation: mute-pop 0.4s ease forwards; }
@keyframes mute-pop {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.7); }
  20%  { opacity: 1; transform: translate(-50%,-50%) scale(1.08); }
  35%  { opacity: 1; transform: translate(-50%,-50%) scale(1.0); }
  70%  { opacity: 1; transform: translate(-50%,-50%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(0.9); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .main-layout { grid-template-columns: 1fr; }
  aside.radar-panel { display: none; }
  .explorer-panel { grid-template-columns: 42% 58%; }
}

@media (max-width: 700px) {

  /* ── 1. Disable text selection (prevents long-press text popup) ── */
  .page {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* Header: fixed overlay on top of video — glass bg blurs video behind it.
     padding-top = safe-top pushes brand/buttons below status bar. */
  .glass-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    padding: var(--safe-top) 14px 0;
    z-index: 500;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
  }
  .glass-header.header-hidden { transform: translateY(-100%); }
  .cta-pill { display: none; }

  /* page and main-layout: full 100dvh — no header height subtracted.
     Dark background on both so body color never bleeds through. */
  .page {
    height: var(--app-h); min-height: var(--app-h);
    background: var(--feed-bg);
  }
  .main-layout {
    grid-template-columns: 1fr;
    height: var(--app-h);
    background: var(--feed-bg);
  }
  aside.radar-panel { display: none; }

  /* Prevent iOS zoom on input focus — font-size must be ≥16px */
  .glass-search,
  #commentInput { font-size: 16px; }
  .filter-bar {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    right: 16px;
    z-index: 200;
    align-items: flex-start;
    transition: top 0.32s cubic-bezier(0.4,0,0.2,1);
  }

  /* risk-badge: absolute within slide — can't be fixed (feed-inner stacking context) */
  .risk-badge {
    position: absolute;
    top: calc(var(--header-h) + 8px);
    left: 16px;
    z-index: 200;
    transition: top 0.32s cubic-bezier(0.4,0,0.2,1);
  }

  /* When header is hidden (class toggled on <html> by JS), slide UI drops to 20px */
  html.ui-header-hidden .filter-bar { top: 20px; }
  html.ui-header-hidden .risk-badge { top: 20px; }

  /* Prevent body light-blue from showing through any layout gaps.
     background-image (light gradients) must also be cleared — they bleed
     through the semi-transparent sheet and filter elements.
     html/body use white in light-mode so the safe-area zone below .page
     matches the white-glass analysis-col (no dark bleed-through). */
  body { background-color: #fff; background-image: none; }
  html { background: #fff; }
  [data-theme="dark"] body { background-color: var(--feed-bg); }
  [data-theme="dark"] html { background: var(--feed-bg); }

  /* Explorer: single column, feed takes all height.
     overflow:visible so position:fixed children (analysis-col, filter-bar)
     are truly viewport-fixed on iOS standalone (not container-clipped). */
  .explorer-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    position: relative;
    border-right: none;
    overflow: visible;
  }

  /* main-layout: also visible so nothing traps fixed descendants */
  .main-layout { overflow: visible; }

  /* page: must also be overflow:visible — Safari iOS treats position:fixed
     children as position:absolute relative to any overflow:hidden ancestor,
     causing the analysis-col to float above the screen bottom. */
  .page { overflow: visible; }

  /* Hide desktop-only controls */
  .feed-nav { display: none; }
  #muteBtn  { display: none; }

  /* ── Caption fade-in animation on slide enter ── */
  .post-caption-glass {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.30s ease, transform 0.30s ease;
  }
  .post-slide.active .post-caption-glass {
    opacity: 1;
    transform: translateY(0);
  }

  /* ── Mobile layout (bottom → top):
     [vp-wrap bar at bottom:0]
     [analysis-btn-row: padding-bottom=12px+safe + 44px btn = ~56px from bottom]
     [reel-actions: bottom aligned with bottom of analysis button]
  ── */
  .post-caption-glass {
    bottom: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .post-caption-fade {
    bottom: 0;
    height: 320px;
  }
  /* progress bar at very bottom — below analysis button */
  .vp-wrap {
    bottom: 0;
    z-index: 6;
    padding-bottom: 0;
  }
  /* reel-actions: bottom = bottom of analysis button = 12px+safe */
  .reel-actions {
    bottom: 15px !important; /* override base rule (bottom:140px) which comes later in file */
  }

  .post-caption-glass {
    bottom: 25px;
  }

  /* ── When bottom nav is visible: shift overlays above it & shrink video height ── */
  body.has-bottom-nav .page,
  body.has-bottom-nav .main-layout {
    height: calc(var(--app-h) - 62px - var(--safe-bottom, 0px));
    min-height: calc(var(--app-h) - 62px - var(--safe-bottom, 0px));
  }
  body.has-bottom-nav .vp-wrap {
    bottom: 2px;
  }
  body.has-bottom-nav .reel-actions {
    bottom: 17px !important;
  }
  body.has-bottom-nav .post-caption-glass {
    bottom: 27px;
    padding-bottom: 12px;
  }

  /* ── 2. Bottom sheet — hidden by default, slides up on demand ── */
  .analysis-col {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 0;
    overflow: hidden;
    z-index: 210;
    /* remove border and padding when collapsed so nothing is visible at height:0 */
    border-top: none;
    padding: 0;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-radius: var(--radius) var(--radius) 0 0;
    transition: height 0.38s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    gap: 10px;
    background-image: none;
  }
  [data-theme="dark"] .analysis-col {
    background: rgba(8,12,30,0.60);
  }

  /* Restore border + padding only when open */
  .analysis-col.sheet-mid,
  .analysis-col.sheet-full {
    border-top: 1px solid rgba(255,255,255,0.50);
    padding: 0 14px calc(16px + env(safe-area-inset-bottom, 0px));
    pointer-events: auto;
  }
  [data-theme="dark"] .analysis-col.sheet-mid,
  [data-theme="dark"] .analysis-col.sheet-full {
    border-top-color: rgba(255,255,255,0.12);
  }
  .analysis-col.sheet-mid  { height: 60dvh; overflow-y: auto; }
  .analysis-col.sheet-full { height: 100%;  overflow-y: auto; border-radius: 0; }

  /* Drag handle indicator — only when open */
  .analysis-col.sheet-mid::before,
  .analysis-col.sheet-full::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: rgba(0,0,0,0.18);
    border-radius: 999px;
    margin: 10px auto 8px;
    flex-shrink: 0;
  }
  [data-theme="dark"] .analysis-col.sheet-mid::before,
  [data-theme="dark"] .analysis-col.sheet-full::before {
    background: rgba(255,255,255,0.25);
  }

  /* ── Peek bar ── */
  .sheet-peek {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 4px 4px;
    flex-shrink: 0;
  }
  .peek-top {
    display: flex; align-items: center; justify-content: space-between;
  }
  .peek-left {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.875rem; font-weight: 600; color: var(--fg);
  }
  [data-theme="dark"] .peek-left { color: rgba(255,255,255,0.85); }

  .peek-scores {
    display: flex; gap: 5px; flex-wrap: wrap;
  }
  .peek-score-chip {
    padding: 3px 9px; border-radius: 999px;
    font-size: 0.68rem; font-weight: 500;
    background: rgba(0,0,0,0.07);
    color: var(--fg);
  }
  [data-theme="dark"] .peek-score-chip {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.75);
  }

  /* Sticky peek bar when expanded */
  .analysis-col.sheet-mid .sheet-peek,
  .analysis-col.sheet-full .sheet-peek {
    position: sticky;
    top: 0; z-index: 5;
    padding: 10px 4px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.60);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  [data-theme="dark"] .analysis-col.sheet-mid .sheet-peek,
  [data-theme="dark"] .analysis-col.sheet-full .sheet-peek {
    background: rgba(8,12,30,0.70);
    border-bottom-color: rgba(255,255,255,0.08);
  }

  /* Peek risk label colors */
  .peek-risk-high { color: var(--risk-high); font-size: 0.78rem; font-weight: 600; }
  .peek-risk-mid  { color: var(--risk-mid);  font-size: 0.78rem; font-weight: 600; }
  .peek-risk-low  { color: var(--risk-low);  font-size: 0.78rem; font-weight: 600; }

  /* ── 3. Card colors ── */

  /* Light mode: normal glass cards */
  .analysis-col .glass-card {
    background: rgba(255,255,255,0.70);
    border-color: rgba(226,229,245,0.70);
    box-shadow: 0 1px 8px rgba(79,110,247,0.04);
  }

  /* Dark mode: glass overrides */
  [data-theme="dark"] .analysis-col .glass-card {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.09);
    box-shadow: none;
  }
  [data-theme="dark"] .analysis-col .a-username,
  [data-theme="dark"] .analysis-col .gs-body,
  [data-theme="dark"] .analysis-col .gs-list li { color: rgba(255,255,255,0.92); }
  [data-theme="dark"] .analysis-col .gs-label   { color: rgba(255,255,255,0.50); }
  [data-theme="dark"] .analysis-col .a-risk-tag { backdrop-filter: none; }
  [data-theme="dark"] .analysis-col .action-btn {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.90);
  }
  [data-theme="dark"] .analysis-col .chip      { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.75); }
  [data-theme="dark"] .analysis-col .flag-tag  { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.65); }
  [data-theme="dark"] .analysis-col .score-chip{ background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.80); }
  [data-theme="dark"] .analysis-col .a-empty   { color: rgba(255,255,255,0.40); }
}

/* ═══════════════════════════════════════════
   Social action buttons (right side of slide)
═══════════════════════════════════════════ */
.reel-actions {
  position: absolute;
  right: 12px;
  bottom: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 15;
}
.reel-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.reel-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: none;
  box-shadow: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}
.reel-btn:active {
  transform: scale(0.85);
  background: rgba(255,255,255,0.22);
}
.reel-count {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.75);
  min-width: 20px;
  text-align: center;
  direction: ltr;
}

/* Active states */
.reel-btn-like.reel-liked    { background: rgba(255, 77, 103, 0.55); }
.reel-btn-like.reel-liked    svg { fill: #ff4d67; stroke: #ff4d67; }
.reel-btn-dislike.reel-disliked { background: rgba(107, 140, 255, 0.55); }
.reel-btn-dislike.reel-disliked svg { fill: #6b8cff; stroke: #6b8cff; }

/* ═══════════════════════════════════════════
   Comment sheet
═══════════════════════════════════════════ */
.comment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 240;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.comment-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.comment-sheet {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  height: 72vh;
  z-index: 250;
  max-height: 92vh;
  background: var(--card-bg, #fff);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  transition: bottom 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
  overflow: hidden;
}
.comment-sheet.open { bottom: 0; }

.comment-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,0.18);
  margin: 12px auto 0;
  flex-shrink: 0;
}
.comment-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.comment-sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg, #111);
}
.comment-close-btn {
  background: none;
  border: none;
  color: var(--muted-fg, #888);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: background 0.12s;
}
.comment-close-btn:hover { background: rgba(0,0,0,0.07); }

.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 4px;
}
.cm-state {
  text-align: center;
  color: var(--muted-fg, #888);
  font-size: 13px;
  padding: 32px 16px;
}
.cm-empty { font-size: 14px; }

/* ─── Comment items ─── */
.cm-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px 4px;
  align-items: flex-start;
}
.cm-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary, #6366f1); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cm-body { flex: 1; min-width: 0; }
.cm-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; direction: rtl; }
.cm-name { font-size: 12px; font-weight: 700; color: var(--fg, #111); }
.cm-time { font-size: 11px; color: var(--muted-fg, #888); }
.cm-text { font-size: 14px; color: var(--fg, #111); line-height: 1.5; word-break: break-word; direction: rtl; }
.cm-actions { display: flex; gap: 4px; margin-top: 5px; align-items: center; direction: rtl; flex-wrap: wrap; }

/* Reply items — inside cm-replies-wrap, no avatar, small indent */
.cm-reply {
  padding: 6px 10px 4px;
  margin-top: 4px;
  border-right: 2px solid rgba(99,102,241,.18);
}
.cm-reply .cm-text  { font-size: 13px; }
.cm-reply .cm-name  { font-size: 11px; }

/* All action-buttons reset — no border, no background */
.cm-reply-btn,
.cm-rxn-btn,
.cm-show-replies-btn,
.cm-hide-replies-btn,
.cm-load-more-replies,
.cm-load-more-main {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  cursor: pointer;
  padding: 0;
}

/* Reply button */
.cm-reply-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--muted-fg, #888);
  padding: 2px 2px;
  transition: color 0.15s;
}
.cm-reply-btn:hover { color: var(--primary, #6366f1); }

/* Reaction buttons */
.cm-rxn-btn {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--muted-fg, #888);
  font-size: 12px; padding: 2px 4px;
  transition: color 0.12s;
}
.cm-rxn-btn:hover { color: var(--fg); }
.cm-like-btn.active    { color: #ff4d67; }
.cm-dislike-btn.active { color: #6b8cff; }

/* Replies container — inside cm-body */
.cm-replies-wrap { margin-top: 4px; padding-right: 4px; }

/* Show-replies toggle */
.cm-show-replies-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--primary, #6366f1);
  padding: 3px 0; margin-top: 2px; font-weight: 600;
}
.cm-show-replies-btn:hover { opacity: .75; }

/* Replies ctrl row (load more + hide) */
.cm-replies-ctrl {
  display: flex; gap: 12px; align-items: center;
  padding: 4px 0 2px; direction: rtl;
}
.cm-load-more-replies,
.cm-hide-replies-btn {
  display: inline-flex; align-items: center;
  font-size: 12px; color: var(--primary, #6366f1);
  font-weight: 600; padding: 2px 0;
}
.cm-hide-replies-btn { color: var(--muted-fg, #888); font-weight: 400; }
.cm-load-more-replies:hover,
.cm-hide-replies-btn:hover { opacity: .7; }

/* Main load-more (between top-level comment pages) */
.cm-load-more-main {
  display: block; width: 100%;
  font-size: 13px; color: var(--primary, #6366f1);
  text-align: center; padding: 10px 0; font-weight: 600;
}
.cm-load-more-main:hover { opacity: .75; }

.comment-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(0,0,0,0.07);
  flex-shrink: 0;
  background: var(--card-bg, #fff);
}
#commentInput {
  flex: 1;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--card-bg, #fff);
  color: var(--fg, #111);
  outline: none;
  direction: rtl;
}
#commentInput:focus { border-color: var(--primary, #6366f1); }
.comment-submit-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.comment-submit-btn:hover { opacity: 0.85; }
.comment-submit-btn:disabled { opacity: 0.45; }

/* ═══════════════════════════════════════════
   Reaction tap animation
═══════════════════════════════════════════ */
.reaction-anim {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 200;
  pointer-events: none;
  animation: rxn-pop 0.70s ease forwards;
}
@keyframes rxn-pop {
  0%   { transform: translate(-50%,-50%) scale(0);   opacity: 1; }
  45%  { transform: translate(-50%,-50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.1); opacity: 0; }
}

/* ═══════════════════════════════════════════
   Generic toast
═══════════════════════════════════════════ */
.generic-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(20,20,30,0.90);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 20px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.generic-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Dark mode adjustments */
[data-theme="dark"] .comment-sheet,
[data-theme="dark"] .comment-input-row { background: #1a1f2e; }
[data-theme="dark"] .comment-sheet-header { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .comment-sheet-handle { background: rgba(255,255,255,0.2); }
[data-theme="dark"] .comment-sheet-title,
[data-theme="dark"] .cm-name,
[data-theme="dark"] .cm-text { color: rgba(255,255,255,0.92); }
[data-theme="dark"] .cm-time { color: rgba(255,255,255,0.45); }
[data-theme="dark"] .comment-list { border-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .comment-input-row { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] #commentInput {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
}
[data-theme="dark"] #commentInput:focus { border-color: var(--primary); }
[data-theme="dark"] .comment-close-btn { color: rgba(255,255,255,0.55); }
[data-theme="dark"] .comment-close-btn:hover { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .cm-rxn-btn:hover { color: rgba(255,255,255,0.85); }
[data-theme="dark"] .cm-reply-btn { color: rgba(255,255,255,0.45); }
[data-theme="dark"] .cm-reply-btn:hover { color: var(--primary); }
[data-theme="dark"] .cm-item.cm-reply { border-right-color: rgba(99,102,241,0.30); }
[data-theme="dark"] .cm-load-more-main,
[data-theme="dark"] .cm-load-more-replies { color: var(--primary); }

/* ── Reply indicator (above input) ── */
.reply-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(99,102,241,0.10);
  border-top: 1px solid rgba(99,102,241,0.25);
  font-size: 12px;
  color: var(--primary, #6366f1);
  direction: rtl;
  gap: 8px;
}
.reply-cancel-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted-fg); font-size: 14px; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
}
.reply-cancel-btn:hover { color: var(--fg); }

/* ── Gesture feedback flash ── */
@keyframes cmFlashLike    { 0%,100%{background:transparent} 30%{background:rgba(255,80,100,0.12)} }
@keyframes cmFlashDislike { 0%,100%{background:transparent} 30%{background:rgba(107,140,255,0.12)} }
.cm-gesture-like    { animation: cmFlashLike    0.6s ease; }
.cm-gesture-dislike { animation: cmFlashDislike 0.6s ease; }

/* ═══════════════════════════════════════════
   iOS INPUT ZOOM FIX
   iOS zooms when input font-size < 16px.
   @supports (-webkit-touch-callout) targets iOS/iPadOS only,
   leaving desktop font sizes unchanged.
═══════════════════════════════════════════ */
@supports (-webkit-touch-callout: none) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* ═══════════════════════════════════════════
   AUTH / LOGIN MODAL
═══════════════════════════════════════════ */

/* ── Overlay ── */
.login-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  direction: rtl;
  padding: 16px;
}
.login-overlay.hidden { display: none; }

/* ── Card ── */
.login-card {
  background: var(--surface, #fff);
  border-radius: 20px;
  width: 100%; max-width: 380px;
  padding: 32px 28px 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  position: relative;
  animation: loginCardIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes loginCardIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);     }
}

/* ── Close btn ── */
.login-close-btn {
  position: absolute; top: 14px; left: 14px;
  width: 32px; height: 32px;
  background: none; border: none; cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-fg, #888);
  font-size: 18px; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.login-close-btn:hover { background: rgba(0,0,0,0.07); color: var(--fg); }

/* ── Logo / Icon ── */
.login-logo {
  display: flex; justify-content: center; margin-bottom: 18px;
}
.login-logo svg, .login-logo img {
  width: 52px; height: 52px;
}

/* ── Phase container ── */
.login-phase { display: flex; flex-direction: column; gap: 14px; }
.login-phase.hidden { display: none; }

/* ── Texts ── */
.login-title {
  font-size: 20px; font-weight: 700;
  color: var(--fg, #111);
  text-align: center; margin: 0;
}
.login-sub {
  font-size: 13px; color: var(--muted-fg, #666);
  text-align: center; margin: 0; line-height: 1.6;
}

/* ── Inputs ── */
.login-input {
  width: 100%; box-sizing: border-box;
  padding: 13px 16px;
  border: 1.5px solid var(--border, #e0e0e0);
  border-radius: 12px;
  font-size: 16px !important;   /* iOS zoom prevention */
  font-family: inherit;
  text-align: center;
  background: var(--input-bg, #f8f8f8);
  color: var(--fg, #111);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  direction: ltr;
}
.login-input:focus {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: var(--surface, #fff);
}

/* ── OTP boxes row ── */
.otp-boxes {
  display: flex; justify-content: center; gap: 10px;
  direction: ltr;
}
.otp-box {
  width: 52px; height: 56px;
  border: 1.5px solid var(--border, #e0e0e0);
  border-radius: 12px;
  font-size: 22px; font-weight: 700;
  text-align: center;
  background: var(--input-bg, #f8f8f8);
  color: var(--fg, #111);
  caret-color: var(--primary, #6366f1);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  /* iOS zoom */
  font-size: 22px !important;
  -webkit-text-size-adjust: none;
}
.otp-box:focus {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: var(--surface, #fff);
}
.otp-box.filled { border-color: var(--primary, #6366f1); }

/* ── Primary button ── */
.login-btn {
  width: 100%; padding: 14px;
  background: var(--primary, #6366f1);
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.3px;
}
.login-btn:hover { opacity: 0.9; }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Error & debug ── */
.login-error {
  font-size: 12.5px; color: #e53935;
  text-align: center;
  min-height: 18px; margin: 0;
  background: rgba(229,57,53,0.08);
  padding: 6px 10px; border-radius: 8px;
  display: none;
}
.login-error.visible { display: block; }
.login-debug {
  font-size: 11.5px; color: var(--muted-fg, #888);
  text-align: center; font-family: monospace;
  background: rgba(0,0,0,0.05);
  padding: 5px 10px; border-radius: 8px;
  display: none;
}
.login-debug.visible { display: block; }

/* ── Link-style button (resend / back) ── */
.login-link {
  background: none; border: none; padding: 0;
  font-size: 13px; color: var(--primary, #6366f1);
  cursor: pointer; text-decoration: underline;
  font-family: inherit;
  text-align: center;
}
.login-link:hover { opacity: 0.75; }

/* ── Header auth button ── */
.auth-header-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(99,102,241,0.10);
  border: 1.5px solid rgba(99,102,241,0.25);
  cursor: pointer;
  color: var(--primary, #6366f1);
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.auth-header-btn:hover { background: rgba(99,102,241,0.20); }
.auth-header-btn.logged-in {
  background: var(--primary, #6366f1);
  border-color: var(--primary, #6366f1);
  color: #fff;
}
.auth-header-btn .auth-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  letter-spacing: 0;
}

/* Dark theme overrides for login */
[data-theme="dark"] .login-card {
  background: #1e1e2e;
  box-shadow: 0 24px 64px rgba(0,0,0,0.60);
}
[data-theme="dark"] .login-title { color: rgba(255,255,255,0.92); }
[data-theme="dark"] .login-sub   { color: rgba(255,255,255,0.50); }
[data-theme="dark"] .login-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.90);
}
[data-theme="dark"] .login-input:focus {
  background: rgba(255,255,255,0.09);
  border-color: var(--primary, #6366f1);
}
[data-theme="dark"] .otp-box {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.90);
}
[data-theme="dark"] .otp-box:focus { background: rgba(255,255,255,0.09); }
[data-theme="dark"] .login-debug  { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.45); }
[data-theme="dark"] .login-close-btn:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.85); }
[data-theme="dark"] .auth-header-btn {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.35);
}

/* ═══════════════════════════════════════════
   PROFILE DROPDOWN
═══════════════════════════════════════════ */
.profile-dropdown {
  position: fixed;
  z-index: 9999;
  width: 188px;
  background: var(--surface, #fff);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  padding: 6px 0;
  direction: rtl;
}
.profile-dd-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  background: none; border: none;
  font-family: inherit; font-size: 14px;
  color: var(--fg, #1a1a2e); cursor: pointer;
  text-align: right;
  transition: background 0.12s;
}
.profile-dd-item:hover { background: rgba(99,102,241,0.08); }
.profile-dd-sep { height: 1px; background: rgba(0,0,0,0.07); margin: 4px 0; }
.profile-dd-logout { color: #ef4444; }
.profile-dd-logout:hover { background: rgba(239,68,68,0.08); }

[data-theme="dark"] .profile-dropdown {
  background: #1e1e2e;
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
[data-theme="dark"] .profile-dd-item { color: rgba(255,255,255,0.85); }
[data-theme="dark"] .profile-dd-sep { background: rgba(255,255,255,0.08); }

/* ═══════════════════════════════════════════
   SETTINGS MODAL
═══════════════════════════════════════════ */
.settings-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.settings-card {
  position: relative;
  background: var(--surface, #fff);
  border-radius: 22px;
  padding: 32px 28px 28px;
  max-width: 380px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  direction: rtl;
  display: flex; flex-direction: column; gap: 14px;
}
.settings-close-btn {
  position: absolute; top: 14px; left: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.06); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-fg, #888); transition: background 0.15s;
}
.settings-close-btn:hover { background: rgba(0,0,0,0.12); }
.settings-title {
  font-size: 18px; font-weight: 700;
  color: var(--fg, #1a1a2e); margin: 0; text-align: center;
}
.settings-avatar-wrap {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto;
}
.settings-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--primary, #6366f1);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
  overflow: hidden;
}
.settings-avatar-edit {
  position: absolute; bottom: 0; right: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary, #6366f1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.40);
}
.settings-label {
  font-size: 13px; font-weight: 500;
  color: var(--muted-fg, #888); margin-bottom: -8px;
}
.settings-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  font-size: 15px; font-family: inherit;
  color: var(--fg, #1a1a2e);
  background: var(--surface, #fff);
  outline: none; transition: border-color 0.15s;
}
.settings-input:focus { border-color: var(--primary, #6366f1); }
.settings-error {
  font-size: 13px; color: #ef4444;
  background: rgba(239,68,68,0.08);
  border-radius: 8px; padding: 8px 12px;
}
.settings-save-btn {
  width: 100%; padding: 13px;
  background: var(--primary, #6366f1);
  color: #fff; border: none; border-radius: 13px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: opacity 0.15s;
}
.settings-save-btn:disabled { opacity: 0.6; }
.settings-save-btn:hover:not(:disabled) { opacity: 0.9; }

[data-theme="dark"] .settings-card {
  background: #1e1e2e;
  box-shadow: 0 24px 64px rgba(0,0,0,0.60);
}
[data-theme="dark"] .settings-title { color: rgba(255,255,255,0.92); }
[data-theme="dark"] .settings-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.90);
}
[data-theme="dark"] .settings-input:focus { border-color: var(--primary, #6366f1); }
[data-theme="dark"] .settings-close-btn {
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.60);
}

/* ═══════════════════════════════════════════
   COMMENT LOGIN BANNER
═══════════════════════════════════════════ */
.comment-login-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.07);
  background: var(--surface, #fff);
  font-size: 13px; color: var(--muted-fg, #888);
}
.comment-login-btn {
  padding: 8px 16px;
  background: var(--primary, #6366f1);
  color: #fff; border: none; border-radius: 10px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: opacity 0.15s;
}
.comment-login-btn:hover { opacity: 0.87; }

[data-theme="dark"] .comment-login-banner {
  border-color: rgba(255,255,255,0.07);
  background: #181828;
}

/* Avatar image in comments */
.cm-avatar-img {
  width: 32px; height: 32px;
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0;
}
.auth-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover;
}

/* ═══════════════════════════════════════════
   GATE SLIDE (login wall after post 6)
═══════════════════════════════════════════ */
.gate-slide {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  overflow: hidden;
  direction: rtl;
}

/* Decorative radial glow behind card */
.gate-slide::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  pointer-events: none;
}

.gate-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  padding: 36px 28px;
  max-width: 340px; width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
}

.gate-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(99,102,241,0.18);
  border: 1.5px solid rgba(99,102,241,0.40);
  display: flex; align-items: center; justify-content: center;
  color: #a5b4fc;
}

.gate-title {
  font-size: 20px; font-weight: 700;
  color: #fff; margin: 0; line-height: 1.35;
}
.gate-sub {
  font-size: 14px; color: rgba(255,255,255,0.55);
  margin: 0; line-height: 1.65;
}

.gate-btn {
  width: 100%; padding: 14px;
  background: var(--primary, #6366f1);
  color: #fff; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 4px 24px rgba(99,102,241,0.40);
}
.gate-btn:hover  { opacity: 0.90; }
.gate-btn:active { transform: scale(0.97); }

.gate-phone {
  width: 100%; box-sizing: border-box;
  padding: 12px 16px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-size: 16px !important;
  text-align: center;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  outline: none;
  direction: ltr;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gate-phone:focus {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
  background: rgba(255,255,255,0.11);
}
.gate-phone::placeholder { color: rgba(255,255,255,0.35); }

/* ── Mobile: search dropdown full-width ── */
@media (max-width: 700px) {
  .search-dropdown {
    position: fixed;
    top: var(--header-h);
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* ═══════════════════════════════════════════
   SILVER COUNTER
═══════════════════════════════════════════ */
.silver-counter {
  /* Fixed to left edge, vertically centred */
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s;
}
.silver-counter:hover { transform: translateY(-50%) scale(1.12); }
.silver-coin-icon { font-size: 28px; line-height: 1; }

.silver-fly-coin {
  pointer-events: none;
  position: fixed;
  z-index: 99999;
  font-size: 18px;
  line-height: 1;
}

@keyframes silver-counter-pop {
  0%   { transform: translateY(-50%) scale(1); }
  40%  { transform: translateY(-50%) scale(1.4); }
  100% { transform: translateY(-50%) scale(1); }
}
.silver-counter-pop { animation: silver-counter-pop 0.35s ease; }

/* +N earn pop — shown at feed center */
.silver-earn-pop {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  z-index: 99998;
  font-size: 52px;
  font-weight: 900;
  color: #a5f3a0;
  text-shadow: 0 2px 16px rgba(34,197,94,0.5);
  opacity: 0;
  animation: silver-earn-pop 0.9s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes silver-earn-pop {
  0%   { opacity: 0;   transform: translate(-50%, -30%) scale(0.4); }
  25%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
  60%  { opacity: 1;   transform: translate(-50%, -55%) scale(1.0); }
  100% { opacity: 0;   transform: translate(-50%, -75%) scale(0.9); }
}

/* ═══════════════════════════════════════════
   PROFILE SHEET
═══════════════════════════════════════════ */
.profile-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.profile-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}

.profile-sheet-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: var(--card-bg, #fff);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.18);
}
[data-theme="dark"] .profile-sheet-card { background: #1a1a2e; }

.profile-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(148,163,184,0.4);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.psh-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(148,163,184,0.15);
}

.psh-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.psh-info { flex: 1; min-width: 0; }
.psh-name { font-size: 15px; font-weight: 700; color: var(--fg); line-height: 1.3; }
.psh-silver-badge { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.psh-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-fg, #64748b);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}
.psh-close:hover { background: rgba(148,163,184,0.15); }

.psh-tabs {
  display: flex;
  border-bottom: 1px solid rgba(148,163,184,0.15);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.psh-tabs::-webkit-scrollbar { display: none; }

.psh-tab {
  flex: 1;
  min-width: 72px;
  padding: 10px 8px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-fg, #64748b);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.psh-tab.active {
  color: var(--primary, #6366f1);
  border-bottom-color: var(--primary, #6366f1);
}
.psh-tab:hover { color: var(--fg); }

.psh-tab-body {
  display: none;
  flex-direction: column;
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  gap: 10px;
}
.psh-tab-body.active { display: flex; }

/* ── Silver tab ── */
.sa-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.sa-hero-left { display: flex; align-items: center; gap: 12px; }
.sa-hero-coin { font-size: 36px; line-height: 1; }
.sa-hero-balance { font-size: 34px; font-weight: 800; color: var(--primary, #6366f1); line-height: 1.1; }
.sa-hero-sublabel { font-size: 11px; color: var(--muted-fg, #64748b); margin-top: 2px; }
.sa-hero-streak {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(251,146,60,0.12);
  border: 1px solid rgba(251,146,60,0.3);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 64px;
}
.sa-streak-fire { font-size: 20px; }
.sa-streak-num { font-size: 22px; font-weight: 800; color: #f97316; line-height: 1; }
.sa-streak-label { font-size: 10px; color: var(--muted-fg, #64748b); }

.sa-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-fg, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 6px;
}

/* Activity table */
.sa-activity-table {
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
}
.sa-act-head,
.sa-act-row {
  display: grid;
  grid-template-columns: 28px 1fr 76px 108px;
  gap: 10px;
  align-items: center;
}
.sa-act-head {
  padding: 8px 12px;
  background: rgba(148,163,184,0.1);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-fg, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sa-act-row {
  padding: 10px 12px;
  font-size: 13px;
  border-top: 1px solid rgba(148,163,184,0.1);
  transition: background 0.15s;
}
.sa-act-row:hover { background: rgba(148,163,184,0.05); }
.sa-act-row--active { background: rgba(34,197,94,0.04); }
.sa-act-icon { font-size: 16px; line-height: 1; text-align: center; }
.sa-act-label { color: var(--fg); }
.sa-col-rate { text-align: center; }
.sa-col-cap  { text-align: center; }
.sa-rate-pill {
  display: inline-block;
  background: rgba(99,102,241,0.12);
  color: var(--primary, #6366f1);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.sa-rate-pill--pct {
  background: rgba(139,92,246,0.13);
  color: #7c3aed;
}
.sa-cap-text {
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted-fg, #94a3b8);
  font-weight: 600;
}
.sa-cap-text--pending {
  color: #f97316;
  animation: pendingPulse 1.6s ease-in-out infinite;
}
@keyframes pendingPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.65; }
}
.sa-cap-text--claimed { color: #22c55e; }

/* Badge chips */
.sa-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}
.sa-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  animation: badgeGlow 2.4s ease-in-out infinite;
}
.sa-badge--7d  { background: rgba(251,146,60,0.15); color: #ea580c; border: 1px solid rgba(251,146,60,0.4); }
.sa-badge--30d { background: rgba(234,179,8,0.13);  color: #b45309; border: 1px solid rgba(234,179,8,0.45); }
.sa-badge--3m  { background: rgba(99,102,241,0.13); color: #4f46e5; border: 1px solid rgba(99,102,241,0.4); }
@keyframes badgeGlow {
  0%,100% { box-shadow: none; }
  50%      { box-shadow: 0 0 8px currentColor; }
}

/* Pending reward claim banner */
.sa-reward-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(251,146,60,0.14), rgba(234,179,8,0.10));
  border: 1.5px solid rgba(251,146,60,0.45);
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 10px;
  animation: rewardPulse 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.sa-reward-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: rewardShimmer 2.5s linear infinite;
}
@keyframes rewardPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(251,146,60,0); }
  50%      { box-shadow: 0 0 0 5px rgba(251,146,60,0.12); }
}
@keyframes rewardShimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}
.sa-reward-emoji { font-size: 32px; flex-shrink: 0; }
.sa-reward-text  { flex: 1; min-width: 0; }
.sa-reward-text strong { display: block; font-size: 13px; color: var(--fg); margin-bottom: 3px; }
.sa-reward-text span   { font-size: 12px; color: #b45309; font-weight: 600; }
.sa-reward-claim-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #f97316, #eab308);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.sa-reward-claim-btn:hover  { opacity: 0.88; }
.sa-reward-claim-btn:active { transform: scale(0.95); }
.sa-reward-claim-btn:disabled { opacity: 0.5; cursor: default; }
.sa-reward-banner--goal {
  background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(139,92,246,0.07));
  border-color: rgba(99,102,241,0.30);
  animation: none;
}
.sa-reward-banner--goal::before { display: none; }
.sa-reward-banner--goal .sa-reward-text span { color: #6366f1; }

/* Transaction list */
.sa-tx-list { display: flex; flex-direction: column; gap: 5px; }
.sa-tx-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(148,163,184,0.06);
  border-radius: 9px;
  font-size: 13px;
}
.sa-tx-label { color: var(--fg); }
.sa-tx-delta { font-weight: 700; color: #22c55e; }
.sa-tx-delta.negative { color: #ef4444; }
.sa-tx-date { color: var(--muted-fg, #94a3b8); font-size: 11px; }

.psh-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-fg, #64748b);
  margin: 8px 0 4px;
}

.psh-load-more {
  width: 100%;
  padding: 10px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 10px;
  color: var(--primary, #6366f1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.psh-load-more:hover { background: rgba(99,102,241,0.15); }

/* ── Submit tab ── */
.psh-desc { font-size: 13px; color: var(--muted-fg, #64748b); line-height: 1.6; margin: 0; }
.psh-msg { font-size: 13px; padding: 6px 0; }
.psh-msg-ok { color: #22c55e; }
.psh-msg-err { color: #ef4444; }

.submit-list { display: flex; flex-direction: column; gap: 6px; }
.submit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(148,163,184,0.07);
  border-radius: 8px;
  font-size: 12px;
}
.si-url { flex: 1; color: var(--muted-fg, #64748b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.si-status { font-weight: 600; font-size: 11px; }
.si-accepted { color: #22c55e; }
.si-pending, .si-processing { color: #f59e0b; }
.si-rejected { color: #ef4444; }
.si-duplicate { color: #94a3b8; }
.si-silver { color: #6366f1; font-weight: 700; font-size: 12px; }

/* ── Referral tab ── */
.referral-link-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.07), rgba(139,92,246,0.05));
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rlc-label { font-size: 12px; color: var(--muted-fg, #64748b); font-weight: 600; }
.rlc-link-row { display: flex; gap: 8px; }
.rlc-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: var(--fg);
  font-size: 12px;
  font-family: monospace;
  outline: none;
}
[data-theme="dark"] .rlc-input { background: rgba(255,255,255,0.06); }
.rlc-copy-btn {
  padding: 8px 14px;
  background: var(--primary, #6366f1);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.rlc-copy-btn:hover { opacity: 0.85; }
.rlc-rule { font-size: 11px; color: var(--muted-fg, #94a3b8); line-height: 1.6; margin: 0; }

.ref-stats-row { display: flex; gap: 12px; }
.ref-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: rgba(148,163,184,0.07);
  border-radius: 10px;
  gap: 4px;
}
.ref-stat span { font-size: 22px; font-weight: 800; color: var(--fg); }
.ref-stat small { font-size: 11px; color: var(--muted-fg, #94a3b8); }

.ref-list { display: flex; flex-direction: column; gap: 6px; }
.ref-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(148,163,184,0.07);
  border-radius: 8px;
  font-size: 13px;
}
.ri-name { flex: 1; color: var(--fg); }
.ri-silver { color: #6366f1; font-weight: 700; }
.ri-status { font-size: 14px; }

/* ── Settings tab (sheet version) ── */
.psh-sep {
  height: 1px;
  background: rgba(148,163,184,0.15);
  margin: 4px 0;
}
.psh-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 10px;
  color: #ef4444;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.psh-logout-btn:hover { background: rgba(239,68,68,0.13); }

.psh-empty { color: var(--muted-fg, #94a3b8); font-size: 13px; text-align: center; padding: 16px; }

/* ═══════════════════════════════════════════
   COMMENT SILVER BADGE
═══════════════════════════════════════════ */
.cm-silver-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 4px 9px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}
.cm-scb-checking {
  background: rgba(99,102,241,0.1);
  color: #818cf8;
  border: 1px solid rgba(99,102,241,0.2);
}
.cm-scb-ok {
  background: rgba(34,197,94,0.1);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.2);
  animation: cm-badge-fadein 0.3s ease;
}
.cm-scb-fail {
  background: rgba(239,68,68,0.08);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.18);
  animation: cm-badge-fadein 0.3s ease;
}
@keyframes cm-badge-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Spinner inside checking badge */
.cm-sc-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(99,102,241,0.3);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: cm-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes cm-spin {
  to { transform: rotate(360deg); }
}

/* Permanent silver-earned badge on comments (visible to all) */
.cm-silver-earned {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #a3e635;
  background: rgba(163,230,53,0.1);
  border: 1px solid rgba(163,230,53,0.25);
  border-radius: 8px;
  padding: 2px 7px;
  margin: 4px 0 2px;
  letter-spacing: 0.02em;
}
