/*
Theme Name: AI Tools Directory
Theme URI: https://example.com/ai-tools-directory
Description: A feature-rich WordPress theme for building an AI tools directory (Futurepedia-style). Dark-by-default with a cream light theme, gradient highlights, hover glow cards, responsive grid, pill tags, search focus glow, tool detail pages with reviews / favorite / like / compare, a membership rewards program, community features, and an admin control panel.
Version: 1.1.36
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Author: WorkBuddy
License: GPL-2.0-or-later
Text Domain: ai-tools-directory
Tags: blog, grid-layout, one-column, two-columns, custom-menu, featured-images, theme-options, translation-ready, accessibility-ready
*/

/* =========================================================================
   1. DESIGN TOKENS  —  DARK THEME IS DEFAULT
   ========================================================================= */
:root {
  /* surfaces */
  --bg: #0c0a14;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(168,85,247,0.18), transparent 60%),
             radial-gradient(900px 500px at -10% 10%, rgba(236,72,153,0.12), transparent 55%);
  --bg-elev: #15101f;
  --bg-elev-2: #1d1530;
  --surface: rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.06);

  /* lines */
  --border: rgba(168,85,247,0.16);
  --border-strong: rgba(168,85,247,0.42);
  --border-soft: rgba(255,255,255,0.07);

  /* text */
  --text: #ECE9F5;
  --text-muted: #A39DB8;
  --text-dim: #6f6889;

  /* brand */
  --brand-1: #a855f7;
  --brand-2: #ec4899;
  --brand-grad: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(236,72,153,0.18));
  --glow: rgba(168,85,247,0.45);
  --glow-pink: rgba(236,72,153,0.40);

  /* status */
  --success: #34d399;
  --warning: #fbbf24;
  --star: #fbbf24;
  --danger: #fb7185;

  /* shape & motion */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-card: 0 10px 30px -16px rgba(0,0,0,0.7);
  --shadow-glow: 0 22px 60px -18px rgba(168,85,247,0.55), 0 0 0 1px rgba(236,72,153,0.40);
  --ease: cubic-bezier(.22,.61,.36,1);
  --maxw: 1240px;
  --header-h: 68px;
}

/* LIGHT / CREAM THEME overrides */
[data-theme="light"] {
  --bg: #faf6f0;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(168,85,247,0.10), transparent 60%),
             radial-gradient(900px 500px at -10% 10%, rgba(236,72,153,0.08), transparent 55%);
  --bg-elev: #ffffff;
  --bg-elev-2: #f3ece2;
  --surface: rgba(28,21,48,0.03);
  --surface-2: rgba(28,21,48,0.05);

  --border: rgba(168,85,247,0.20);
  --border-strong: rgba(168,85,247,0.45);
  --border-soft: rgba(28,21,48,0.08);

  --text: #1c1530;
  --text-muted: #5b5470;
  --text-dim: #8a8370;

  --shadow-card: 0 10px 30px -18px rgba(80,40,120,0.30);
  --shadow-glow: 0 22px 55px -20px rgba(168,85,247,0.40), 0 0 0 1px rgba(236,72,153,0.35);
  --glow: rgba(168,85,247,0.30);
  --glow-pink: rgba(236,72,153,0.28);
}

/* =========================================================================
   2. BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* gradient text helper */
.gradient-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 14px;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.btn-primary {
  background: var(--brand-grad); border: none; color: #fff;
  box-shadow: 0 10px 30px -12px var(--glow);
}
.btn-primary:hover { box-shadow: 0 14px 38px -10px var(--glow-pink); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* =========================================================================
   3. HEADER
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .container { display: flex; align-items: center; gap: 18px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-grad); display: grid; place-items: center;
  color: #fff; font-size: 18px; box-shadow: 0 8px 22px -8px var(--glow);
}
.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.main-nav a {
  padding: 8px 14px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500;
  color: var(--text-muted); transition: color .2s, background .2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--surface); }

.header-search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.header-search input {
  width: 100%; padding: 10px 14px 10px 40px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.header-search input::placeholder { color: var(--text-dim); }
.header-search input:focus {
  outline: none; border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.22), 0 0 26px rgba(236,72,153,0.28);
}
.header-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

/* Search autocomplete dropdown */
.search-form, .hero-search, .header-search { position: relative; }
.search-autocomplete {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 110;
  background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: 0 22px 60px -18px rgba(0,0,0,0.55); padding: 8px;
  max-height: 360px; overflow-y: auto; opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.search-autocomplete.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.search-autocomplete .sa-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  transition: background .15s; text-align: left; color: inherit;
}
.search-autocomplete .sa-item:hover, .search-autocomplete .sa-item.active {
  background: var(--surface-2);
}
.search-autocomplete .sa-thumb {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px;
  object-fit: cover; background: var(--bg-elev-2); display: grid; place-items: center;
  font-weight: 800; color: var(--brand-1); font-size: 16px; overflow: hidden;
}
.search-autocomplete .sa-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-autocomplete .sa-info { flex: 1; min-width: 0; }
.search-autocomplete .sa-title {
  font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-autocomplete .sa-title .verified { color: var(--success); font-size: 13px; }
.search-autocomplete .sa-meta {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-autocomplete .sa-meta .price {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--brand-grad-soft); color: var(--text); font-weight: 600; margin-right: 6px; font-size: 11px;
}
.search-autocomplete .sa-empty,
.search-autocomplete .sa-more {
  padding: 12px; text-align: center; font-size: 13px; color: var(--text-muted);
}
.search-autocomplete .sa-more a { color: var(--brand-1); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform .3s var(--ease), box-shadow .25s var(--ease);
}
.theme-toggle:hover { transform: rotate(18deg); box-shadow: 0 0 0 3px rgba(168,85,247,0.18); }
.theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .moon { display: block; }
[data-theme="light"] .theme-toggle .sun { display: none; }

.user-menu { position: relative; }
.user-menu .avatar {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border-strong); padding: 0; background: var(--bg-elev-2);
  cursor: pointer; overflow: visible; line-height: 0;
}
.user-menu .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.msg-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; line-height: 1; color: #fff;
  background: #ef4444; border: 2px solid var(--bg);
  border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  pointer-events: none; z-index: 2;
}
.msg-badge-lg { min-width: 22px; height: 22px; font-size: 12px; top: -7px; right: -7px; }
.av.ait-av-hero { position: relative; }
.user-dropdown {
  position: absolute; right: 0; top: 52px; min-width: 220px; padding: 8px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); display: none; flex-direction: column; gap: 2px; z-index: 120;
}
.user-menu.open .user-dropdown { display: flex; }
.user-dropdown a, .user-dropdown button {
  text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--text);
  background: none; border: none; width: 100%;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--surface); }
.user-dropdown .points { color: var(--warning); font-weight: 700; }

.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 40px; color: var(--text); }

/* =========================================================================
   4. HERO
   ========================================================================= */
