@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap');

:root, [data-theme="dark"] {
  --bg: #0B0D12;
  --bg-elevated: #12151C;
  --card: #161A22;
  --card-2: #1A1F2A;
  --border: #262B36;
  --border-subtle: #1E232D;
  --primary: #8B5CF6;
  --primary-2: #A78BFA;
  --primary-soft: rgba(139, 92, 246, 0.15);
  --text: #F4F5F7;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #F87171;
  --info: #60A5FA;
  --nav-h: 64px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-full: 9999px;
  --shadow: 0 8px 32px rgba(0,0,0,0.35);
  --font: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif;
  --transition: 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #F5F6F8;
  --bg-elevated: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #F9FAFB;
  --border: #E5E7EB;
  --border-subtle: #F0F1F3;
  --primary: #7C3AED;
  --primary-2: #8B5CF6;
  --primary-soft: rgba(124, 58, 237, 0.1);
  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --shadow: 0 8px 28px rgba(15,23,42,0.08);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary-2); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.container-wide { max-width: 1280px; }

/* Top nav */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(11,13,18,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .topnav { background: rgba(255,255,255,0.9); }
.topnav__inner {
  display: flex; align-items: center; gap: 1.25rem;
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.25rem;
}
.logo {
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.04em; color: var(--text);
  flex-shrink: 0;
}
.logo span { color: var(--primary-2); }
.topnav__links {
  display: flex; align-items: center; gap: 0.15rem; flex: 1;
}
.topnav__links a {
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
  padding: 0.45rem 0.85rem; border-radius: var(--radius-full);
  position: relative;
}
.topnav__links a:hover { color: var(--text); background: var(--card); }
.topnav__links a.active {
  color: var(--primary-2);
}
.topnav__links a.active::after {
  content: ''; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 0;
  height: 2px; background: var(--primary); border-radius: 2px;
}
.topnav__search {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 0.4rem 0.9rem;
  min-width: 200px; max-width: 280px; flex: 1;
}
.topnav__search input {
  background: transparent; border: none; outline: none; color: var(--text);
  font-size: 0.8125rem; width: 100%;
}
.topnav__search input::placeholder { color: var(--text-muted); }
.topnav__search kbd {
  font-size: 0.65rem; color: var(--text-muted); border: 1px solid var(--border);
  padding: 0.1rem 0.35rem; border-radius: 4px;
}
.topnav__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--text-secondary);
  cursor: pointer; position: relative; transition: all var(--transition);
}
.icon-btn:hover { color: var(--text); border-color: #3A4150; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%; border: 1.5px solid var(--bg);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); background: var(--card);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1.15rem; border-radius: var(--radius-full);
  font-weight: 600; font-size: 0.8125rem; border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #8B5CF6, #6D28D9);
  color: #fff !important; border: none;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff !important; }
.btn-secondary {
  background: var(--card); color: var(--text); border-color: var(--border);
}
.btn-secondary:hover { border-color: #3A4150; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: var(--card); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.9rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.55rem; border-radius: 6px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-price { background: rgba(248,113,113,0.15); color: #F87171; }
.badge-new { background: rgba(52,211,153,0.15); color: #34D399; }
.badge-removed { background: rgba(167,139,250,0.15); color: #A78BFA; }
.badge-updated { background: rgba(96,165,250,0.15); color: #60A5FA; }
.badge-important { background: rgba(251,191,36,0.15); color: #FBBF24; }
.badge-default { background: var(--card-2); color: var(--text-secondary); }

/* Cards neo */
.neo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: rise 0.45s ease both;
}
.neo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #323846;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Change cards grid */
.changes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.change-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  animation: rise 0.5s ease both;
  cursor: pointer;
}
.change-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(139,92,246,0.35);
}
.change-card__glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background: radial-gradient(ellipse at 100% 0%, rgba(139,92,246,0.12), transparent 55%);
}
.change-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.65rem; gap: 0.5rem; flex-wrap: wrap;
}
.change-card__brand {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
}
.change-card__time { font-size: 0.75rem; color: var(--text-muted); }
.change-card__title {
  font-size: 1rem; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 0.5rem; line-height: 1.35;
}
.change-card__summary {
  font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5;
  margin-bottom: 0.75rem;
}
.change-card__media {
  border-radius: var(--radius-sm); overflow: hidden; margin: 0.75rem 0;
  background: var(--bg-elevated); aspect-ratio: 16/10;
}
.change-card__media img { width: 100%; height: 100%; object-fit: cover; }
.change-card__price-row {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  margin: 0.75rem 0; padding: 0.65rem 0.75rem;
  background: var(--bg-elevated); border-radius: var(--radius-sm);
}
.price-old { color: var(--text-muted); text-decoration: line-through; font-size: 0.875rem; }
.price-new { font-weight: 700; font-size: 1.05rem; }
.price-pct { margin-left: auto; font-weight: 700; font-size: 0.8rem; color: var(--danger); }
.change-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.75rem; padding-top: 0.65rem; border-top: 1px solid var(--border-subtle);
}
.impact {
  font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.35rem;
}
.impact-bars { display: flex; gap: 2px; }
.impact-bars i {
  width: 4px; height: 10px; border-radius: 1px; background: var(--border);
}
.impact-bars i.on { background: var(--primary); }
.impact-high .impact-bars i.on { background: var(--danger); }
.impact-medium .impact-bars i.on { background: var(--warning); }

