/* ============================================================
   THEME — Telegram CSS variables with fallbacks
   ============================================================ */
:root {
  --bg:          var(--tg-theme-bg-color, #ffffff);
  --bg2:         var(--tg-theme-secondary-bg-color, #f2f2f7);
  --text:        var(--tg-theme-text-color, #1c1c1e);
  --hint:        var(--tg-theme-hint-color, #8e8e93);
  --accent:      var(--tg-theme-button-color, #3390ec);
  --accent-fg:   var(--tg-theme-button-text-color, #ffffff);
  --link:        var(--tg-theme-link-color, #3390ec);
  --danger:      var(--tg-theme-destructive-text-color, #e53935);
  --header-bg:   var(--tg-theme-header-bg-color, #ffffff);
  --section-bg:  var(--tg-theme-section-bg-color, #ffffff);
  --sep:         var(--tg-theme-section_separator_color, rgba(60,60,67,.12));

  --r:    12px;
  --r-sm:  8px;
  --r-lg: 16px;

  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.09);

  --nav-h:     60px;
  --header-h:  52px;
  --safe-b:    env(safe-area-inset-bottom, 0px);
  --t:         .16s ease;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input  { font: inherit; color: inherit; border: none; background: none; outline: none; }
img    { display: block; max-width: 100%; }
video  { display: block; }

/* ============================================================
   MOCK BANNER
   ============================================================ */
.mock-banner {
  background: rgba(245,166,35,.13);
  border-bottom: 1px solid rgba(245,166,35,.3);
  color: #9a6000;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  text-align: center;
  padding: 6px 16px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#app { display: flex; flex-direction: column; min-height: 100dvh; }

.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  padding: 0 18px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--sep);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.page-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.3px;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

.content {
  flex: 1;
  padding: 14px 14px calc(var(--nav-h) + var(--safe-b) + 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--header-bg);
  border-top: 1px solid var(--sep);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--hint);
  transition: color var(--t);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.nav-item.active { color: var(--accent); }

.nav-icon { width: 24px; height: 24px; flex-shrink: 0; }

.nav-icon-wrap { position: relative; display: inline-flex; }

.nav-badge {
  position: absolute;
  top: -3px; right: -5px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid var(--header-bg);
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1px;
  line-height: 1;
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin: 18px 0 10px 2px;
}

/* ============================================================
   METRIC CARDS (Dashboard)
   ============================================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.metric-card {
  background: var(--section-bg);
  border-radius: var(--r);
  padding: 13px 11px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.metric-card.--alert::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--danger);
}

.metric-icon {
  font-size: 17px;
  line-height: 1;
  margin-bottom: 7px;
  display: block;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 11px;
  color: var(--hint);
  font-weight: 500;
  letter-spacing: .1px;
  line-height: 1.2;
}

/* ============================================================
   QUICK ACTIONS ROW
   ============================================================ */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   PROFILE CARDS (Complaints / Verifications)
   ============================================================ */
.profile-card {
  background: var(--section-bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  transition: opacity .2s ease, transform .2s ease;
}
.profile-card.--exit {
  opacity: 0;
  transform: translateX(24px) scale(.98);
  pointer-events: none;
}

.pc-header {
  display: flex;
  gap: 13px;
  padding: 14px 14px 10px;
  align-items: flex-start;
}

.pc-photo {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
}

.pc-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--hint);
}

.pc-info { flex: 1; min-width: 0; }

.pc-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 2px;
}

.pc-meta {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 5px;
}

.pc-bio {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.count-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(229,57,53,.10);
  color: var(--danger);
  white-space: nowrap;
}

.pc-date { font-size: 11px; color: var(--hint); white-space: nowrap; }

.pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}
.tag--warn    { background: rgba(245,166,35,.12); color: #9a6000; }
.tag--danger  { background: rgba(229,57,53,.10);  color: var(--danger); }
.tag--info    { background: rgba(51,144,236,.11); color: var(--accent); }
.tag--neutral { background: var(--bg2);           color: var(--text); }

/* video note */
.video-note-wrap { display: flex; justify-content: center; padding: 0 14px 10px; }

.video-note {
  width: 112px; height: 112px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  display: block;
  border: 2px solid var(--sep);
}

.video-note-placeholder {
  width: 112px; height: 112px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--hint);
  border: 2px solid var(--sep);
}

/* action row */
.action-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--sep);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  transition: opacity var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  flex: 1;
  line-height: 1;
  cursor: pointer;
}
.btn:active { opacity: .78; transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }

.btn--primary   { background: var(--accent);                color: var(--accent-fg); }
.btn--danger    { background: rgba(229,57,53,.11);          color: var(--danger); }
.btn--secondary { background: var(--bg2);                   color: var(--text); }
.btn--success   { background: rgba(48,168,125,.13);         color: #1a8a5c; }
.btn--ghost     { background: transparent;                  color: var(--hint); }
.btn--inline    { flex: initial; padding: 8px 14px; font-size: 13px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.badge--premium  { background: rgba(255,195,0,.16); color: #8a6200; }
.badge--verified { background: rgba(51,144,236,.13); color: var(--accent); }
.badge--banned   { background: rgba(229,57,53,.11); color: var(--danger); }
.badge--active   { background: rgba(48,168,125,.13); color: #1a8a5c; }

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border-radius: var(--r);
  padding-left: 14px;
  margin-bottom: 10px;
}

.search-icon { color: var(--hint); flex-shrink: 0; }

.search-input {
  flex: 1;
  padding: 13px 10px;
  font-size: 16px;
  background: none;
}
.search-input::placeholder { color: var(--hint); }

.search-clear {
  padding: 0 14px;
  font-size: 15px;
  color: var(--hint);
  align-self: stretch;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.search-btn {
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  height: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
}

/* ── Search results list ── */
#search-results {
  background: var(--section-bg);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.sr-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--sep);
  cursor: pointer;
  transition: background var(--t);
  -webkit-tap-highlight-color: transparent;
}
.sr-item:last-child { border-bottom: none; }
.sr-item:active, .sr-item.--selected { background: var(--bg2); }

.sr-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--hint);
  flex-shrink: 0;
}

.sr-info { flex: 1; min-width: 0; }

.sr-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-meta {
  font-size: 12px;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-badges { display: flex; gap: 4px; flex-shrink: 0; }

.sr-empty {
  padding: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--hint);
}

.sr-loading { padding: 8px 0; }

/* ============================================================
   CHARTS (Dashboard)
   ============================================================ */
.period-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.period-tab {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--hint);
  transition: background var(--t), color var(--t);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.period-tab.active {
  background: var(--accent);
  color: var(--accent-fg);
}

.chart-card {
  background: var(--section-bg);
  border-radius: var(--r);
  padding: 13px 14px 10px;
  box-shadow: var(--shadow);
  margin-bottom: 9px;
  overflow: hidden;
}

.chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.chart-today {
  font-size: 12px;
  color: var(--hint);
  font-weight: 500;
}

.chart-empty {
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: var(--hint);
}

/* ============================================================
   USER CARD (Users page)
   ============================================================ */
.user-card {
  background: var(--section-bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 10px;
}

.uc-body {
  display: flex;
  gap: 13px;
  padding: 14px;
  align-items: flex-start;
}

.uc-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--hint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.uc-info { flex: 1; min-width: 0; }

.uc-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
  margin-bottom: 2px;
}

.uc-username {
  font-size: 13px;
  color: var(--link);
  margin-bottom: 4px;
}

.uc-meta {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 8px;
}

.uc-bio {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.uc-badges { display: flex; flex-wrap: wrap; gap: 5px; }

.uc-premium-info {
  font-size: 12px;
  color: #8a6200;
  margin-top: 4px;
}

.uc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--sep);
}
.uc-actions .btn--reset {
  width: 100%;
  margin-top: 2px;
}

/* ============================================================
   MODAL / BOTTOM SHEET
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}

.modal {
  background: var(--section-bg);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 10px 20px calc(20px + var(--safe-b));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  animation: slideUp .25s ease;
}

.modal-handle {
  width: 36px; height: 4px;
  background: var(--sep);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 18px;
}

.modal-body { margin-bottom: 20px; }

.modal-label {
  display: block;
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 8px;
}

.modal-input {
  width: 100%;
  background: var(--bg2);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: .5px;
}

.modal-hint {
  font-size: 12px;
  color: var(--hint);
  text-align: center;
  margin-top: 8px;
}

.modal-actions { display: flex; gap: 10px; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ============================================================
   REFERRALS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--section-bg);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: var(--hint);
  font-weight: 500;
  line-height: 1.3;
}

.leaderboard {
  background: var(--section-bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--sep);
}
.lb-item:last-child { border-bottom: none; }

.lb-rank {
  font-size: 15px;
  font-weight: 700;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: var(--hint);
}
.lb-rank.--top { color: var(--accent); }

.lb-name {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(51,144,236,.11);
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: calc(100% - 28px);
  max-width: 380px;
  pointer-events: none;
}

.toast {
  padding: 11px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-md);
  animation: toastIn .22s ease;
  background: #1c1c1e;
}
.toast--success { background: #1a8a5c; }
.toast--error   { background: var(--danger); }
.toast--out     { animation: toastOut .18s ease forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px) scale(.95); } }

/* ============================================================
   LOADING / EMPTY / ERROR
   ============================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 0;
  gap: 14px;
}

.spinner {
  width: 30px; height: 30px;
  border: 2.5px solid var(--bg2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state, .error-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon, .error-icon {
  font-size: 44px;
  margin-bottom: 12px;
  opacity: .55;
}

.empty-title, .error-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-sub, .error-sub {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 18px;
}

/* ============================================================
   ACCESS DENIED
   ============================================================ */
.access-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 40px 32px;
  text-align: center;
  gap: 10px;
}
.ad-icon { font-size: 64px; margin-bottom: 4px; }
.ad-title { font-size: 22px; font-weight: 700; }
.ad-sub { font-size: 15px; color: var(--hint); max-width: 260px; }

/* ============================================================
   PILL TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--hint);
  transition: background var(--t), color var(--t);
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.tab-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider { height: 1px; background: var(--sep); margin: 4px 0; }

/* ============================================================
   DASHBOARD — Palantir-style command center
   ============================================================ */
.st-sub { font-weight: 500; color: var(--hint); text-transform: none; letter-spacing: 0; font-size: 10px; }

/* ── Hero KPI strip ── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 10px;
}
.kpi-card {
  position: relative;
  background: var(--section-bg);
  border-radius: var(--r);
  padding: 12px 13px 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.kpi-icon { font-size: 16px; line-height: 1; }
.kpi-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  font-size: 11px;
  color: var(--hint);
  font-weight: 500;
  margin-top: 3px;
}
.kpi-spark { width: 100%; height: 26px; display: block; margin-top: 8px; }
.kpi-spark-empty { height: 26px; margin-top: 8px; }

.delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.delta-pill.--up   { background: rgba(48,168,125,.14); color: #1a8a5c; }
.delta-pill.--down { background: rgba(229,57,53,.12);  color: var(--danger); }
.delta-pill.--flat { background: var(--bg2);           color: var(--hint); }

/* ── Trend row ── */
.trend-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--sep);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 4px;
}
.trend-cell { background: var(--section-bg); padding: 11px 9px; }
.trend-label { font-size: 10px; color: var(--hint); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.trend-now {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin: 4px 0 5px;
  font-variant-numeric: tabular-nums;
}
.trend-foot { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.trend-prev { font-size: 10px; color: var(--hint); }

/* ── Mini metric grid ── */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mini-card {
  background: var(--section-bg);
  border-radius: var(--r-sm);
  padding: 11px 10px;
  box-shadow: var(--shadow);
}
.mini-icon { font-size: 14px; display: block; margin-bottom: 5px; opacity: .9; }
.mini-val {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mini-label { font-size: 10.5px; color: var(--hint); font-weight: 500; margin-top: 3px; }

/* ── Panel (generic card) ── */
.panel {
  background: var(--section-bg);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 9px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title { font-size: 13px; font-weight: 600; }
.panel-meta { font-size: 11px; color: var(--hint); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Funnel ── */
.funnel-row { margin-bottom: 13px; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.funnel-label { font-size: 13px; font-weight: 500; }
.funnel-num { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-pct { color: var(--hint); font-weight: 600; font-size: 12px; }
.funnel-track {
  height: 9px;
  background: var(--bg2);
  border-radius: 5px;
  overflow: hidden;
}
.funnel-bar { height: 100%; border-radius: 5px; transition: width .5s ease; }
.funnel-conv { font-size: 10.5px; color: var(--hint); margin-top: 4px; }

/* ── Gender / segmented split ── */
.split-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg2);
}
.split-seg { height: 100%; transition: width .5s ease; }
.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 11px;
}
.split-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.split-item i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }

/* ── ELO histogram ── */
.elo-hist {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 78px;
}
.elo-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.elo-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; }
.elo-bar { width: 7px; border-radius: 2px 2px 0 0; transition: height .5s ease; }
.elo-x { font-size: 8.5px; color: var(--hint); margin-top: 5px; font-variant-numeric: tabular-nums; }

/* ── Engagement ── */
.eng-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.eng-chip {
  background: var(--bg2);
  border-radius: var(--r-sm);
  padding: 9px 6px;
  text-align: center;
}
.eng-chip b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.eng-chip span { font-size: 10px; color: var(--hint); }

.gauge { margin-top: 11px; }
.gauge-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
}
.gauge-head b { font-weight: 700; font-variant-numeric: tabular-nums; }
.gauge-track { height: 7px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }

/* ── Hourly activity ── */
.hourly {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2px;
  height: 60px;
}
.hb-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.hb-bar {
  width: 100%;
  max-width: 8px;
  background: var(--accent);
  opacity: .42;
  border-radius: 2px 2px 0 0;
  transition: height .4s ease;
}
.hb-bar.--peak { opacity: 1; }
.hourly-x {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--hint);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* ── Top profiles ── */
.tp-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sep);
}
.tp-item:last-child { border-bottom: none; }
.tp-rank {
  font-size: 14px;
  font-weight: 700;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: var(--hint);
  font-variant-numeric: tabular-nums;
}
.tp-rank.--top { color: var(--accent); }
.tp-photo, .tp-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
}
.tp-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--hint);
}
.tp-info { flex: 1; min-width: 0; }
.tp-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-meta { font-size: 11.5px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.tp-elo {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
.tp-wr { font-size: 10.5px; color: var(--hint); font-variant-numeric: tabular-nums; }

/* ============================================================
   VERIFICATIONS — list → detail
   ============================================================ */
.back-btn {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0 12px;
  -webkit-tap-highlight-color: transparent;
}

.ver-list {
  background: var(--section-bg);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ver-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--sep);
  cursor: pointer;
  transition: background var(--t);
  -webkit-tap-highlight-color: transparent;
}
.ver-item:last-child { border-bottom: none; }
.ver-item:active { background: var(--bg2); }
.ver-side { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ver-time { font-size: 11px; color: var(--hint); white-space: nowrap; }

.ver-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 14px 8px;
}

.ver-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ver-gallery::-webkit-scrollbar { display: none; }
.ver-thumb {
  width: 84px;
  height: 112px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
  border: 1px solid var(--sep);
}

/* ============================================================
   USER CARD — stats & facts
   ============================================================ */
.uc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--sep);
  margin: 0 14px 12px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.uc-stat { background: var(--section-bg); padding: 10px 4px; text-align: center; }
.uc-stat-val {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
.uc-stat-label { font-size: 9.5px; color: var(--hint); margin-top: 2px; }

.uc-facts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px 12px;
  font-size: 12px;
  color: var(--hint);
}

/* ============================================================
   RESPONSIVE — center container on wide screens
   ============================================================ */
@media (min-width: 520px) {
  .content      { max-width: 500px; margin-left: auto; margin-right: auto; }
  .page-header  { max-width: 500px; margin-left: auto; margin-right: auto; border-left: 1px solid var(--sep); border-right: 1px solid var(--sep); }
  .navbar       { max-width: 500px; margin-left: auto; margin-right: auto; border-left: 1px solid var(--sep); border-right: 1px solid var(--sep); }
}
