/* ============================================
   haoqq.com — Theme & Global Styles
   AI Tools Navigator & News
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg: #0a0a12;
  --surface: #12121e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --secondary: #a78bfa;
  --accent: #1e1e2e;
  --border: #2a2a3e;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --ff: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ff-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w: 1280px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --lh: 1.7;
  --transition: 0.2s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--text);
  line-height: var(--lh);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; display: block; }

/* --- Layout --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.site-logo:hover { opacity: 0.85; }

/* Icon mark — 4-dot neural grid */
.logo-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

/* "haoqq" text */
.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo-qq {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switcher {
  background: var(--accent);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-family: var(--ff);
  cursor: pointer;
}

.lang-switcher:hover { border-color: var(--primary); }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.25rem;
}

/* --- Hero --- */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-search {
  max-width: 540px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 0.9rem 1.25rem 0.9rem 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--ff);
  outline: none;
  transition: border-color var(--transition);
}

.hero-search input:focus { border-color: var(--primary); }

.hero-search .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* --- Category Pills --- */
.category-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.pill:hover,
.pill.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

/* --- Section --- */
.section {
  padding: 3rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* (Editor's Picks now reuses .tools-grid + .tool-card) */

/* --- Tool Card --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tool-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--accent);
  flex-shrink: 0;
}

.tool-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.tool-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tool-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-free { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.badge-freemium { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.badge-paid { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.badge-cat {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--warning);
  font-weight: 600;
}

/* --- Article Card --- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
}

.article-card:hover {
  border-color: var(--primary);
}

.article-type {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.article-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.article-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* --- Compare Table --- */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.compare-table th,
.compare-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table th {
  background: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.compare-table td {
  font-size: 0.9rem;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col h4 {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.2rem 0;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--ff);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* --- Form --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--ff);
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
}

.form-textarea { resize: vertical; min-height: 100px; }

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 1rem 0;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.4; }

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 2rem;
}

.page-btn {
  padding: 0.45rem 0.8rem;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover,
.page-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

/* --- TOC (Sticky) --- */
.toc {
  position: sticky;
  top: 5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.toc-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.toc a {
  display: block;
  color: var(--text-muted);
  padding: 0.3rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}

.toc a:hover,
.toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
}

/* --- Sponsor / Ad --- */
.sponsor-area {
  margin: 1.5rem 0;
  min-height: 90px;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none; }

/* ─── Hero Mini ─── */
.hero-mini {
  padding: 1.5rem 0 1rem;
  text-align: left;
}
.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.25rem;
}
.hero-headline h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
.hero-stats {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.hero-search-mini {
  position: relative;
  min-width: 240px;
  max-width: 320px;
  flex-shrink: 0;
}
.hero-search-mini input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--ff);
  outline: none;
  transition: border-color var(--transition);
}
.hero-search-mini input:focus { border-color: var(--primary); }
.hero-search-mini .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
/* Quick access: top tools strip */
.hero-quick {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}
.hero-quick::-webkit-scrollbar { height: 3px; }
.hero-quick::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.hero-quick-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
  font-size: 0.82rem;
}
.hero-quick-item:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
}
.hq-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--accent);
  flex-shrink: 0;
}
.hq-logo-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
}
.hq-name {
  font-weight: 600;
  font-size: 0.82rem;
}
.hq-score {
  font-size: 0.7rem;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.hq-more {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}
.hq-more .hq-logo-fb { color: var(--primary); }
.hero-mini .category-pills {
  justify-content: flex-start;
  margin-top: 0;
}

/* ─── Pulse Bar (Live Ticker) ─── */
.pulse-bar {
  display: flex;
  align-items: center;
  height: 42px;
  background: var(--accent);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.82rem;
  margin: 0 -1.5rem 0.5rem;
  padding: 0;
}
.pulse-live {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 1rem;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--error);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  animation: pulse-blink 1.5s infinite;
}
@keyframes pulse-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.pulse-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}
.pulse-scroll {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: pulse-scroll 35s linear infinite;
}
.pulse-bar:hover .pulse-scroll { animation-play-state: paused; }
@keyframes pulse-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.pulse-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.pulse-item:hover { color: var(--primary-hover); }
.pulse-time {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}
.pulse-title {
  color: inherit;
}
.pulse-sep {
  color: var(--text-muted);
  opacity: 0.3;
  padding: 0 0.5rem;
  flex-shrink: 0;
}

/* ─── Section Tight ─── */
.section-tight { padding: 2rem 0; }

/* ─── Featured Grid (Today's Hot) ─── */
.featured-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  min-height: 260px;
}
.featured-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(167, 139, 250, 0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
  overflow: hidden;
}
.featured-main:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
}
.featured-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.25rem 0.7rem;
  background: var(--error);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.featured-main h3 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.featured-main p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-time {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.featured-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.featured-side-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}