/* Stats strip */
.stats-strip {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem;
  margin: 1.5rem 0;
}
.stat-pill {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  animation: rise 0.4s ease both;
}
.stat-pill__label {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 600;
  display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.35rem;
}
.stat-pill__value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.stat-pill__delta { font-size: 0.7rem; color: var(--success); margin-top: 0.2rem; }

/* Filters */
.filter-row {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem;
  overflow-x: auto; padding-bottom: 0.25rem;
}
.chip {
  padding: 0.4rem 0.9rem; border-radius: var(--radius-full);
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; white-space: nowrap; transition: all var(--transition);
}
.chip:hover { color: var(--text); border-color: #3A4150; }
.chip.active {
  background: var(--primary-soft); color: var(--primary-2);
  border-color: rgba(139,92,246,0.4);
}

/* Hero home */
.home-hero {
  padding: 2.5rem 0 1rem;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 2rem; align-items: center;
}
.home-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1.15; margin-bottom: 0.85rem;
}
.home-hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #A78BFA, #C4B5FD);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.home-hero p { color: var(--text-secondary); max-width: 420px; margin-bottom: 1.25rem; }
.hero-float-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.hero-float {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem; animation: floatY 5s ease-in-out infinite;
}
.hero-float:nth-child(2) { animation-delay: 0.8s; }
.hero-float:nth-child(3) { animation-delay: 1.6s; }
.hero-float:nth-child(4) { animation-delay: 2.2s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Section */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 1.75rem 0 1rem;
}
.section-head h2 {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 0.4rem;
}

/* Trending hero banner */
.trend-banner {
  background: linear-gradient(135deg, #1a1035 0%, #12151C 50%, #0d1a2a 100%);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 1.5rem 1.75rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; margin-bottom: 1.25rem; overflow: hidden; position: relative;
}
.trend-banner h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.trend-banner .pct { color: var(--success); font-weight: 700; font-size: 1rem; }

/* Source pills row */
.source-row {
  display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1rem;
}
.source-chip {
  flex-shrink: 0; width: 100px; text-align: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem 0.5rem;
  transition: all var(--transition); cursor: pointer;
}
.source-chip:hover { border-color: var(--primary); transform: translateY(-2px); }
.source-chip img, .source-chip .ico {
  width: 36px; height: 36px; border-radius: 10px; margin: 0 auto 0.4rem;
  background: var(--bg-elevated); display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.source-chip__name { font-size: 0.75rem; font-weight: 600; }
.source-chip__meta { font-size: 0.65rem; color: var(--text-muted); }

/* Dual panels */
.dual-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem;
}
.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem;
}