.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.1; margin: 0 0 14px; font-weight: 850; letter-spacing: -.02em; }
.hero p { color: var(--text-muted); max-width: 620px; margin: 0 auto 26px; font-size: 17px; }
.hero-search { max-width: 620px; margin: 0 auto; position: relative; }
.hero-search input {
  width: 100%; padding: 16px 20px 16px 52px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-size: 16px;
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.hero-search input:focus {
  outline: none; border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(168,85,247,0.20), 0 0 40px rgba(236,72,153,0.30);
}
.hero-search .ico { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 18px; }
.hero-stats { display: flex; gap: 28px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.hero-stats .stat { text-align: center; }
.hero-stats .num { font-size: 26px; font-weight: 800; }
.hero-stats .lbl { font-size: 13px; color: var(--text-muted); }

/* =========================================================================
   5. SECTION / LAYOUT
   ========================================================================= */
.section { padding: 38px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: 24px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.section-head .link { color: var(--brand-1); font-weight: 600; font-size: 14px; }

/* filter bar + tabs + controls */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.filter-tabs { display: inline-flex; gap: 4px; position: relative; }
.filter-tabs .tab,
.filter-tabs button,
.filter-tabs a {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; background: transparent; color: var(--text-muted);
  padding: 10px 16px 10px 14px; border-radius: 10px 10px 0 0; font-size: 14px; font-weight: 700;
  transition: color .2s, background .2s, border-color .2s;
  text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -12px; padding-bottom: 22px;
}
.filter-tabs .tab:hover,
.filter-tabs button:hover,
.filter-tabs a:hover { color: var(--text); background: var(--brand-grad-soft); }
.filter-tabs .tab .tab-icon { display: inline-flex; align-items: center; color: var(--brand-1); }
.filter-tabs .tab.active .tab-icon { color: var(--brand-1); }
.filter-tabs .tab .count,
.filter-tabs button .count,
.filter-tabs a .count { font-size: 11px; opacity: .7; margin-left: 3px; font-weight: 500; }
.tabs-swipe-hint { display: none; }
.filter-tabs .tab.active,
.filter-tabs button.active,
.filter-tabs a.active { color: var(--brand-1); border-bottom-color: var(--brand-1); background: transparent; }

.filter-controls { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-control-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600;
  text-decoration: none; transition: all .2s var(--ease); cursor: pointer;
}
.filter-control-btn:hover { background: var(--bg-elev); border-color: var(--border-strong); }
.filter-control-btn.active { background: var(--brand-grad-soft); border-color: var(--brand-1); color: var(--brand-1); }
.filter-control-btn svg { flex: 0 0 16px; }

/* Apply Filters modal (popup) */
.filter-modal {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  visibility: hidden; opacity: 0; transition: opacity .25s var(--ease), visibility .25s var(--ease);
}
.filter-modal.show { visibility: visible; opacity: 1; }
.filter-modal-backdrop { position: absolute; inset: 0; background: rgba(10,6,20,0.6); backdrop-filter: blur(3px); }
.filter-modal-card {
  position: relative; width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 30px 32px; box-shadow: var(--shadow-card); transform: translateY(16px) scale(.98);
  transition: transform .28s var(--ease);
}
.filter-modal.show .filter-modal-card { transform: translateY(0) scale(1); }
.filter-modal-close {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 50%; cursor: pointer; transition: all .2s var(--ease);
}
.filter-modal-close:hover { color: var(--text); border-color: var(--border-strong); background: var(--brand-grad-soft); }
.filter-panel-head { margin-bottom: 22px; }
.filter-panel-head h3 { font-size: 24px; margin: 0 0 6px; font-weight: 800; }
.filter-panel-head p { margin: 0; color: var(--text-muted); font-size: 15px; }
.filter-group { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--border-soft); }
.filter-group:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filter-group h4 { font-size: 17px; margin: 0 0 14px; font-weight: 700; color: var(--text); }
.filter-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.filter-check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 14px; color: var(--text); font-weight: 500;
}
.filter-check input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--brand-1); cursor: pointer; flex: 0 0 18px;
}
.filter-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.filter-actions .btn { min-width: 130px; justify-content: center; }

/* list view */
.tools-list-view { grid-template-columns: 1fr !important; }
.tools-list-view .tool-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}
.tools-list-view .tool-card .tc-top { grid-column: 1 / 2; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; }
.tools-list-view .tool-card .tc-logo { width: 56px; height: 56px; }
.tools-list-view .tool-card .tc-desc { grid-column: 2 / 3; margin: 0; }
.tools-list-view .tool-card .tc-tags { grid-column: 2 / 3; margin: 0; }
.tools-list-view .tool-card .tc-meta { grid-column: 3 / 4; grid-row: 1 / 4; flex-direction: column; align-items: flex-end; gap: 6px; }
.tools-list-view .tool-card .tc-fav { margin: 0; }

/* category chips */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  transition: all .2s var(--ease);
}
.chip:hover, .chip.active { color: var(--text); border-color: var(--border-strong); background: var(--brand-grad-soft); }

/* =========================================================================
   6. TOOL CARDS  (hover float + glow border)
   ========================================================================= */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.tool-card {
  position: relative; padding: 18px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.tool-card.has-badge { padding-top: 34px; }
.tool-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--brand-grad); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity .3s var(--ease); pointer-events: none;
}
.tool-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-glow); }
.tool-card:hover::before { opacity: 1; }
.tc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tc-logo { width: 48px; height: 48px; border-radius: 13px; object-fit: cover; background: var(--bg-elev-2); display: grid; place-items: center; font-weight: 800; color: var(--brand-1); font-size: 20px; }
.tc-title { font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; }
.tc-title-wrap { flex: 1; min-width: 0; }
.tc-verified {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #4f9bff 0%, #2563eb 100%);
  color: #fff;
  flex: 0 0 22px; cursor: help; margin-left: 2px;
  box-shadow: 0 2px 8px rgba(37,99,235,.40);
  animation: tcVerifiedPulse 2.6s ease-in-out infinite;
}
.tc-verified svg { width: 13px; height: 13px; }
.tc-verified::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(37,99,235,.45);
  animation: tcVerifiedRing 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes tcVerifiedPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.10); }
}
@keyframes tcVerifiedRing {
  0% { transform: scale(.85); opacity: .7; }
  100% { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tc-verified, .tc-verified::after { animation: none; }
}
.tc-cat { font-size: 12px; color: var(--text-muted); }
.tc-fav {
  margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  transition: all .2s var(--ease);
}
.tc-fav:hover { color: var(--danger); border-color: var(--danger); }
.tc-fav.active { color: #fff; background: var(--danger); border-color: var(--danger); }
.tc-desc { font-size: 13.5px; color: var(--text-muted); margin: 0 0 14px; min-height: 42px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tc-rating { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; }
.tc-rating .stars { color: var(--star); letter-spacing: -1px; }
.tc-likes { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
.tc-visit { font-size: 13px; font-weight: 700; color: var(--brand-1); }

/* pill tag */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); white-space: nowrap;
}
.pill.grad { background: var(--brand-grad-soft); border-color: transparent; color: var(--text); }

/* badges */
.badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--radius-pill); color: #fff;
}
.badge.trending { background: linear-gradient(135deg,#f59e0b,#ef4444); }
.badge.new { background: linear-gradient(135deg,#10b981,#06b6d4); }
.badge.popular { background: var(--brand-grad); }

/* =========================================================================
   7. SINGLE TOOL PAGE
   ========================================================================= */
.tool-hero { padding: 30px 0 10px; }
.th-top { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.th-logo { width: 84px; height: 84px; border-radius: 20px; object-fit: cover; background: var(--bg-elev-2); display: grid; place-items: center; font-size: 32px; font-weight: 800; color: var(--brand-1); }
.th-info { flex: 1; min-width: 260px; }
.th-info h1 { margin: 0 0 6px; font-size: 30px; }
.th-tagline { color: var(--text-muted); font-size: 16px; margin: 0 0 12px; }
.th-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.th-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px;
  transition: all .2s var(--ease);
}
.action-btn:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.action-btn.active { color: #fff; }
.action-btn.fav.active { background: var(--danger); border-color: var(--danger); }
.action-btn.like.active { background: var(--brand-grad); border-color: transparent; }
.action-btn.cmp.active { background: var(--brand-grad); border-color: transparent; }
.action-btn .cnt { font-size: 12px; opacity: .8; }
.action-gift-ico { width: 18px; height: 18px; display: inline-block; }

.tool-body { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.panel { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 22px; }
.panel h3 { margin: 0 0 14px; font-size: 18px; }
.tool-content p { color: var(--text-muted); }
.feat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feat-list li { display: flex; gap: 10px; align-items: flex-start; }
.feat-list .ico { color: var(--success); flex-shrink: 0; }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pros-cons ul { padding-left: 18px; margin: 0; color: var(--text-muted); }
.pros-cons h4 { margin: 0 0 8px; }
.meta-side dt { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.meta-side dd { margin: 0 0 14px; font-weight: 600; }

/* reviews */
.review-form { margin-top: 8px; }
.review-form .stars-input { font-size: 24px; color: var(--text-dim); cursor: pointer; user-select: none; }
.review-form .stars-input .s { transition: color .15s; }
.review-form .stars-input .s.on { color: var(--star); }
.review-form textarea {
  width: 100%; min-height: 90px; margin: 12px 0; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); resize: vertical;
}
.review-form textarea:focus { outline: none; border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(168,85,247,0.18); }
.review { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border-soft); }
.review .av { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-elev-2); display: grid; place-items: center; font-weight: 700; color: var(--brand-1); flex-shrink: 0; }
.review .name { font-weight: 700; font-size: 14px; }
.review .rstars { color: var(--star); font-size: 13px; }
.review .rdate { font-size: 12px; color: var(--text-dim); }
.review .rtext { color: var(--text-muted); font-size: 14px; margin: 6px 0 0; }
.review .rpts { margin-left: auto; font-size: 12px; color: var(--text-dim); background: none; border: none; }
.avg-rating { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.avg-rating .big { font-size: 34px; font-weight: 800; }
.avg-rating .stars { color: var(--star); font-size: 18px; }

/* =========================================================================
   8. COMPARE BAR + PAGE
   ========================================================================= */
.compare-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(140%);
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; max-width: 92vw;
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  box-shadow: 0 20px 50px -16px rgba(0,0,0,0.6); z-index: 200; transition: transform .35s var(--ease);
}
.compare-bar.show { transform: translateX(-50%) translateY(0); }
.compare-bar .slots { display: flex; gap: 8px; }
.compare-bar .slot {
  width: 44px; height: 44px; border-radius: 12px; background: var(--bg-elev-2); display: grid; place-items: center;
  font-size: 18px; color: var(--brand-1); position: relative; border: 1px dashed var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px;
}
.compare-bar .slot.filled { border-style: solid; border-color: var(--border-strong); }
.compare-bar .slot .x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; border: 2px solid var(--bg-elev); cursor: pointer; z-index: 2; }

.compare-table { width: 100%; border-collapse: collapse; }

/* mobile compare bar */
@media (max-width: 640px) {
  .compare-bar {
    left: 14px; right: 14px; bottom: 14px;
    transform: translateY(140%) translateX(0);
    max-width: none; border-radius: 18px;
    padding: 10px 12px; gap: 10px;
  }
  .compare-bar.show { transform: translateY(0) translateX(0); }
  .compare-bar .slots { gap: 6px; }
  .compare-bar .slot { width: 36px; height: 36px; border-radius: 10px; font-size: 10px; }
  .compare-bar .slot .x { width: 16px; height: 16px; top: -5px; right: -5px; font-size: 10px; }
  .compare-bar .btn { padding: 8px 12px; font-size: 13px; }
  .compare-bar .btn-ghost {
    padding: 8px 10px; font-size: 12px; min-width: 0;
    overflow: hidden; text-indent: -999px;
  }
  .compare-bar .btn-ghost::after {
    content: '×'; display: inline-block; text-indent: 0; font-size: 16px; line-height: 1;
  }
}
.compare-table th, .compare-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.compare-table th { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.compare-table td .stars { color: var(--star); }

/* --- Send Gifts comparison cells --- */
.cmp-pop { display: inline-block; font-weight: 700; color: var(--brand-1); }
.cmp-rank { display: inline-block; margin-left: 8px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.cmp-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 10px; padding: 4px 7px; }
.cmp-badge img { width: 18px; height: 18px; }
.cmp-badge b { font-size: 13px; font-weight: 700; }
.cmp-medal-total { font-weight: 700; margin-bottom: 6px; }
.cmp-medals { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-medal { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-elev); }
.cmp-medal img { width: 22px; height: 22px; }
.cmp-medal.off { filter: grayscale(1); opacity: .4; }
.cmp-medal.on { box-shadow: 0 0 0 1px var(--brand-1); }

/* =========================================================================
   9. MEMBERSHIP / COMMUNITY
   ========================================================================= */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px; }
.tier-card { padding: 24px; border-radius: var(--radius-lg); background: var(--bg-elev); border: 1px solid var(--border-soft); text-align: center; position: relative; overflow: hidden; }
.tier-card.featured { border-color: transparent; }
.tier-card.featured::before { content:""; position:absolute; inset:0; padding:1px; background:var(--brand-grad); -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; }
.tier-card .tname { font-weight: 800; font-size: 18px; }
.tier-card .tpts { font-size: 30px; font-weight: 850; margin: 8px 0; }
.tier-card ul { list-style: none; padding: 0; margin: 14px 0 0; text-align: left; display: grid; gap: 8px; color: var(--text-muted); font-size: 14px; }
.tier-card li::before { content: "✓"; color: var(--success); margin-right: 8px; font-weight: 700; }

.points-banner { display: flex; align-items: center; gap: 18px; padding: 22px; border-radius: var(--radius-lg); background: var(--brand-grad-soft); border: 1px solid var(--border-strong); flex-wrap: wrap; }
.points-banner .pbig { font-size: 34px; font-weight: 850; color: var(--warning); }
.earn-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 14px; margin-top: 18px; }
.earn-item { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border-soft); }
.earn-item .eico { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-elev-2); display: grid; place-items: center; color: var(--brand-1); }
.earn-item .ep { color: var(--warning); font-weight: 700; }