.featured-side-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.featured-side-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Trending Movers (Horizontal Scroll) ─── */
.movers-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.movers-scroll::-webkit-scrollbar { height: 4px; }
.movers-scroll::-webkit-scrollbar-track { background: transparent; }
.movers-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.mover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
  flex: 0 0 130px;
  padding: 1rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  scroll-snap-align: start;
  text-align: center;
  gap: 0.5rem;
}
.mover-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}
.mover-rank {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.mover-up { color: var(--success); font-weight: 700; margin-left: 0.25rem; }
.mover-down { color: var(--error); font-weight: 700; margin-left: 0.25rem; }
.mover-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--accent);
}
.mover-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}
.mover-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.mover-score {
  font-size: 0.72rem;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

/* ─── Homepage Compare Card ─── */
.compare-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.compare-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(99,102,241,0.12);
}
.compare-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.compare-side {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.compare-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--accent);
}
.compare-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}
.compare-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.compare-vs {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}
.compare-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.compare-metric {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.compare-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 70px;
  flex-shrink: 0;
  text-align: right;
}
.compare-bar-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bar-track {
  height: 22px;
  background: var(--accent);
  border-radius: 11px;
  overflow: hidden;
  position: relative;
}
.bar-a {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  transition: width 0.8s ease;
}
.bar-b {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  transition: width 0.8s ease;
}
.bar-a span, .bar-b span {
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
}
.compare-verdict {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

/* ─── Deal Tags ─── */
.deals-grid .tool-card { position: relative; }
.deal-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 2;
}

/* ─── Newsletter CTA ─── */
.newsletter-cta {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(167, 139, 250, 0.08));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 2rem 0;
}
.newsletter-cta h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.newsletter-cta p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.newsletter-form {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--ff);
  outline: none;
  transition: border-color var(--transition);
}
.newsletter-form input[type="email"]:focus { border-color: var(--primary); }
.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--ff);
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--primary-hover); }

/* ─── Layout Classes (replacing inline styles for responsive) ─── */