/* Mobile bottom nav */
.mob-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--bg-elevated); border-top: 1px solid var(--border);
  padding: 0.45rem 0 calc(0.45rem + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.mob-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  color: var(--text-muted); font-size: 0.6rem; font-weight: 600; padding: 0.25rem 0.5rem;
}
.mob-nav a.active { color: var(--primary-2); }
.mob-nav a i { font-size: 1.15rem; }

/* Forms */
.form-input {
  width: 100%; padding: 0.65rem 0.9rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: radial-gradient(ellipse at 30% 20%, rgba(139,92,246,0.12), transparent 50%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 2rem; box-shadow: var(--shadow);
}
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; }
.alert-error { background: rgba(248,113,113,0.12); color: var(--danger); }
.alert-success { background: rgba(52,211,153,0.12); color: var(--success); }

/* Crawler toast */
.crawl-toast {
  position: fixed; bottom: 80px; right: 16px; z-index: 200;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.75rem 1rem; font-size: 0.8rem; color: var(--text-secondary);
  box-shadow: var(--shadow); display: none; align-items: center; gap: 0.5rem;
}
.crawl-toast.show { display: flex; animation: rise 0.3s ease; }
.crawl-toast .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-pad { padding: 1.5rem 0 5rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }

/* Responsive */
@media (max-width: 1024px) {
  .changes-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-strip { grid-template-columns: repeat(3, 1fr); }
  .home-hero { grid-template-columns: 1fr; }
  .hero-float-grid { max-width: 480px; }
}
@media (max-width: 768px) {
  .topnav__links { display: none; }
  .topnav__search { display: none; }
  .mob-nav { display: flex; }
  .changes-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .dual-grid { grid-template-columns: 1fr; }
  .trend-banner { flex-direction: column; text-align: center; }
  .page-pad { padding-bottom: 5.5rem; }
  .home-hero { padding-top: 1.5rem; }
}
@media (max-width: 480px) {
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-pill__value { font-size: 1.25rem; }
}

/* ===== Mockup-identical home sections ===== */
.spark {
  display: inline-block; width: 64px; height: 24px; vertical-align: middle;
}
.spark svg { width: 100%; height: 100%; }
.trend-list { list-style: none; }
.trend-list li {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border-subtle);
}
.trend-list li:last-child { border-bottom: none; }
.trend-list__rank {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--bg-elevated); font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.trend-list__name { flex: 1; font-weight: 600; font-size: 0.875rem; }
.trend-list__pct { font-size: 0.8rem; font-weight: 700; color: var(--success); min-width: 48px; text-align: right; }

.briefing-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin: 1rem 0;
}
.briefing-cell {
  background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 0.75rem;
  text-align: center;
}
.briefing-cell__n { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; }
.briefing-cell__l { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; margin-top: 0.15rem; }

