/* ============================================================
   BASE & RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary:    #0d0e11;
  --bg-secondary:  #13151a;
  --bg-card:       #181b22;
  --bg-hover:      #1e2230;
  --bg-sidebar:    #111318;
  --border:        #222530;
  --border-active: #2e3347;
  --accent:        #00e5a0;
  --accent-dim:    rgba(0, 229, 160, 0.12);
  --accent2:       #1d9bf0;
  --text-primary:  #e8eaf0;
  --text-secondary:#7a8098;
  --text-muted:    #4a5068;
  --grade-a:       #00e5a0;
  --grade-b:       #00b87a;
  --grade-c:       #008f5e;
  --grade-d:       #006b46;
  --grade-e:       #f97316;
  --grade-f:       #ef4444;
  --grade-p:       #94a3b8;
  --sidebar-width: 252px;
  --topbar-height: 120px;
  --radius:        8px;
  --radius-sm:     5px;
  --transition:    0.18s ease;
}

html { font-size: 15px; }
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   TOP BAR — two-column layout
   Left col  : logo (row 1) + search (row 2)  — width = sidebar
   Right col : banner — full height, prominent
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

/* ---- Left column: logo + search ---- */
.topbar-left {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

/* Row 1 inside left col: logo */
.topbar-row1 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  flex: 1;
}

/* Row 2 inside left col: search */
.topbar-row2 {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 38px;
  border-top: 1px solid var(--border);
}

/* Logo image */
.topbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-logo img {
  height: 60px;
  width: auto;
  display: block;
  mix-blend-mode: lighten;
  background: var(--bg-secondary);
  border-radius: 4px;
}

/* Search bar — fills the left column row 2 */
.topbar-search {
  flex: 1;
  position: relative;
}
.topbar-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 5px 10px 5px 28px;
  font-size: 0.8rem;
  outline: none;
  transition: border var(--transition);
  height: 26px;
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search input:focus { border-color: var(--accent); }
.topbar-search .search-icon {
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.7rem;
  pointer-events: none;
}

/* Hidden elements */
.topbar-stats { display: none; }
.topbar-admin-link { display: none; }

/* Prevent mobile zoom on search input focus */
@media (max-width: 768px) {
  .topbar-search input { font-size: 16px; }
}

/* ---- Right column: TOP BANNER ---- */
.topbar-banner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color var(--transition);
  text-decoration: none;
  border-left: 1px solid var(--border);
}
.topbar-banner:hover .topbar-banner-inner { opacity: 1.2; }

/* Animated shimmer background for placeholder */
.topbar-banner-inner {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    var(--bg-card)          0%,
    #1a1e2a                30%,
    rgba(0,229,160,0.07)   50%,
    #1a1e2a                70%,
    var(--bg-card)         100%
  );
  background-size: 250% 100%;
  animation: shimmer 4s infinite linear;
}
@keyframes shimmer {
  0%   { background-position: 250% 0; }
  100% { background-position: -250% 0; }
}

/* Dashed border overlay — only shown on placeholder, hidden when image is present */
.topbar-banner:has(img)::after { display: none; }

.topbar-banner-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 24px;
  text-align: center;
}
.topbar-banner-text .banner-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg-hover);
  border: 1px solid var(--border-active);
  border-radius: 3px;
  padding: 2px 8px;
  color: var(--text-muted);
}
.topbar-banner-text .banner-placeholder {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}
.topbar-banner-text .banner-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  z-index: 100;
  padding: 10px 0;
}

.sidebar-section {
  padding: 6px 0;
}

.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 18px 5px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 7px 18px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 2px solid transparent;
  position: relative;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-item .item-icon {
  width: 20px;
  text-align: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.sidebar-item .item-count {
  margin-left: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-item.active .item-count {
  background: var(--accent-dim);
  border-color: transparent;
  color: var(--accent);
}

.grade-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 20px 24px;
  min-width: 0;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title .title-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0,229,160,0.25);
  padding: 2px 8px;
  border-radius: 10px;
}

.page-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.filter-btn.active {
  background: var(--accent-dim);
  border-color: rgba(0,229,160,0.3);
  color: var(--accent);
}

/* ============================================================
   HOME INTRO BLOCK
   ============================================================ */
.home-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-intro p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.home-intro p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.home-intro-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.home-intro-col {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-intro-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.home-intro-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.home-intro-col ul li {
  font-size: 0.83rem;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
}

.home-intro-col ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.home-intro-col p {
  font-size: 0.83rem !important;
  margin-top: 2px;
}

.intro-link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--transition);
}
.intro-link:hover { opacity: 0.75; }

/* ============================================================
   ACCOUNT TABLE / LIST
   ============================================================ */