.leaderboard { display: grid; gap: 10px; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border-soft); }
.lb-row .rank { width: 30px; text-align: center; font-weight: 800; color: var(--brand-1); }
.lb-row .av { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-elev-2); display: grid; place-items: center; font-weight: 700; color: var(--brand-1); }
.lb-row .nm { flex: 1; font-weight: 600; }
.lb-row .pts { color: var(--warning); font-weight: 800; }

/* submission form */
.submit-form { display: grid; gap: 16px; max-width: 640px; }
.submit-form label { font-weight: 600; font-size: 14px; display: grid; gap: 6px; }
.submit-form input, .submit-form textarea, .submit-form select {
  padding: 11px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
.submit-form input:focus, .submit-form textarea:focus, .submit-form select:focus { outline: none; border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(168,85,247,0.18); }

/* =========================================================================
   10. FOOTER
   ========================================================================= */
.site-footer { margin-top: 60px; border-top: 1px solid var(--border-soft); padding: 40px 0 28px; background: color-mix(in srgb, var(--bg) 90%, transparent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.footer-grid h4 { font-size: 14px; margin: 0 0 12px; }
.footer-grid a { display: block; color: var(--text-muted); font-size: 14px; padding: 4px 0; transition: color .2s; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border-soft); color: var(--text-dim); font-size: 13px; flex-wrap: wrap; }

/* =========================================================================
   11. MISC / HELPERS
   ========================================================================= */
.notice { padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 18px; font-size: 14px; }
.notice.ok { border-color: var(--success); color: var(--success); }
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.pagination { margin-top: 30px; }
.pagination ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; align-items: center; }
.pagination li { margin: 0; padding: 0; display: flex; align-items: center; }
.pagination a, .pagination span { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
.pagination a:hover { background: var(--surface-2); border-color: var(--border-strong); }
.pagination .current { background: var(--brand-grad); color: #fff; border-color: transparent; }
.pagination .prev, .pagination .next { font-size: 18px; padding: 9px 16px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--text); }

/* toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--border-strong);
  padding: 12px 18px; border-radius: var(--radius-pill); box-shadow: var(--shadow-card);
  opacity: 0; pointer-events: none; transition: all .3s var(--ease); z-index: 300; font-size: 14px; font-weight: 600;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================================
   12. NEW FEATURES: login, check-in, favorites, verified, review button
   ========================================================================= */

/* Submit form category select readability in dark/light */
.submit-form select { appearance: auto; cursor: pointer; }
.submit-form option { background: var(--bg-elev); color: var(--text); }
.submit-form option:checked { background: var(--brand-1); color: #fff; }

/* Review submit button beautification */
.review-form .form-submit { margin-top: 6px; }
.review-form .form-submit input[type="submit"],
.review-form #submit,
.review-form .submit {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill); border: none;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 30px -12px var(--glow);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
  cursor: pointer;
}
.review-form .form-submit input[type="submit"]:hover,
.review-form #submit:hover,
.review-form .submit:hover { transform: translateY(-2px); box-shadow: 0 14px 38px -10px var(--glow-pink); }
.review-form .logged-in-as { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; }
.review-form .logged-in-as a { color: var(--brand-1); font-weight: 600; }

/* Verified badge */
.verified-badge {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--success); font-size: 15px; font-weight: 700;
  position: relative; cursor: help; vertical-align: middle; margin-left: 4px;
}
.verified-badge .v-ico {
  width: 20px; height: 20px; border-radius: 50%; background: var(--success); color: #fff;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
}
.verified-badge .v-text { border-bottom: 1px dotted var(--success); }
.verified-badge .v-tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  width: max-content; max-width: 260px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text);
  font-size: 12px; font-weight: 500; box-shadow: var(--shadow-card);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; line-height: 1.5;
}
.verified-badge .v-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--border);
}
.verified-badge:hover .v-tip { opacity: 1; }

/* Membership check-in card */
.check-in-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: var(--radius); margin-bottom: 26px;
  background: var(--brand-grad-soft); border: 1px solid var(--border-strong);
}
.check-in-card .cico { width: 46px; height: 46px; border-radius: 14px; background: var(--bg-elev); display: grid; place-items: center; font-size: 22px; }
.check-in-card .ctxt { flex: 1; }
.check-in-card .cstatus { font-size: 13px; color: var(--text-muted); }
.check-in-card .btn { white-space: nowrap; }
.check-in-card .btn-checked {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none; color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 22px -8px rgba(34, 197, 94, 0.45);
  cursor: default; user-select: none; pointer-events: none;
}
.check-in-card .btn-checked::before {
  content: '✓';
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,0.22); font-size: 11px;
}
.check-in-card .btn:disabled { opacity: .6; cursor: not-allowed; }

/* Member favorites */
.favorites-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.favorites-list .tool-card { margin-bottom: 0; }
.fav-pagination { margin-top: 30px; }