.briefing-top { list-style: none; margin-top: 0.5rem; }
.briefing-top li {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0; font-size: 0.8125rem; border-bottom: 1px solid var(--border-subtle);
}
.briefing-top li:last-child { border-bottom: none; }
.briefing-top .num { color: var(--text-muted); font-weight: 700; width: 1rem; }
.tag-high { background: rgba(248,113,113,0.15); color: #F87171; font-size: 0.65rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 6px; margin-left: auto; }
.tag-med { background: rgba(251,191,36,0.15); color: #FBBF24; font-size: 0.65rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 6px; margin-left: auto; }

.brand-dot {
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.home-hero {
  padding: 2.75rem 0 0.5rem;
}
.home-hero h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); }
.live-dot {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--text-muted); margin-top: 0.85rem;
}
.live-dot i { color: var(--success); font-size: 0.55rem; animation: pulse 1.5s ease infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

.stat-pill__delta.down { color: var(--danger); }

.change-card__brand-row {
  display: flex; align-items: center; gap: 0.4rem;
}
.change-card .brand-logo {
  width: 28px; height: 28px; border-radius: 8px; object-fit: contain;
  background: #fff; padding: 2px;
}

@media (max-width: 768px) {
  .briefing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .home-hero { gap: 1.25rem; }
  .hero-float-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .hero-float { padding: 0.65rem; }
  .stats-strip { gap: 0.5rem; }
  .stat-pill { padding: 0.75rem; }
  .change-card { padding: 1rem; }
  .topnav__actions .btn-secondary { display: none; }
  .panel { padding: 1rem; }
  .trend-banner { padding: 1.15rem; }
  .trend-banner h3 { font-size: 1.2rem; }
  .source-row { gap: 0.5rem; }
  .source-chip { width: 88px; padding: 0.65rem 0.35rem; }
}

/* Brand logo tile */
.logo-tile {
  width: 40px; height: 40px; border-radius: 12px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.logo-tile img { width: 70%; height: 70%; object-fit: contain; }
.logo-tile--dark { background: #111; }
.logo-tile i { font-size: 1.15rem; }

/* Rising list (trending mockup) */
.rising-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.rising-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 0.85rem 1rem;
  transition: all var(--transition); cursor: pointer;
  animation: rise 0.4s ease both;
}
.rising-card:hover { border-color: rgba(139,92,246,0.4); transform: translateY(-2px); }
.rising-card__rank {
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted); width: 1rem;
}
.rising-card__meta { flex: 1; min-width: 0; }
.rising-card__name { font-weight: 700; font-size: 0.9rem; }
.rising-card__sub { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rising-card__pct { font-size: 0.8rem; font-weight: 700; color: var(--success); }
.rising-card__pct.down { color: var(--danger); }

/* Following list cards (full width like mockup) */
.follow-feed { display: flex; flex-direction: column; gap: 0.85rem; max-width: 820px; }
.follow-card {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.15rem 1.25rem; align-items: center;
  transition: all var(--transition); cursor: pointer;
  animation: rise 0.45s ease both;
}
.follow-card:hover { border-color: rgba(139,92,246,0.35); box-shadow: var(--shadow); }
.follow-card__media {
  width: 140px; height: 88px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #1a1035, #0d1a2a);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.follow-card__media img { width: 100%; height: 100%; object-fit: cover; }
.price-boxes {
  display: flex; gap: 0.5rem; margin: 0.65rem 0;
}
.price-box {
  background: var(--bg-elevated); border-radius: 10px; padding: 0.5rem 0.75rem; min-width: 72px;
}
.price-box .lbl { font-size: 0.65rem; color: var(--text-muted); }
.price-box .val { font-weight: 700; font-size: 1rem; }

/* Category grid mockup */
.cat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem;
}
.cat-tile {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.35rem 1.15rem; text-align: center;
  transition: all var(--transition); text-decoration: none; color: inherit;
}
.cat-tile:hover { transform: translateY(-3px); border-color: rgba(139,92,246,0.4); }
.cat-tile__icon {
  width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 0.75rem;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.cat-tile__name { font-weight: 700; font-size: 1rem; }
.cat-tile__count { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.cat-tile__pct { font-size: 0.8rem; font-weight: 700; color: var(--success); margin-top: 0.35rem; }

/* Source brand row larger */
.source-chip .logo-tile { width: 44px; height: 44px; margin: 0 auto 0.45rem; }

@media (max-width: 900px) {
  .rising-grid { grid-template-columns: 1fr; }
  .follow-card { grid-template-columns: 1fr; }
  .follow-card__media { width: 100%; height: 120px; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr; }
}
.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-visual {
  background: linear-gradient(145deg, #1a1035 0%, #0B0D12 50%, #0d1a2a 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 2.5rem; border-right: 1px solid var(--border);
}
.auth-visual__logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.04em; }
.auth-visual__logo span { color: var(--primary-2); }
.auth-visual h2 {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1.2;
  margin: 2rem 0 0.75rem;
}
.auth-visual p { color: var(--text-secondary); max-width: 360px; line-height: 1.6; }
.auth-visual__features { list-style: none; margin-top: 2rem; }
.auth-visual__features li {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0; color: var(--text-secondary); font-size: 0.9rem;
}
.auth-visual__features i {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary-2);
  display: flex; align-items: center; justify-content: center;
}
.auth-panel {
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.auth-panel .auth-card {
  width: 100%; max-width: 400px; box-shadow: none;
  background: transparent; border: none; padding: 0;
}
.auth-panel .auth-card h1 {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.35rem;
}
.auth-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem;
}
.auth-back:hover { color: var(--text); }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
.logo-tile--brand {
  background: #fff !important;
  border: 1px solid var(--border);
  padding: 3px;
}
.logo-tile--brand img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}
[data-theme="dark"] .logo-tile--brand {
  background: #f8fafc !important;
}
.ad-slot { margin: 1.25rem 0; text-align: center; }
.ad-slot__label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 0.35rem;
}
.ad-slot__box {
  background: var(--card); border: 1px dashed var(--border);
  border-radius: 12px; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.ad-slot--leaderboard .ad-slot__box { min-height: 90px; max-width: 728px; margin: 0 auto; }
.ad-slot--sidebar .ad-slot__box { min-height: 250px; }
.ad-slot--infeed .ad-slot__box { min-height: 100px; }
.ad-slot__fake { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* Mobile menu drawer */
.mob-drawer {
  display: none; position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,0.55);
}
.mob-drawer.open { display: block; }
.mob-drawer__panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(300px, 86vw);
  background: var(--bg-elevated); border-right: 1px solid var(--border);
  padding: 1.25rem; overflow-y: auto;
  animation: rise 0.25s ease;
}
.mob-drawer__panel a {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.75rem 0.5rem; color: var(--text-secondary); font-weight: 600;
  border-radius: 10px;
}
.mob-drawer__panel a:hover, .mob-drawer__panel a.active {
  background: var(--primary-soft); color: var(--primary-2);
}
.menu-toggle { display: none; }
@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  .mob-nav a { min-width: 56px; }
  .mob-nav a span { display: block; }
}