.accounts-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
}

.accounts-table thead tr th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.account-row {
  background: var(--bg-card);
  transition: background var(--transition);
  cursor: default;
}

.account-row:hover { background: var(--bg-hover); }

.account-row td {
  padding: 12px 14px;
  vertical-align: middle;
}

.account-row td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.account-row td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Profile cell */
.profile-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 195px;
}

.profile-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-hover);
}

.profile-avatar-placeholder {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 0.98rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-info { min-width: 0; }

.profile-info-link {
  min-width: 0;
  text-decoration: none;
  cursor: pointer;
}
.profile-info-link:hover .profile-name {
  color: var(--accent);
  text-decoration: underline;
}
.profile-info-link:hover .profile-handle {
  color: var(--text-primary);
}

.profile-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 161px;
}

.profile-handle {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Social icons cell */
.social-icons-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.social-icon-btn {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 0.83rem;
  transition: all var(--transition);
  text-decoration: none;
}

.social-icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.social-icon-btn.has-link { color: var(--text-secondary); }
.social-icon-btn.has-link:hover { color: #a0a8b8; border-color: #4a5270; }
.social-icon-btn.no-link { opacity: 0.3; pointer-events: none; }

/* Share button */
.share-card-btn {
  color: var(--text-secondary) !important;
}
.share-card-btn svg {
  animation: shareRotate 4s linear infinite;
  transform-origin: center;
}
@keyframes shareRotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Grade cell */
.grade-badge {
  width: 32px; height: 32px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.92rem;
  font-weight: 800;
  border: 2px solid;
  margin: 0 auto;
}

.grade-A { color: var(--grade-a); border-color: rgba(0,229,160,0.45);  background: rgba(0,229,160,0.08); }
.grade-B { color: var(--grade-b); border-color: rgba(0,184,122,0.45);  background: rgba(0,184,122,0.08); }
.grade-C { color: var(--grade-c); border-color: rgba(0,143,94,0.45);   background: rgba(0,143,94,0.08); }
.grade-D { color: var(--grade-d); border-color: rgba(0,107,70,0.45);  background: rgba(0,107,70,0.08); }
.grade-E { color: var(--grade-e); border-color: rgba(249,115,22,0.45); background: rgba(249,115,22,0.08); }
.grade-F { color: var(--grade-f); border-color: rgba(239,68,68,0.45);  background: rgba(239,68,68,0.08); }
.grade-P { color: var(--grade-p); border-color: rgba(148,163,184,0.45); background: rgba(148,163,184,0.08); }

/* 1M badge */
.badge-1m {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245,158,11,0.12);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
}

/* ============================================================
   SIDEBAR — SPECIAL ITEMS
   ============================================================ */

/* "Soon" label */
.soon-tag {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(245,158,11,0.1);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 4px;
  padding: 1px 6px;
}

/* "Soon" items — slightly dimmed but still clickable */
.sidebar-item--soon {
  opacity: 0.65;
}
.sidebar-item--soon:hover {
  opacity: 1;
}
.sidebar-item--soon.active {
  opacity: 1;
}

/* "Report" item — distinct accent */
.sidebar-item--report {
  color: var(--text-muted);
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 6px;
}
.sidebar-item--report:hover {
  color: var(--grade-e);
  background: rgba(239,68,68,0.06);
}
.sidebar-item--report.active {
  color: var(--grade-e);
  background: rgba(239,68,68,0.08);
  border-left-color: var(--grade-e);
}

/* ============================================================
   SIDEBAR X LINK
   ============================================================ */
.sidebar-x-link {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.sidebar-x-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sidebar-x-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  text-decoration: none;
}

/* ============================================================
   SIDEBAR TOTAL ACCOUNTS COUNTER
   ============================================================ */
.sidebar-total {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.sidebar-total span {
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   FIRST LINE — TOP SECTION ON LISTINGS
   ============================================================ */
.first-line-section {
  margin-bottom: 20px;
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius);
  overflow: hidden;
}

.first-line-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(245,158,11,0.08);
  border-bottom: 1px solid rgba(245,158,11,0.2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f59e0b;
}

.first-line-tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 3px;
  padding: 1px 6px;
  color: #f59e0b;
  margin-left: 2px;
}

.first-line-table { margin: 0; }
.first-line-table thead { display: none; }

.first-line-cta-link {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(245,158,11,0.7);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  transition: color var(--transition);
}
.first-line-cta-link:hover { color: #f59e0b; }

.account-row--first-line {
  background: rgba(245,158,11,0.04) !important;
}
.account-row--first-line:hover {
  background: rgba(245,158,11,0.08) !important;
}

/* ============================================================
   FIRST LINE — INFO PAGE
   ============================================================ */
.first-line-info-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 36px 0 60px;
}

.fl-info-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.fl-info-hero-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #f59e0b;
  flex-shrink: 0;
}