/* Login page */
.login-page { display: grid; place-items: center; padding: 60px 0; }
.login-card {
  width: 100%; max-width: 420px; padding: 34px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border-soft); box-shadow: var(--shadow-card);
}
.login-card h1 { margin: 0 0 22px; font-size: 26px; text-align: center; }
.login-card .subtitle { color: var(--text-muted); font-size: 14px; text-align: center; margin-bottom: 22px; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
.login-form input[type="text"], .login-form input[type="password"], .login-form input[type="email"] {
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
.login-form input:focus { outline: none; border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(168,85,247,0.18); }
.login-form .btn { width: 100%; justify-content: center; }
.login-form .helper { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); }
.login-form .helper a:hover { color: var(--text); }
.login-card .register-link { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-muted); }
.login-card .register-link a { color: var(--brand-1); font-weight: 600; }

/* Alert (login / register / lost-password error & success) */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: 14px; font-weight: 500; line-height: 1.5; border: 1px solid transparent;
}
.alert .alert-ico { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; }
.alert .alert-ico svg { width: 18px; height: 18px; display: block; }
.alert .alert-msg { flex: 1; }
.alert .alert-msg strong { font-weight: 700; }
.alert .alert-msg a { font-weight: 600; text-decoration: underline; color: inherit; }
.alert-error { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: var(--danger); }
.alert-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); color: var(--success); }
.alert-info { background: var(--brand-grad-soft); border-color: var(--border-strong); color: var(--text); }
.login-card .error { color: var(--danger); font-size: 14px; margin-bottom: 12px; }

/* Submit a Tool promo / publish page */
.submit-hero { padding: 64px 0 40px; text-align: center; }
.submit-hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; margin: 0 0 12px; }
.submit-hero .subtitle { color: var(--text-muted); max-width: 560px; margin: 0 auto; font-size: 17px; }
.benefit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 36px 0; text-align: left; }
.benefit-card { padding: 22px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border-soft); transition: transform .25s var(--ease), border-color .25s var(--ease); }
.benefit-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.benefit-card .bico { font-size: 28px; margin-bottom: 10px; }
.benefit-card h3 { margin: 0 0 6px; font-size: 16px; }
.benefit-card p { margin: 0; color: var(--text-muted); font-size: 14px; }
.cta-card {
    max-width: 560px; margin: 10px auto 0; text-align: center; padding: 36px 30px;
    border-radius: var(--radius-lg); background: var(--brand-grad-soft); border: 1px solid var(--border-strong);
}
.cta-card h2 { font-size: 22px; }
.submit-form-wrap { max-width: 640px; margin: 30px auto 0; text-align: left; }
.login-card .error { color: var(--danger); font-size: 14px; margin-bottom: 12px; }

/* Register page — split layout (brand panel + form) */
.auth-page { padding: 56px 0; }
.auth-split {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 0; max-width: 940px;
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card);
}
.auth-aside {
  padding: 46px 40px; background: var(--brand-grad); color: #fff;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-aside .brandmark { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-aside .bm-logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); font-size: 20px;
}
.auth-aside .bm-name { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.auth-aside h2 { font-size: 30px; line-height: 1.15; margin: 0 0 10px; }
.auth-aside .lede { color: rgba(255,255,255,.86); font-size: 15px; margin: 0 0 26px; }
.auth-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-benefits li { display: flex; align-items: flex-start; gap: 11px; font-size: 15px; }
.auth-benefits .ck {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.22); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; margin-top: 1px;
}
.auth-card {
  width: 100%; max-width: none; border: none; box-shadow: none; border-radius: 0;
  align-self: center; padding: 46px 40px;
}
.auth-card .terms { text-align: center; font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }
@media (max-width: 820px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-aside { padding: 34px 28px; }
  .auth-card { padding: 34px 28px; }
}

/* =========================================================================
   12. RESPONSIVE
   ========================================================================= */
@media (max-width: 980px) {
  .tool-body { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .main-nav, .header-search { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .mobile-nav { display: none; flex-direction: column; gap: 4px; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); background: var(--bg-elev); }
  .mobile-nav.open { display: flex; }
  .mobile-nav a { padding: 10px 12px; border-radius: 10px; color: var(--text-muted); }
  .mobile-nav a:hover { background: var(--surface); color: var(--text); }
  .pros-cons { grid-template-columns: 1fr; }
}
@media (min-width: 821px) { .mobile-nav { display: none !important; } }
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 28px; }
  .th-logo { width: 64px; height: 64px; font-size: 24px; }
}

/* mobile: filter bar stacks, tabs scroll, controls stretch */
@media (max-width: 640px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 18px; }
  .section-head h2 { font-size: 20px; }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
  }
  .filter-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    gap: 8px;
    position: relative;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tabs.has-overflow::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 6px;
    width: 34px;
    background: linear-gradient(to left, var(--bg), transparent);
    pointer-events: none;
  }
  .filter-tabs .tab,
  .filter-tabs button,
  .filter-tabs a {
    flex: 0 0 auto;
    margin-bottom: 0;
    padding: 8px 12px;
    white-space: nowrap;
    border-radius: 10px;
    font-size: 13px;
  }
  .filter-tabs .tab.active,
  .filter-tabs button.active,
  .filter-tabs a.active { border-bottom-color: transparent; }
  .tabs-swipe-hint {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 4px 0;
    margin-top: -4px;
    opacity: .85;
  }
  .filter-tabs.has-overflow:not(.swiped) + .tabs-swipe-hint { display: flex; }
  .tabs-swipe-hint span { color: var(--brand-1); font-size: 12px; }
  .filter-controls { width: 100%; justify-content: space-between; gap: 8px; }
  .filter-control-btn { flex: 1 1 0; justify-content: center; padding: 8px 10px; font-size: 13px; }
  .filter-control-btn svg { width: 14px; height: 14px; }
  .chip-row { margin-bottom: 18px; gap: 8px; }
  .chip { padding: 6px 12px; font-size: 12px; }
  .tools-grid { grid-template-columns: 1fr; gap: 16px; }
  .tool-card { padding: 18px; }
  .tool-card.has-badge { padding-top: 34px; }
  .badge { top: 12px; left: 12px; font-size: 10px; padding: 3px 8px; }
  .tc-top { align-items: flex-start; gap: 10px; margin-bottom: 10px; }
  .tc-logo { width: 44px; height: 44px; border-radius: 11px; font-size: 16px; }
  .tc-title { font-size: 15px; line-height: 1.25; }
  .tc-cat { font-size: 11px; }
  .tc-fav { width: 32px; height: 32px; }
  .tc-desc { font-size: 13px; margin-bottom: 12px; min-height: auto; }
  .tc-tags { gap: 5px; margin-bottom: 12px; }
  .tc-tags .pill { padding: 3px 9px; font-size: 11px; }
  .tc-meta { flex-wrap: wrap; gap: 10px 12px; }
  .tc-rating { font-size: 12px; }
  .tc-likes { font-size: 12px; }
  .tc-visit { margin-left: auto; font-size: 13px; }
  .tools-list-view .tool-card {
    display: block;
    padding-top: 34px;
  }
  .tools-list-view .tool-card .tc-top { flex-direction: row; }
  .tools-list-view .tool-card .tc-meta { flex-direction: row; align-items: center; margin-top: 12px; }
  .filter-modal { padding: 12px; }
  .filter-modal-card { padding: 24px 18px; max-height: 90vh; }
  .filter-options { grid-template-columns: 1fr; }
  .filter-actions { flex-direction: column; }
  .filter-actions .btn { width: 100%; min-width: 0; }
}