/* ========== Mobile: no horizontal scroll ========== */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
img, svg, video, iframe {
  max-width: 100%;
  height: auto;
}
.container, .container-wide, .page-pad, main {
  max-width: 100%;
  overflow-x: hidden;
}
.topnav__inner, .changes-grid, .stats-strip, .dual-grid,
.rising-grid, .cat-grid, .follow-feed, .source-row, .filter-row {
  max-width: 100%;
}

@media (max-width: 768px) {
  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .page-pad {
    padding-top: 0.85rem;
    padding-bottom: 5.5rem;
  }

  /* Nav */
  .topnav { height: 56px; }
  .topnav__inner {
    padding: 0 0.65rem;
    gap: 0.5rem;
  }
  .logo { font-size: 1rem; }
  .topnav__actions { gap: 0.35rem; }
  .topnav__actions .btn-secondary { display: none; }
  .icon-btn { width: 34px; height: 34px; }
  .avatar { width: 32px; height: 32px; }

  /* Hero */
  .home-hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem 0 0.5rem;
  }
  .home-hero h1 {
    font-size: 1.65rem;
    word-wrap: break-word;
  }
  .home-hero p { font-size: 0.9rem; }
  .hero-float-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    max-width: 100%;
  }
  .hero-float {
    padding: 0.65rem;
    min-width: 0;
  }
  .hero-float strong { font-size: 0.8rem; }
  .hero-float .text-sm { font-size: 0.7rem; }
  .hero__ctas .btn, .home-hero .btn-lg {
    width: 100%;
    justify-content: center;
  }

  /* Stats */
  .stats-strip {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .stat-pill {
    padding: 0.75rem;
    min-width: 0;
  }
  .stat-pill__value { font-size: 1.25rem; }
  .stat-pill__label { font-size: 0.65rem; }

  /* Cards grid → single column */
  .changes-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .change-card {
    padding: 1rem;
    min-width: 0;
    max-width: 100%;
  }
  .change-card__title {
    font-size: 0.95rem;
    word-break: break-word;
  }
  .change-card__summary {
    font-size: 0.8rem;
    word-break: break-word;
  }
  .change-card__head {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .change-card__brand-row {
    flex-wrap: wrap;
    min-width: 0;
  }
  .change-card__brand {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .change-card__price-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .change-card__media {
    max-width: 100%;
  }
  .change-card__media img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
  }

  /* Filters / chips scroll without page scroll */
  .filter-row, .source-row, .cat-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -0.85rem;
    margin-right: -0.85rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    max-width: calc(100% + 1.7rem);
  }
  .filter-row::-webkit-scrollbar,
  .source-row::-webkit-scrollbar { display: none; }
  .chip, .cat-pill, .source-chip {
    flex-shrink: 0;
  }

  /* Rising / following */
  .rising-grid { grid-template-columns: 1fr; }
  .rising-card {
    padding: 0.75rem;
    min-width: 0;
  }
  .rising-card__sub {
    max-width: 140px;
  }
  .follow-card {
    grid-template-columns: 1fr;
    padding: 1rem;
    min-width: 0;
  }
  .follow-card__media {
    width: 100%;
    height: 140px;
  }
  .price-boxes {
    flex-wrap: wrap;
  }
  .price-box {
    min-width: 0;
    flex: 1 1 30%;
  }

  /* Dual panels */
  .dual-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .panel { padding: 1rem; min-width: 0; }
  .briefing-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Categories */
  .cat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .cat-tile {
    padding: 1rem 0.75rem;
    min-width: 0;
  }

  /* Trend banner */
  .trend-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.15rem;
  }
  .trend-banner h3 { font-size: 1.2rem; }

  /* Detail */
  .detail-grid { grid-template-columns: 1fr; }
  .detail-price-box,
  .price-boxes { width: 100%; }
  .neo-card {
    padding: 1rem;
    min-width: 0;
    max-width: 100%;
  }

  /* Auth */
  .auth-shell { grid-template-columns: 1fr; }
  .auth-panel { padding: 1.25rem; }
  .auth-card { max-width: 100%; }

  /* Ads */
  .ad-slot__box { min-height: 60px; max-width: 100%; }
  .ad-slot--leaderboard .ad-slot__box { max-width: 100%; }

  /* Tables if any */
  table { display: block; overflow-x: auto; max-width: 100%; }

  /* Section heads */
  .section-head {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .section-head h1, .section-head h2 {
    font-size: 1.15rem;
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }
  .hero-float-grid {
    grid-template-columns: 1fr;
  }
  .cat-grid {
    grid-template-columns: 1fr;
  }
  .briefing-grid {
    grid-template-columns: 1fr 1fr;
  }
  .home-hero h1 { font-size: 1.45rem; }
  .btn-lg { width: 100%; }
  .change-card__brand { max-width: 90px; }
}