.fl-info-hero-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.fl-info-hero-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.fl-info-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-page .fl-info-body {
  gap: 4px;
}

.fl-info-body > p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}
.fl-info-body > p strong { color: var(--text-primary); }

.fl-info-how {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.fl-info-how-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.fl-info-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fl-info-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.fl-info-step strong { color: var(--text-primary); }

.fl-step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  color: #f59e0b;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.fl-info-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(29,155,240,0.06);
  border: 1px solid rgba(29,155,240,0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.fl-info-note i { color: var(--accent2); margin-top: 3px; flex-shrink: 0; font-size: 0.9rem; }
.fl-info-note strong { color: var(--text-primary); }
.fl-info-note span { flex: 1; }

.fl-info-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #f59e0b;
  color: #000;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 700;
  transition: opacity var(--transition);
  text-decoration: none;
  margin-top: 4px;
}
.fl-info-cta:hover { opacity: 0.85; }

/* ============================================================
   CONTRIBUTE PAGE
   ============================================================ */
.contribute-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 36px 0 60px;
}

.contribute-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 36px;
}

.contribute-body p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.contribute-highlight {
  font-size: 1.05rem !important;
  font-weight: 600;
  color: var(--text-primary) !important;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

.contribute-wallets-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.contribute-wallets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 36px;
}

.wallet-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.wallet-card:hover { border-color: var(--border-active); }

.wallet-chain {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 54px;
  flex-shrink: 0;
}

.wallet-address {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: var(--accent);
  flex: 1;
  word-break: break-all;
  letter-spacing: 0.03em;
}

.wallet-copy {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.wallet-copy:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.contribute-footer {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   COMING SOON CARD
   ============================================================ */
.coming-soon-card {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
}
.coming-soon-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  color: var(--text-muted);
  opacity: 0.4;
}
.coming-soon-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.coming-soon-card p {
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 0.8rem; }

/* ============================================================
   LOADING
   ============================================================ */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 16px;
}
.pagination button {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  transition: all var(--transition);
}
.pagination button:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.pagination button.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--grade-e); }
.toast.info { border-left: 3px solid var(--accent2); }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 101;
  border-radius: 8px;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  animation: hamGlow 2.8s ease-in-out infinite;
}
.hamburger-btn:active {
  transform: scale(0.92);
}
@keyframes hamGlow {
  0%, 100% { text-shadow: 0 0 6px rgba(0,229,160,0.3), 0 0 12px rgba(0,229,160,0.15); color: var(--text-primary); }
  50%       { text-shadow: 0 0 10px rgba(0,229,160,0.7), 0 0 22px rgba(0,229,160,0.35); color: #00e5a0; }
}

/* Sidebar overlay — hidden on desktop */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-210px); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); width: 210px; overflow-y: scroll; -webkit-overflow-scrolling: touch; touch-action: pan-y; z-index: 100; }
  .main-content { margin-left: 0; padding: 14px; }
  .social-icons-cell { gap: 3px; }
  .social-icon-btn { width: 24px; height: 24px; font-size: 0.65rem; }
  .topbar-banner { min-width: 160px; }

  /* Compact sidebar items on mobile */
  .sidebar-item { padding: 3px 14px; font-size: 0.82rem; gap: 8px; }
  .sidebar-section { padding: 2px 0; }
  .sidebar-section-label { padding: 6px 14px 3px; font-size: 0.68rem; }
  .sidebar-item .item-icon { width: 16px; font-size: 0.78rem; }
  .sidebar-item .item-count { font-size: 0.68rem; padding: 1px 5px; }
}

@media (max-width: 600px) {
  /* Show hamburger */
  .hamburger-btn { display: flex; margin-left: 8px; }

  /* Make topbar a row: hamburger | logo+search | (banner hidden) */
  .topbar { flex-direction: row; align-items: center; height: var(--topbar-height); }

  /* topbar-left fills remaining space, shows logo + search */
  .topbar-left {
    width: auto;
    flex: 1;
    border-right: none;
  }

  .topbar-row1 { justify-content: flex-start; padding: 0 10px; }
  .topbar-logo img { height: 44px; }
  .topbar-row2 { padding: 0 10px; }

  .profile-name { max-width: 90px; font-size: 0.85rem; }
  .profile-handle { font-size: 0.72rem; }
  .profile-avatar { width: 38px; height: 38px; }
  .profile-avatar-placeholder { width: 38px; height: 38px; font-size: 0.85rem; }
  .profile-cell { gap: 10px; }
  .account-row td { padding: 10px 12px; }
  .grade-badge { width: 28px; height: 28px; font-size: 0.8rem; }
  .accounts-table thead { display: none; }
  .topbar-banner { display: none; }
  .topbar-stats { display: none; }
  #resultsCount { display: none; }

  /* Hide all social icons except X and Telegram on mobile */
  .social-icon-btn { display: none; }
  .social-icon-btn[data-key="link_x"],
  .social-icon-btn[data-key="link_telegram"],
  .share-card-btn { display: flex; }
}