/* ---------- Vote / gift modal ---------- */
.vote-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.vote-modal[aria-hidden="false"] { opacity: 1; pointer-events: auto; }
.vote-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }
.vote-modal-card { position: relative; width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow-glow); padding: 28px; transform: translateY(16px); transition: transform .25s var(--ease); }
.vote-modal[aria-hidden="false"] .vote-modal-card { transform: translateY(0); }
.vote-modal-close { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 18px; }
.vote-modal-title { text-align: center; font-size: 20px; margin: 0 0 18px; }
.vote-modal-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.vote-tab { flex: 1; padding: 10px; background: transparent; border: none; color: var(--text-dim); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.vote-tab.active { color: var(--brand-1); border-bottom-color: var(--brand-1); }
.vote-tab-ico { width: 20px; height: 20px; display: inline-block; }
.vote-panel { display: none; }
.vote-panel.active { display: block; }
.vote-notice { display: flex; gap: 8px; align-items: flex-start; background: rgba(251,191,36,.10); border: 1px solid rgba(251,191,36,.25); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text-dim); margin-bottom: 18px; }
.vote-notice-ico { font-size: 14px; line-height: 1; flex: 0 0 auto; }
.vote-stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.vote-stat { flex: 1; min-width: 110px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.vote-stat-icon { display: block; margin-bottom: 4px; line-height: 1; }
.vote-stat-icon .gift-ico-sm { width: 26px; height: 26px; }
.vote-stat-num { font-size: 22px; font-weight: 800; color: var(--brand-1); }
.vote-stat-label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.vote-options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.vote-option { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; transition: transform .2s, border-color .2s, box-shadow .2s; }
.vote-option:hover { border-color: var(--brand-1); box-shadow: 0 4px 14px rgba(59,130,246,.15); }
.vote-option.vote-sent { animation: voteSentFlash .9s ease; }
@keyframes voteSentFlash { 0%,100% { background: var(--surface); } 50% { background: rgba(59,130,246,.18); } }
.gift-ico { width: 100%; max-width: 96px; height: auto; margin: 0 auto; display: block; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }
.gift-ico-sm { width: 24px; height: 24px; display: inline-block; vertical-align: middle; }
.vote-option-img { margin-bottom: 8px; display: flex; justify-content: center; }
.vote-option-emoji { margin-bottom: 6px; display: flex; justify-content: center; }
.vote-option-emoji .gift-ico { max-width: 64px; }
.vote-option-qty { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.vote-option-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.vote-option-count { font-size: 12px; color: var(--brand-1); font-weight: 700; margin-bottom: 4px; }
.vote-option-cost { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
/* Single tool reputation display */
.tool-reputation .rep-section { padding: 18px 0; border-bottom: 1px solid var(--border-soft); }
.tool-reputation .rep-section:last-child { border-bottom: none; padding-bottom: 0; }
.tool-reputation .rep-title { margin: 0 0 14px; font-size: 15px; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.rep-title-icon {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 5px;
  transition: transform .2s, border-color .2s, box-shadow .2s, background .2s;
}
.rep-title-icon:hover { border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(168,85,247,.12); background: var(--surface-2); transform: translateY(-2px); }
.rep-title-icon img { width: 22px; height: 22px; object-fit: contain; }
.rep-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Send Gifts rankings block */
.tool-reputation .rep-rank-hint { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }
.rep-rank-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rep-rank-item {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  text-decoration: none; color: inherit; transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
}
.rep-rank-item:hover { border-color: var(--brand-1); box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-2px); background: var(--surface-2); }
.rep-rank-vote {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--grad-1, linear-gradient(135deg,#a855f7,#6366f1)); cursor: pointer; padding: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.rep-rank-vote img { width: 24px; height: 24px; object-fit: contain; }
.rep-rank-vote:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 0 0 3px rgba(168,85,247,.18); filter: brightness(1.05); }
.rep-rank-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.rep-rank-label { font-size: 13px; font-weight: 600; color: var(--text); }
.rep-rank-pos { display: flex; align-items: baseline; gap: 5px; }
.rep-rank-num { font-size: 18px; font-weight: 800; color: var(--text); }
.rep-rank-num.top { color: var(--brand-1); }
.rep-rank-total { font-size: 12px; color: var(--text-muted); }
.rep-rank-score { font-size: 11px; color: var(--text-muted); }
.rep-rank-arrow { flex: 0 0 auto; font-size: 20px; color: var(--text-dim); line-height: 1; }
.rep-score-card {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 76px; padding: 8px 14px; border-radius: 12px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; font-weight: 800;
  box-shadow: 0 6px 18px rgba(245,158,11,.25);
}
.rep-score-card .rep-score-num { font-size: 28px; line-height: 1; }
.rep-score-card .rep-score-label { font-size: 11px; opacity: .9; font-weight: 600; margin-top: 2px; }
.rep-score-card.rep-reputation { background: linear-gradient(135deg, #a855f7, #ec4899); box-shadow: 0 6px 18px rgba(168,85,247,.25); }
.rep-score-card.rep-popularity { background: linear-gradient(135deg, #3b82f6, #06b6d4); box-shadow: 0 6px 18px rgba(59,130,246,.25); }
.rep-score-card.rep-pop-index { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 6px 18px rgba(16,185,129,.25); }
.rep-stars { color: var(--star); font-size: 24px; letter-spacing: 1px; }
.rep-meta { font-size: 14px; color: var(--text-muted); }
.rep-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); font-weight: 700; }
.rep-badge .rep-ico { width: 22px; height: 22px; }
.rep-badge .rep-badge-num { color: var(--brand-1); }
.rep-badge .rep-badge-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.rep-like-btn { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.rep-like-btn.active { background: var(--brand-grad); border-color: transparent; }
.rep-trophy-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.rep-trophy-hint .rep-hint-ico { font-size: 16px; }
.rep-trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.rep-trophy-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 10px;
  text-align: center; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.rep-trophy-item.unlocked { border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.08); box-shadow: 0 4px 18px rgba(251,191,36,.12); }
.rep-trophy-item.unlocked .rep-trophy-name { color: var(--warning); }
.rep-trophy-item.locked { opacity: .75; }
.rep-trophy-visual { position: relative; margin-bottom: 8px; display: flex; justify-content: center; }
.rep-trophy-ico { width: 68px; height: 68px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); transition: filter .25s, opacity .25s; }
.rep-trophy-ico.is-locked { filter: grayscale(1) brightness(.6) drop-shadow(0 3px 6px rgba(0,0,0,.3)); opacity: .55; }
.rep-trophy-count { position: absolute; right: calc(50% - 44px); top: 0; background: var(--brand-1); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }
.rep-trophy-name { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.rep-trophy-status { font-size: 11px; font-weight: 700; color: var(--success); }
.rep-trophy-item.locked .rep-trophy-status { color: var(--text-dim); }

/* better centered SEND button in vote modal */
.vote-option .vote-send {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-width: 0; padding: 8px 12px; font-size: 13px; text-align: center; margin: 0 auto;
}
.vote-medal-visual { position: relative; margin-bottom: 8px; display: flex; justify-content: center; }
.gift-medal-ico { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); transition: filter .25s, opacity .25s; }
.gift-medal-ico.is-locked { filter: grayscale(1) brightness(.6) drop-shadow(0 3px 6px rgba(0,0,0,.3)); opacity: .55; }
.vote-medal-count { position: absolute; right: calc(50% - 50px); top: 0; background: var(--brand-1); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }
.vote-option.locked { opacity: .85; }
.vote-option.unlocked .gift-medal-ico { filter: drop-shadow(0 0 10px rgba(251,191,36,.6)); }
.vote-unlocked-badge { display: inline-block; font-size: 10px; font-weight: 700; color: #fff; background: var(--success); padding: 2px 8px; border-radius: 10px; margin-bottom: 8px; }
.vote-modal-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; }
.vote-balance-label { font-size: 13px; color: var(--text-muted); margin-right: 6px; }
.vote-balance-num { font-size: 18px; font-weight: 800; color: var(--brand-1); }

/* ---------- Rankings page ---------- */
/* Hero banner (gradient + podium motif, fits the leaderboard theme) */
.rankings-hero {
  position: relative; overflow: hidden;
  padding: 56px 0 44px;
  background:
    radial-gradient(900px 360px at 12% -10%, rgba(168,85,247,.55), transparent 60%),
    radial-gradient(760px 380px at 92% 0%, rgba(99,102,241,.45), transparent 62%),
    linear-gradient(135deg, #1e1140 0%, #2b1a5e 42%, #3b1d6e 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.rankings-hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(420px 220px at 80% 120%, rgba(251,191,36,.20), transparent 60%),
    radial-gradient(360px 200px at 30% 120%, rgba(56,189,248,.16), transparent 60%);
  pointer-events: none;
}
.rankings-hero-podium {
  position: absolute; right: 4%; top: 50%; transform: translateY(-50%);
  display: flex; align-items: flex-end; gap: 6px; opacity: .9; pointer-events: none;
}
.rankings-hero-podium .pod { font-size: 54px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); }
.rankings-hero-podium .pod-1 { font-size: 70px; transform: translateY(-14px); }
.rankings-hero-podium .pod-3 { font-size: 46px; transform: translateY(6px); }
.rankings-hero-inner { position: relative; z-index: 1; }
.rankings-hero-badge {
  display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 16px;
  font-size: 30px; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(251,191,36,.9), rgba(245,158,11,.8));
  box-shadow: 0 12px 30px rgba(245,158,11,.35);
}
.rankings-hero-title { font-size: 38px; margin: 0 0 10px; font-weight: 800; letter-spacing: -.5px; text-shadow: 0 4px 24px rgba(0,0,0,.35); }
.rankings-hero-sub { margin: 0 0 22px; max-width: 640px; font-size: 15px; color: rgba(255,255,255,.82); }
.rankings-hero-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.rankings-hero-stats .rhs {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px; padding: 12px 18px; min-width: 120px; backdrop-filter: blur(6px);
}
.rankings-hero-stats .rhs b { display: block; font-size: 24px; font-weight: 800; }
.rankings-hero-stats .rhs span { font-size: 12px; color: rgba(255,255,255,.72); }

.ranking-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.ranking-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; background: var(--surface); color: var(--text-dim); font-weight: 600; font-size: 14px; transition: all .2s; }
.ranking-tab:hover { color: var(--text); border-color: var(--brand-1); }
.ranking-tab.active { background: linear-gradient(135deg, var(--brand-1), var(--brand-2, #6366f1)); color: #fff; box-shadow: 0 8px 22px rgba(168,85,247,.32); }
.ranking-list { display: grid; gap: 12px; }
.ranking-item { display: flex; align-items: center; gap: 14px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 14px; padding: 14px 18px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.ranking-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: var(--brand-1); }
.ranking-item.rank-1 { border-color: rgba(251,191,36,.55); background: linear-gradient(135deg, rgba(251,191,36,.10), var(--bg-elev)); }
.ranking-item.rank-2 { border-color: rgba(203,213,225,.55); background: linear-gradient(135deg, rgba(203,213,225,.10), var(--bg-elev)); }
.ranking-item.rank-3 { border-color: rgba(217,119,6,.5);  background: linear-gradient(135deg, rgba(180,120,60,.12), var(--bg-elev)); }
.ranking-rank { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; background: var(--surface); color: var(--text-muted); flex: 0 0 38px; }
.ranking-rank.top { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 6px 16px rgba(245,158,11,.30); }
.ranking-medal { font-size: 22px; line-height: 1; }
.ranking-logo { width: 50px; height: 50px; border-radius: 12px; background: var(--bg-elev-2); display: grid; place-items: center; font-weight: 800; font-size: 20px; overflow: hidden; flex: 0 0 50px; }
.ranking-logo img { width: 100%; height: 100%; object-fit: cover; }
.ranking-info { flex: 1; min-width: 0; }
.ranking-title { font-weight: 700; font-size: 16px; }
.ranking-meta { font-size: 12px; color: var(--text-muted); }
.ranking-score { text-align: right; }
.ranking-score-ico { width: 26px; height: 26px; margin-left: auto; margin-bottom: 2px; display: block; }
.ranking-score-num { display: block; font-size: 20px; font-weight: 800; color: var(--brand-1); }
.ranking-score-label { font-size: 11px; color: var(--text-muted); }
.ranking-tab-ico { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }

/* ---------- Login required confirmation dialog ---------- */
.ait-login-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 15, 25, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 20px;
  animation: aitOverlayIn .22s ease;
}
@keyframes aitOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.ait-login-box {
  position: relative;
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 28px 26px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .05) inset;
  animation: aitBoxIn .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes aitBoxIn { from { transform: translateY(16px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.ait-login-close {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px; border: none; background: transparent;
  font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer;
  border-radius: 50%;
  transition: .15s;
}
.ait-login-close:hover { background: var(--surface-2); color: var(--text); }
.ait-login-ico {
  width: 66px; height: 66px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  box-shadow: 0 10px 28px rgba(245, 158, 11, .35), 0 0 0 4px rgba(245, 158, 11, .12);
}
.ait-login-title { margin: 0 0 10px; font-size: 20px; font-weight: 800; color: var(--text); }
.ait-login-msg { margin: 0 0 24px; font-size: 14px; line-height: 1.55; color: var(--text-muted); }
.ait-login-actions { display: flex; gap: 12px; }
.ait-login-actions .btn { flex: 1; justify-content: center; text-decoration: none; cursor: pointer; padding: 12px 16px; font-weight: 700; border-radius: 12px; }
.ait-login-cancel, .ait-login-reg { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.ait-login-cancel:hover, .ait-login-reg:hover { background: var(--border); }
.ait-login-go { color: #fff; box-shadow: 0 8px 20px rgba(139, 92, 246, .35); }
.ait-login-go:hover { box-shadow: 0 10px 24px rgba(139, 92, 246, .45); }
.ait-alert-ico {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 8px 22px rgba(239, 68, 68, .3);
  font-size: 30px;
}
.ait-alert-box .ait-login-actions { justify-content: center; }
.ait-alert-box .ait-login-actions .ait-login-go { min-width: 120px; }

.vote-balance-label .ait-login-link { color: var(--brand-1); text-decoration: underline; font-weight: 700; }
.vote-balance-label .ait-login-link:hover { color: var(--brand-2); }

@media (max-width: 640px) {
  .vote-modal-card { padding: 20px 16px; }
  .vote-modal-title { font-size: 18px; }
  .vote-tab { font-size: 13px; padding: 8px 6px; }
  .vote-stats-row { gap: 8px; }
  .vote-stat { min-width: 90px; padding: 10px; }
  .vote-stat-num { font-size: 18px; }
  .vote-options-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .vote-option { padding: 12px; }
  .vote-option-emoji { font-size: 28px; }
  .tool-reputation .rep-title { font-size: 14px; gap: 8px; }
  .rep-title-icon { width: 30px; height: 30px; padding: 4px; }
  .rep-title-icon img { width: 18px; height: 18px; }
  .rep-row { gap: 10px; }
  .rep-score-card { min-width: 68px; padding: 7px 10px; }
  .rep-score-card .rep-score-num { font-size: 22px; }
  .rep-badge { padding: 6px 10px; }
  .rep-like-btn { margin-left: 0; width: 100%; justify-content: center; }
  .ranking-item { padding: 12px; gap: 10px; }
  .ranking-logo { width: 44px; height: 44px; font-size: 16px; flex: 0 0 44px; }
  .ranking-rank { width: 32px; height: 32px; font-size: 14px; flex: 0 0 32px; }
  .rep-rank-row { grid-template-columns: 1fr; gap: 10px; }
  .rankings-hero { padding: 40px 0 30px; }
  .rankings-hero-title { font-size: 28px; }
  .rankings-hero-podium { opacity: .5; right: -2%; }
  .rankings-hero-podium .pod { font-size: 40px; }
  .rankings-hero-podium .pod-1 { font-size: 52px; }
  .rankings-hero-stats .rhs { min-width: 96px; padding: 10px 14px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .tool-card:hover { transform: none; }
}

/* ---------- Legal pages (Terms / Terms of Use / Privacy) ---------- */
.legal-page { padding: 48px 0 64px; }
.legal-hero {
  text-align: center;
  padding: 44px 24px 36px;
  border-radius: 22px;
  margin-bottom: 36px;
  background: linear-gradient(135deg, rgba(124,58,237,.16), rgba(56,189,248,.14) 55%, rgba(251,191,36,.10));
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}
.legal-hero::after {
  content: "";
  position: absolute;
  width: 320px; height: 320px;
  right: -80px; top: -120px;
  background: radial-gradient(circle, rgba(168,85,247,.35), transparent 70%);
  pointer-events: none;
}
.legal-kicker {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 10px;
}
.legal-hero h1 {
  font-size: 34px; margin: 0 0 8px;
  background: linear-gradient(120deg, #fff, #c4b5fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.legal-updated { color: var(--text-muted); font-size: 13px; margin: 0; }
.legal-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  align-items: start;
}
.legal-toc {
  position: sticky;
  top: 24px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 14px;
}
.legal-toc a {
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  padding: 6px 10px; border-radius: 8px; text-decoration: none;
  transition: background .2s, color .2s;
}
.legal-toc a:hover { background: var(--surface); color: var(--text); }
.legal-body { min-width: 0; }
.legal-section { margin-bottom: 30px; scroll-margin-top: 24px; }
.legal-section h2 {
  font-size: 20px; margin: 0 0 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-soft);
}
.legal-section p { color: var(--text-dim); line-height: 1.75; margin: 0 0 12px; }
.legal-section ul { color: var(--text-dim); line-height: 1.7; padding-left: 20px; margin: 0 0 12px; }
.legal-section li { margin-bottom: 6px; }
.legal-back-top {
  display: inline-block; margin-top: 8px;
  font-size: 13px; font-weight: 600; color: var(--brand-1); text-decoration: none;
}
.legal-back-top:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .legal-grid { grid-template-columns: 1fr; gap: 22px; }
  .legal-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .legal-toc a { flex: 1 1 auto; text-align: center; }
  .legal-hero h1 { font-size: 27px; }
}

@media (max-width: 640px) {
  .legal-page { padding: 28px 0 40px; }
  .legal-hero { padding: 30px 18px 26px; border-radius: 16px; }
  .legal-hero h1 { font-size: 22px; }
  .legal-kicker { font-size: 11px; }
  .legal-section { margin-bottom: 24px; }
  .legal-section h2 { font-size: 18px; }
  .legal-section p, .legal-section li { font-size: 14px; line-height: 1.7; }
  .legal-toc a { font-size: 12px; padding: 7px 8px; }
  .legal-back-top { font-size: 12px; }
}

@media (max-width: 480px) {
  .legal-hero { padding: 24px 14px 22px; }
  .legal-hero h1 { font-size: 19px; }
  .legal-kicker { letter-spacing: .1em; }
  .legal-toc { gap: 6px; }
  .legal-toc a { padding: 6px 6px; font-size: 11px; }
  .legal-section h2 { font-size: 17px; }
}

/* ---------- Auth forms: terms checkbox ---------- */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  cursor: pointer;
}
.terms-row input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  margin-top: 1px;
  accent-color: var(--brand-1);
  cursor: pointer;
}
.terms-row a { color: var(--brand-2); text-decoration: underline; }
.terms-row a:hover { color: var(--brand-1); }
.btn.btn-primary:disabled,
.btn.btn-primary[disabled],
.btn.btn-primary[aria-disabled="true"] {
  background: var(--text-muted);
  color: var(--surface);
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =========================================================================
   Rankings — breadcrumb + guide card (SEO rich content)
   ========================================================================= */
.ranking-breadcrumb {
  padding: 18px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}
.ranking-breadcrumb .container { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ranking-breadcrumb a { color: var(--brand-2); text-decoration: none; }
.ranking-breadcrumb a:hover { text-decoration: underline; }
.ranking-breadcrumb .sep { color: var(--text-muted); opacity: .7; }
.ranking-breadcrumb .current { color: var(--text); font-weight: 600; }

.ranking-guide {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding: 22px 24px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(109,40,217,.10), rgba(37,99,235,.10));
}
.ranking-guide-ico {
  flex: 0 0 auto;
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(109,40,217,.4));
}
.ranking-guide-body { flex: 1 1 auto; }
.ranking-guide-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.ranking-guide-body p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}
.ranking-guide-note {
  margin-bottom: 0 !important;
  padding: 12px 14px;
  border-left: 3px solid var(--brand-1);
  background: rgba(255,255,255,.04);
  border-radius: 0 10px 10px 0;
  font-size: 14px !important;
}

@media (max-width: 640px) {
  .ranking-guide { flex-direction: column; gap: 12px; padding: 18px; }
  .ranking-guide-ico { font-size: 26px; }
}

/* Admin — OG image override grid */
.ait-og-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px 18px; max-width: 760px; }
.ait-og-row { display: flex; flex-direction: column; gap: 4px; }
.ait-og-name { font-size: 13px; font-weight: 600; color: #1f2937; }

/* Rankings — FAQ section */
.ranking-faq-section { padding-top: 0; }
.ranking-faq-heading {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.ranking-faq { display: grid; gap: 12px; }
.ranking-faq-item {
  padding: 16px 20px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}
.ranking-faq-q {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-2);
}
.ranking-faq-a {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .ranking-faq-item { padding: 14px; }
  .ranking-faq-heading { font-size: 19px; }
}

/* Period switcher: All-time / This week / This month / This year */
.ranking-periods {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(124, 92, 255, .10);
  border: 1px solid rgba(124, 92, 255, .22);
}
.ranking-period {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .18s ease;
  white-space: nowrap;
}
.ranking-period:hover {
  color: var(--brand-2, #7c5cff);
  background: rgba(124, 92, 255, .08);
}
.ranking-period.active {
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #4f8cff);
  box-shadow: 0 6px 18px rgba(124, 92, 255, .35);
}
.ranking-period-cap {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .ranking-periods { width: 100%; justify-content: space-between; gap: 4px; }
  .ranking-period { flex: 1 1 auto; justify-content: center; padding: 8px 10px; font-size: 13px; }
}

/* =========================================================================
   Rankings — member leaderboards (spenders / active / earners)
   ========================================================================= */
.ranking-tab-sep {
  width: 1px;
  align-self: stretch;
  margin: 4px 10px;
  background: var(--border-soft);
}
.member-rank-item .member-avatar {
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
}
.member-rank-item .member-avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.member-tier {
  font-size: 16px;
  margin-left: 6px;
  vertical-align: middle;
}

/* =========================================================================
   Membership — points history (earn / spend ledger)
   ========================================================================= */
.ph-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.ph-filter {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  transition: all .18s ease;
}
.ph-filter:hover { color: var(--brand-2); }
.ph-filter.active {
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #4f8cff);
  border-color: transparent;
}
.points-history {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
/* Toolbar: search + type/sort filters */
.ph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 4px;
}
.ph-toolbar .ph-search {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.ph-toolbar .ph-search:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(124,92,255,.18);
}
.ph-toolbar select.ph-cat,
.ph-toolbar select.ph-sort {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.ph-toolbar .ph-apply {
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7c5cff, #4f8cff);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.ph-toolbar .ph-reset {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.ph-toolbar .ph-reset:hover { color: var(--brand-2); }

/* Hidden-entries notice + restore */
.ph-hidden-note {
  margin: 14px 0 0;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(124,92,255,.10);
  border: 1px solid rgba(124,92,255,.30);
  font-size: 13px;
  color: var(--text);
}
.ph-hidden-note .ph-restore-all {
  margin-left: 8px;
  color: var(--brand-2);
  font-weight: 600;
  text-decoration: none;
}
.ph-hidden-note .ph-restore-all:hover { text-decoration: underline; }

/* Clarifying note: hiding only affects your own view, data is kept */
.ph-hide-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Bulk action bar + per-row checkbox/hide */
.ph-bulkbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 0;
}
.ph-selectall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.ph-bulk-hide {
  padding: 7px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s ease;
}
.ph-bulk-hide:hover { border-color: var(--brand-1); color: var(--brand-2); }
.ph-row { grid-template-columns: 22px 36px 1fr auto auto 32px; }
.ph-row .ph-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--brand-1, #7c5cff); }
.ph-row .ph-hide {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all .18s ease;
  justify-self: end;
}
.ph-row .ph-hide:hover { color: #f87171; border-color: #f87171; }
.ph-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  transition: border-color .2s, transform .2s;
}
.ph-row:hover { border-color: var(--brand-1); transform: translateY(-1px); }
.ph-ico { font-size: 20px; text-align: center; }
.ph-main { min-width: 0; }
.ph-note { font-weight: 600; font-size: 14px; color: var(--text); }
.ph-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ph-amt {
  font-weight: 800;
  font-size: 16px;
  min-width: 64px;
  text-align: right;
}
.ph-amt.earn { color: #22c55e; }
.ph-amt.spend { color: #f87171; }
.ph-bal {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 72px;
  text-align: right;
  white-space: nowrap;
}
.ph-pagination { margin-top: 16px; }

@media (max-width: 560px) {
  .ranking-tab-sep { width: 100%; height: 1px; margin: 6px 0; }
  .ph-row { grid-template-columns: 18px 26px 1fr auto auto; gap: 8px; padding: 10px 12px; }
  .ph-row .ph-hide { width: 26px; height: 26px; }
  .ph-bal { grid-column: 3 / 6; text-align: left; min-width: 0; margin-top: 2px; }
  .ph-amt { min-width: 0; }
  .member-rank-item .member-avatar img { width: 48px; height: 48px; }
}

/* =========================================================================
   Local avatars (round by default everywhere)
   ========================================================================= */
.ait-avatar { border-radius: 50%; display: block; object-fit: cover; background: var(--bg-elev-2); }

/* Avatar picker (membership page + admin profile) */
.ait-avatar-picker {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg, 16px);
  padding: 22px;
  max-width: 560px;
}
.ait-avatar-picker.loading { opacity: .65; pointer-events: none; }
.ait-ap-main { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.ait-ap-preview { width: 120px; height: 120px; flex: 0 0 auto; }
.ait-ap-preview img { width: 120px; height: 120px; border-radius: 50%; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.ait-ap-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ait-ap-hint { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; max-width: 300px; }
.ait-ap-link { background: none; border: none; color: var(--brand-2); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; }

.ait-ap-cropper { margin-top: 18px; border-top: 1px solid var(--border-soft); padding-top: 18px; }
.ait-ap-stage { position: relative; margin: 0 auto; max-width: 320px; border-radius: 12px; overflow: hidden; background: #000; touch-action: none; user-select: none; }
.ait-ap-stage img { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; }
.ait-ap-sel { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); cursor: move; box-sizing: border-box; }
.ait-ap-sel::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px) 0 0/100% 33.33%,
  linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px) 0 0/33.33% 100%; }
.ait-ap-crop-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.ait-ap-zoom { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.ait-ap-zoom input { width: 160px; }
.ait-ap-crop-btns { display: flex; gap: 10px; }

.ait-ap-lib { margin-top: 18px; border-top: 1px solid var(--border-soft); padding-top: 16px; }
.ait-ap-lib-title { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.ait-ap-lib-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ait-ap-lib-item { background: none; border: 2px solid transparent; border-radius: 50%; padding: 4px; cursor: pointer; transition: border-color .15s; line-height: 0; }
.ait-ap-lib-item:hover { border-color: var(--brand-1); }
.ait-ap-lib-item img { width: 56px; height: 56px; border-radius: 50%; }

/* =========================================================================
   Author profile page
   ========================================================================= */
.author-hero { position: relative; padding-top: 0; }
.author-cover {
  height: 160px;
  background:
    radial-gradient(900px 200px at 20% -40%, rgba(124,92,255,.55), transparent 60%),
    radial-gradient(700px 220px at 90% -30%, rgba(236,72,153,.45), transparent 60%),
    linear-gradient(135deg, #1a1230, #241a3f);
}
.author-card {
  position: relative;
  margin: -56px auto 0;
  max-width: 920px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 18px 22px 10px;
  background: var(--bg);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.10);
}
[data-theme="dark"] .author-card { box-shadow: 0 20px 40px rgba(0,0,0,0.35); }
.author-avatar { align-self: start; }
.author-avatar img { width: 132px; height: 132px; border-radius: 50%; border: 4px solid var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.author-id { padding-bottom: 6px; min-width: 0; }
.author-cta { align-self: center; padding-bottom: 6px; }
.author-name { font-size: 28px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.author-handle { color: var(--text-muted); font-size: 14px; }
.author-tier { color: var(--brand-2); font-weight: 600; }
.author-bio { margin: 10px 0 0; color: var(--text-muted); max-width: 620px; }
.author-web { display: inline-block; margin-top: 8px; color: var(--brand-1); font-size: 13px; word-break: break-all; }
.author-cta { padding-bottom: 6px; }

.author-stats {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
}
.astat {
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 16px 12px; text-align: center;
}
.astat-num { display: block; font-size: 22px; font-weight: 800; }
.astat-lbl { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.author-reviews { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.arev {
  display: block; text-decoration: none; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 16px; transition: border-color .2s, transform .2s;
}
.arev:hover { border-color: var(--brand-1); transform: translateY(-2px); }
.arev-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.arev-top strong { font-size: 15px; }
.arev-stars { color: #fbbf24; letter-spacing: 1px; }
.arev-excerpt { color: var(--text-muted); font-size: 14px; margin: 8px 0; }
.arev-date { font-size: 12px; color: var(--text-muted); }

.author-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.abadge {
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 18px; text-align: center;
}
.abadge-ico { font-size: 34px; }
.abadge-t { font-weight: 700; margin-top: 6px; }
.abadge-d { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 760px) {
  .author-stats { grid-template-columns: repeat(3, 1fr); }
  .author-reviews { grid-template-columns: 1fr; }
  .author-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .author-id { text-align: center; }
  .author-name { justify-content: center; }
  .author-cta { padding-bottom: 0; }
}
@media (max-width: 520px) {
  .ait-ap-lib-grid { grid-template-columns: repeat(4, 1fr); }
  .author-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Author page: follow / like / message actions ===== */
.author-substats { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.author-substats .asub {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  padding: 5px 10px; border-radius: 999px;
}
.author-substats .asub .asub-ico {
  width: 14px; height: 14px; color: var(--brand-1);
  display: inline-flex; align-items: center; justify-content: center;
}
.author-substats .asub svg { width: 100%; height: 100%; fill: currentColor; }
.author-substats .asub b { color: var(--text); font-size: 14px; }
.author-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.author-act {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  color: var(--text); font-weight: 600; font-size: 14px;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.author-act:hover { transform: translateY(-1px); border-color: var(--brand-1); }
.author-act .aico { font-size: 15px; line-height: 1; }
.author-act.act-follow.active { background: rgba(34,197,94,.14); border-color: #22c55e; color: #22c55e; }
.author-act.act-like.active { background: rgba(244,63,94,.14); border-color: #f43f5e; color: #f43f5e; }
.author-act.act-pm { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); border: none; color: #fff; }
.author-act.act-friend.active { background: rgba(109,92,255,.16); border-color: #6d5cff; color: #6d5cff; }

/* ===== Private message modal ===== */
.ait-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,10,20,.66); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ait-modal-overlay[hidden] { display: none; }
.ait-modal {
  position: relative; width: min(460px, 100%);
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: 16px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.ait-modal h3 { margin: 0 0 14px; font-size: 18px; }
.ait-modal-close {
  position: absolute; top: 10px; right: 12px; border: none; background: none;
  color: var(--text-muted); font-size: 24px; line-height: 1; cursor: pointer;
}
.ait-modal textarea {
  width: 100%; resize: vertical; border-radius: 10px; padding: 10px 12px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border-soft);
  font: inherit;
}
.ait-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.ait-modal-status { color: var(--text-muted); font-size: 13px; margin-right: auto; }
.ait-modal-err {
  background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.4);
  color: #fda4af; border-radius: 10px; padding: 12px 14px; font-size: 14px;
}

/* ===== Membership messages inbox ===== */
.ph-badge {
  display: inline-block; margin-left: 10px; padding: 1px 9px; border-radius: 999px;
  background: #f43f5e; color: #fff; font-size: 12px; font-weight: 700; vertical-align: middle;
}
.pm-list { display: flex; flex-direction: column; gap: 12px; }
.pm-row { display: flex; gap: 12px; padding: 14px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 14px; }
.pm-avatar { flex: 0 0 auto; }
.pm-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.pm-body { flex: 1; min-width: 0; }
.pm-head { display: flex; align-items: baseline; gap: 10px; }
.pm-name { font-weight: 700; color: var(--text); }
.pm-date { font-size: 12px; color: var(--text-muted); }
.pm-text { margin: 6px 0 10px; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; }
.mbox-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.mbox-tab {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); background: var(--bg-elev); border: 1px solid var(--border);
  text-decoration: none; transition: all .15s ease;
}
.mbox-tab:hover { color: var(--text); border-color: var(--border-strong); }
.mbox-tab.active { color: #fff; background: #6d5cff; border-color: transparent; }
.mbox-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  font-size: 11px; font-weight: 700; color: #fff; background: #ef4444; border-radius: 999px;
}
.pm-row.pm-unread { border-color: #6d5cff; background: rgba(109, 92, 255, .07); }
.pm-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; display: inline-block; margin-left: 8px; vertical-align: middle; }
.pm-sys {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev-2); border: 1px solid var(--border); font-size: 20px;
}
.pm-head .pm-to { color: var(--text-muted); margin-right: 4px; font-weight: 500; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 999px; }

/* ===== Toast notifications ===== */
.ait-toast-wrap {
  position: fixed; z-index: 10010; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 10px; max-width: 340px;
  pointer-events: none;
}
.ait-toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.28);
  opacity: 0; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease;
}
.ait-toast.show { opacity: 1; transform: none; }
.ait-toast-ico {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; background: rgba(255,255,255,.22);
}
.ait-toast-success { background: linear-gradient(135deg,#16a34a,#22c55e); }
.ait-toast-error   { background: linear-gradient(135deg,#dc2626,#ef4444); }
.ait-toast-info    { background: linear-gradient(135deg,#6d5cff,#8b7bff); }

/* ===== Mailbox management ===== */
.pm-row { align-items: flex-start; }
.pm-checkwrap { flex: 0 0 auto; display: flex; align-items: center; padding-top: 2px; }
.pm-check { width: 16px; height: 16px; cursor: pointer; accent-color: #6d5cff; }
.pm-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.pm-selall { font-size: 13px; color: var(--text-muted); cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.pm-selall .pm-check { width: 14px; height: 14px; }
.pm-actions-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.pm-del {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border-soft); background: var(--bg-elev-2); color: var(--text-muted);
  font-size: 15px; line-height: 1; transition: all .15s ease;
}
.pm-del:hover { color: #ef4444; border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.1); }
.pm-list-scope .pm-row .pm-body { padding-top: 2px; }

.ait-pm-friendnote { margin-bottom: 12px; }

/* ===== Friends & Requests ===== */
.sub-h {
  font-size: 16px; font-weight: 700; margin: 22px 0 12px; color: var(--text);
}
.sub-h:first-of-type { margin-top: 4px; }
.fr-list { display: flex; flex-direction: column; gap: 10px; }
.fr-row, .friend-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--bg-elev-2); border: 1px solid var(--border-soft);
}
.fr-row .pm-avatar, .friend-card .pm-avatar { flex: 0 0 auto; }
.fr-body { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fr-body .pm-name { font-weight: 700; color: var(--text); text-decoration: none; }
.fr-body .pm-name:hover { color: var(--accent, #6d5cff); }
.fr-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.fr-pending { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.friends-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.friend-card .fr-body { flex-direction: column; align-items: flex-start; gap: 10px; }
.friend-card .fr-actions { width: 100%; }