/* Prevent long URLs / unbroken strings from expanding layout */
.change-card__title,
.change-card__summary,
.neo-card,
.follow-card,
.rising-card__name,
.rising-card__sub {
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* Font lock — all screens */
html, body, button, input, select, textarea,
.btn, .chip, .neo-card, .change-card, .topnav, .mob-nav,
.auth-shell, .stat-pill, .panel, .form-input {
  font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, -apple-system, sans-serif;
}
h1, h2, h3, h4, .logo, .change-card__title, .section-head h2, .home-hero h1 {
  font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
}
.text-secondary, .change-card__summary, p, .stat-pill__label {
  font-family: 'DM Sans', 'Plus Jakarta Sans', system-ui, sans-serif;
}


@media (max-width: 768px) {
  .topnav__inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 0.4rem;
    padding: 0 0.6rem;
  }
  .menu-toggle {
    order: 1;
    flex-shrink: 0;
  }
  .topnav .logo {
    order: 2;
    flex-shrink: 0;
    margin-right: 0;
  }
  .topnav__links,
  .topnav__search {
    display: none !important;
  }
  .topnav__actions {
    order: 3;
    margin-left: auto !important;
    margin-right: 0;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
  }
  /* Keep theme + Start free on the right; hide Log in text on very small if needed */
  .topnav__actions .btn-secondary {
    display: none !important;
  }
  .topnav__actions .btn-primary {
    display: inline-flex !important;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .topnav__actions .icon-btn {
    flex-shrink: 0;
  }
}

/* BrivoxAI logo mark */
.logo {
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary-2);
}
.logo span, .auth-visual__logo span {
  background: none;
  -webkit-text-fill-color: var(--primary-2);
  color: var(--primary-2);
}
.auth-visual__logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}