/* ============================================================
   MOBILE AD ROW
   ============================================================ */
/* Hidden on desktop — shown only on mobile via media query */
.mobile-ad-wrap { display: none; }

@media (max-width: 600px) {
  .mobile-ad-wrap {
    display: block;
    margin-bottom: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(245,158,11,0.35);
    background: rgba(245,158,11,0.05);
    animation: fadeIn 0.3s ease;
  }
  .mobile-ad-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
  }
  .mobile-ad-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #f59e0b;
    background: rgba(245,158,11,0.18);
    border: 1px solid rgba(245,158,11,0.35);
    border-radius: 4px;
    padding: 2px 5px;
    flex-shrink: 0;
  }
  .mobile-ad-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(245,158,11,0.2);
  }
  .mobile-ad-text {
    font-size: 0.82rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-ad-arrow {
    font-size: 0.85rem;
    color: #f59e0b;
    flex-shrink: 0;
    font-weight: 600;
  }
}


/* ============================================================
   PROFILE SEARCH POPUP
   ============================================================ */
.profile-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.profile-popup-overlay.active { display: block; }

.profile-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 92%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 1001;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.profile-popup.active {
  display: block;
  transform: translate(-50%, -50%) scale(1);
  animation: popupIn 0.22s ease;
}
@keyframes popupIn {
  from { transform: translate(-50%, -50%) scale(0.93); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Mobile — centered popup with auto height */
@media (max-width: 600px) {
  .profile-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 92%;
    max-width: 92%;
    max-height: 80vh;
    height: fit-content;
    margin: auto;
    border-radius: 16px;
    transform: scale(0.95);
    padding: 24px 20px 24px;
  }
  .profile-popup.active {
    transform: scale(1);
    animation: popupIn 0.22s ease;
  }
  @keyframes popupIn {
    from { transform: scale(0.93); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
  }
  .popup-drag-handle { display: none; }
}

/* Drag handle — visible on mobile only */
.popup-drag-handle {
  display: none;
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}
@media (max-width: 600px) {
  .popup-drag-handle { display: block; }
}

.profile-popup-close {  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.18s;
}
.profile-popup-close:hover { color: var(--text-primary); border-color: var(--border-active); }

/* Popup content */
.popup-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.popup-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
  background: var(--bg-hover); flex-shrink: 0;
}
.popup-avatar-placeholder {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-hover); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; flex-shrink: 0;
}
.popup-name { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.popup-username { font-size: 0.85rem; color: var(--text-muted); }
.popup-grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 8px;
  font-size: 1.2rem; font-weight: 900;
  border: 2px solid; flex-shrink: 0; margin-left: auto;
}
.popup-divider { height: 1px; background: var(--border); margin: 16px 0; }
.popup-social-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 10px;
}
.popup-social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.popup-social-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.78rem; text-decoration: none;
  transition: all 0.18s;
}
.popup-social-link:hover { border-color: var(--border-active); color: var(--text-primary); }
.popup-share-btn {
  width: 100%; padding: 12px; border-radius: 8px;
  background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  margin-top: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  position: relative; overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
/* Shimmer sweep */
.popup-share-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  animation: shareSweep 2.4s ease-in-out infinite;
}
@keyframes shareSweep {
  0%   { left: -100%; }
  60%  { left: 140%; }
  100% { left: 140%; }
}
.popup-share-btn:hover {
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 6px 24px rgba(255,255,255,0.12), 0 2px 8px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}
.popup-share-btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(0,0,0,0.4); }

/* Not found state */
.popup-not-found { text-align: center; padding: 16px 0 8px; }
.popup-not-found-icon { font-size: 2.5rem; margin-bottom: 12px; }
.popup-not-found h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.popup-not-found p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.popup-not-found-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 8px;
  background: var(--accent); color: #000;
  font-size: 0.85rem; font-weight: 700;
  border: none; cursor: pointer; transition: opacity 0.18s;
  text-decoration: none;
}
.popup-not-found-btn:hover { opacity: 0.85; }

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}
.footer-link {
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-link:hover {
  color: var(--text-secondary);
}
.footer-sep {
  opacity: 0.4;
}