/* Tool detail page: wrap layout */
.tool-detail-wrap {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Tool detail: main column */
.tool-detail-main {
  flex: 1;
  min-width: 0;
}

/* Tools filters bar */
.tools-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* Compare page: select row */
.compare-selects {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Compare VS label */
.compare-vs {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Cross-links navigation block */
.cross-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── Ranking Items ─── */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.ranking-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.ranking-rank {
  font-weight: 700;
  min-width: 2.5rem;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.ranking-top3 {
  font-size: 1.5rem;
}

.ranking-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--accent);
}
.ranking-logo-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; min-width: 44px; min-height: 44px; justify-content: center; align-items: center; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .hero { padding: 2rem 0 1.6rem; }
  .hero h1 { font-size: 1.62rem; }
  .hero p { font-size: 0.96rem; }
  .hero-mini { padding: 0.8rem 0 0.35rem; }
  .hero-top-row { flex-direction: column; gap: 0.65rem; align-items: flex-start; }
  .hero-search-mini { min-width: 100%; max-width: 100%; }
  .hero-quick { gap: 0.5rem; }
  .hero-quick-item { padding: 0.45rem 0.72rem; }
  .hq-name { font-size: 0.78rem; }

  .tools-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }

  .section { padding: 1.6rem 0; }
  .section-tight { padding: 1.2rem 0; }
  .container { padding: 0 0.9rem; }

  .featured-grid { grid-template-columns: 1fr; min-height: auto; }
  .featured-main h3 { font-size: 1.06rem; line-height: 1.38; }
  .featured-main { padding: 1.2rem; }

  .movers-scroll { gap: 0.5rem; }
  .mover-card { min-width: 108px; padding: 0.7rem 0.45rem; }

  .compare-header { flex-direction: row; gap: 1rem; justify-content: center; }
  .compare-logo { width: 36px; height: 36px; }
  .compare-name { font-size: 0.88rem; }
  .compare-vs { font-size: 1.1rem; }
  .compare-label { width: 55px; font-size: 0.72rem; }
  .compare-bars { gap: 0.5rem; }
  .bar-track { height: 18px; }
  .bar-a span, .bar-b span { font-size: 0.6rem; padding-right: 0.3rem; }
  .compare-verdict { font-size: 0.78rem; }

  .newsletter-form { flex-direction: column; }
  .newsletter-form button { width: 100%; }
  .newsletter-cta { padding: 1.6rem 0.9rem; }

  .pulse-bar { font-size: 0.72rem; height: 36px; margin: 0 -0.9rem 0.45rem; }
  .pulse-live { padding: 0 0.45rem; font-size: 0.62rem; }
  .pulse-scroll { animation-duration: 48s; }

  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  /* Header padding: match container */
  .header-inner { padding: 0 0.9rem; }

  /* Tool detail: column layout on mobile */
  .tool-detail-wrap { flex-direction: column; }
  .tool-detail-main { min-width: 0 !important; }

  /* Tool detail: pros/cons single column */
  .pros-cons-grid { grid-template-columns: 1fr !important; }

  /* Compare page: selects stack vertically */
  .compare-selects { flex-direction: column; }
  .compare-selects select { min-width: 100% !important; flex: unset !important; }
  .compare-selects .compare-vs { padding: 0.25rem 0; }

  /* Compare table: horizontal scroll */
  .compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .compare-table { min-width: 480px; }

  /* Tools list: filters stack vertically */
  .tools-filters { flex-direction: column; }
  .tools-filters select,
  .tools-filters input { width: 100% !important; min-width: 100% !important; flex: unset !important; }

  /* Rankings list items: compact on mobile */
  .ranking-item {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  .ranking-rank { min-width: 2rem; font-size: 0.85rem; }
  .ranking-top3 { font-size: 1.15rem; }
  .ranking-logo { width: 32px; height: 32px; }
  .ranking-item .badge { font-size: 0.65rem; padding: 0.15rem 0.4rem; }
  .ranking-item .rating { font-size: 0.75rem; }

  /* Cross-links: tighter on mobile */
  .cross-links { gap: 0.4rem; }
  .cross-links .pill { font-size: 0.75rem; padding: 0.35rem 0.7rem; }

  /* Article page: flex to column, hide TOC */
  .article-layout { flex-direction: column !important; }
  .toc { display: none; }

  /* Chat panel: full-width on mobile */
  #hq-chat-panel {
    width: calc(100% - 24px) !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 78px !important;
  }

  /* Lang switcher: ensure touch-friendly size */
  .lang-switcher { min-height: 44px; min-width: 44px; padding: 0.5rem 0.6rem; font-size: 0.85rem; }

  /* Floating chat button: avoid covering content too much */
  #hq-chat-toggle { width: 50px !important; height: 50px !important; bottom: 14px !important; right: 14px !important; }

  /* Quick access scroll hint */
  .hero-quick { position: relative; }
  .hero-quick::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, var(--bg));
    pointer-events: none;
  }

  /* Pagination: touch-friendly */
  .page-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
  .footer-col h4 { font-size: 0.78rem; margin-bottom: 0.5rem; }
  .footer-col a { font-size: 0.78rem; padding: 0.15rem 0; }
  .category-pills { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.5rem; }
  .pill { white-space: nowrap; }

  .container { padding: 0 0.82rem; }
  .header-inner { padding: 0 0.82rem; }

  /* Smaller section titles on tiny screens */
  .section-title { font-size: 1.2rem !important; }
  .featured-main { padding: 1.05rem; }
  .featured-main h3 { font-size: 1rem; }
  .featured-side-card { padding: 0.9rem; }

  /* Even more compact rankings */
  .ranking-item { padding: 0.6rem 0.5rem; }
  .ranking-item .badge { display: none; }

  /* Cross-links: wrap to 2-column grid on tiny screens */
  .cross-links .pill { flex: 1 1 calc(50% - 0.25rem); text-align: center; justify-content: center; }
}

/* ─── Ad Units ─── */
.ad-unit {
  margin: 1.5rem auto;
  text-align: center;
  min-height: 90px;
  overflow: hidden;
  border-radius: 8px;
  max-width: 100%;
}
.ad-unit ins { display: block; }
/* Slightly subtle divider before/after major ad slots */
.ad-home_mid, .ad-home_bottom,
.ad-tools_top, .ad-tools_bottom,
.ad-rankings_top {
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
/* In-article ads blend more */
.ad-article_top, .ad-article_bottom,
.ad-tool_detail, .ad-tool_related {
  margin: 2rem auto;
}
/* Rankings inline ads — less disruptive */
.ad-rankings_inline {
  margin: 0.75rem 0;
}
@media (max-width: 768px) {
  .ad-unit { margin: 1rem 0; min-height: 50px; }
  .ad-home_mid, .ad-home_bottom,
  .ad-tools_top, .ad-tools_bottom,
  .ad-rankings_top { padding: 0.25rem 0; }
}

/* ─── Chat Widget Enhancements ─── */
#hq-chat-panel .chat-tool-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  margin: 3px 2px;
  background: var(--primary, #6366f1);
  color: white;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}
#hq-chat-panel .chat-tool-link:hover { opacity: 0.85; }

#hq-chat-panel .typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
}
#hq-chat-panel .typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted, #94a3b8);
  animation: typing-bounce 1.4s infinite ease-in-out;
}
#hq-chat-panel .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
#hq-chat-panel .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 4px;
}
.chat-suggestions button {
  padding: 5px 12px;
  background: var(--accent, #1e1e2e);
  color: var(--text-muted, #94a3b8);
  border: 1px solid var(--border, #2a2a3e);
  border-radius: 16px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.chat-suggestions button:hover {
  background: var(--primary, #6366f1);
  color: white;
  border-color: var(--primary, #6366f1);
}
