/* ---------- Home hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--s-6);
  padding: var(--s-8); border: 1px solid var(--border); border-radius: var(--r-xl);
  background: var(--panel);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 15% 0%, #000 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 15% 0%, #000 0%, transparent 65%);
}
.hero > * { position: relative; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 5px 10px; border-radius: var(--r-full); }
.hero h1 { font-size: var(--fs-4xl); letter-spacing: -0.03em; margin-top: var(--s-4); line-height: 1.08; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { color: var(--text-2); font-size: var(--fs-lg); margin-top: var(--s-3); max-width: 560px; }
.hero-search { display: flex; gap: 8px; margin-top: var(--s-6); max-width: 560px; }
.hero-search .input-icon { flex: 1; }
.hero-search .input { height: 48px; font-size: var(--fs-base); }
.hero-search .btn { height: 48px; }
.hero-cta { display: flex; gap: 10px; margin-top: var(--s-4); flex-wrap: wrap; }
.hero-stats { display: flex; gap: var(--s-6); margin-top: var(--s-6); flex-wrap: wrap; }
.hero-stats div strong { display: block; font-size: var(--fs-xl); font-weight: 800; }
.hero-stats div span { font-size: var(--fs-xs); color: var(--text-3); }
.hero-feed { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: 4px; align-self: start; }
.hero-feed-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 700; margin-bottom: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.feed-row { display: flex; gap: 10px; padding: 8px; border-radius: var(--r-sm); }
.feed-row:hover { background: var(--surface); }
.feed-row .t { font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }
.feed-row .m { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }

/* ---------- Category cards ---------- */
.cat-card { display: flex; flex-direction: column; gap: 10px; padding: var(--s-5); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); transition: border-color var(--t-fast), transform var(--t-fast); }
.cat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cat-card .top { display: flex; align-items: center; justify-content: space-between; }
.cat-card .ic { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cat-card .cnt { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.cat-card h3 { font-size: var(--fs-md); }
.cat-card p { font-size: var(--fs-sm); color: var(--text-2); }
.cat-card .go { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; margin-top: auto; }

/* ---------- Topic tiles ---------- */
.topic-tile { display: flex; align-items: center; gap: 12px; padding: var(--s-4); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); transition: border-color var(--t-fast); }
.topic-tile:hover { border-color: var(--border-strong); }
.topic-tile .ic { width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0; }
.topic-tile h3 { font-size: var(--fs-base); }
.topic-tile p { font-size: var(--fs-xs); color: var(--text-3); }
.topic-card { gap: var(--s-3); }
.topic-card .ic { width: 46px; height: 46px; border-radius: var(--r-md); display: grid; place-items: center; }

/* ---------- Discussion card ---------- */
.post-card { display: flex; gap: var(--s-4); padding: var(--s-4) var(--s-5); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); position: relative; transition: border-color var(--t-fast); }
.post-card:hover { border-color: var(--border-strong); }
.post-card .vote-col { flex-shrink: 0; position: relative; z-index: 2; }
.post-card .post-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post-card .post-title { font-size: var(--fs-md); font-weight: 700; line-height: 1.35; }
.post-card .post-title a:hover { color: var(--accent); }
.post-card .post-preview { color: var(--text-2); font-size: var(--fs-sm); }
.post-card .post-actions { display: flex; align-items: center; gap: 2px; margin-left: -10px; margin-top: 2px; position: relative; z-index: 2; flex-wrap: wrap; }
.post-list { display: flex; flex-direction: column; gap: var(--s-3); }
.type-q { color: var(--info); }
.answered { color: var(--accent); }

/* ---------- Detail pages ---------- */
.detail-head { display: flex; gap: var(--s-5); align-items: flex-start; }
.detail-head h1 { font-size: var(--fs-2xl); }
.detail-head .tagline { color: var(--text-2); font-size: var(--fs-md); margin-top: 4px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); align-items: center; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--s-6); margin-top: var(--s-6); }
.detail-section { margin-top: var(--s-8); }
.detail-section:first-child { margin-top: 0; }
.detail-section > h2 { font-size: var(--fs-lg); margin-bottom: var(--s-3); display: flex; align-items: center; gap: 8px; }
.meta-list { display: flex; flex-direction: column; }
.meta-list > div { display: flex; justify-content: space-between; gap: var(--s-3); padding: 9px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--text-3); flex-shrink: 0; }
.meta-list dd { margin: 0; text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--fs-sm); }
.feature-list li .icon { color: var(--accent); margin-top: 2px; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.shot { aspect-ratio: 16 / 10; border-radius: var(--r-md); border: 1px solid var(--border); overflow: hidden; background: var(--surface); }
.shot img, .shot svg { width: 100%; height: 100%; object-fit: cover; }
.timeline { position: relative; padding-left: var(--s-5); }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding-bottom: var(--s-4); }
.timeline li::before { content: ''; position: absolute; left: calc(-1 * var(--s-5) + 1px); top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); }
.timeline .v { font-weight: 700; font-size: var(--fs-sm); }
.timeline .when { font-size: var(--fs-xs); color: var(--text-3); margin-left: 6px; font-weight: 500; }
.timeline p { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.perm-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.perm-list li:last-child { border-bottom: 0; }
.perm-list .icon { color: var(--warning); margin-top: 2px; }

/* ---------- Topic page ---------- */
.topic-hero { display: flex; gap: var(--s-5); align-items: center; padding: var(--s-6); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); flex-wrap: wrap; }
.topic-hero .ic { width: 64px; height: 64px; border-radius: var(--r-xl); display: grid; place-items: center; }
.topic-hero .ic .icon { width: 30px; height: 30px; }
.topic-hero h1 { font-size: var(--fs-2xl); }

/* ---------- Profile ---------- */
.profile-cover { height: 140px; border-radius: var(--r-xl) var(--r-xl) 0 0; background:
  linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--panel)), var(--panel) 70%);
  border: 1px solid var(--border); border-bottom: 0; }
.profile-card { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-xl) var(--r-xl); background: var(--panel); padding: 0 var(--s-6) var(--s-6); }
.profile-top { display: flex; align-items: flex-end; gap: var(--s-4); margin-top: -48px; flex-wrap: wrap; }
.profile-top .info { flex: 1; min-width: 200px; padding-bottom: 4px; }
.profile-top h1 { font-size: var(--fs-2xl); }
.profile-links { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--text-2); }
.profile-links a { display: inline-flex; align-items: center; gap: 6px; }
.profile-links a:hover { color: var(--accent); }
.profile-stats { display: flex; gap: var(--s-6); margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--text-2); flex-wrap: wrap; }
.profile-stats strong { color: var(--text); font-size: var(--fs-md); margin-right: 4px; }
.level-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 700; }
.lvl-0 { background: var(--surface); color: var(--text-2); }
.lvl-1 { background: var(--info-soft); color: var(--info); }
.lvl-2 { background: var(--accent-soft); color: var(--accent); }
.lvl-3 { background: var(--purple-soft); color: var(--purple); }
.lvl-4 { background: var(--warning-soft); color: var(--warning); }

/* ---------- Activity ---------- */
.activity { display: flex; flex-direction: column; }
.activity li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.activity li:last-child { border-bottom: 0; }
.activity .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text-2); flex-shrink: 0; }
.activity .ic .icon { width: 15px; height: 15px; }
.activity .when { font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- Notifications ---------- */
.notif { display: flex; gap: 12px; padding: var(--s-4); border-bottom: 1px solid var(--border); align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.notif .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.notif .txt { flex: 1; font-size: var(--fs-sm); min-width: 0; }
.notif .txt a { font-weight: 600; }
.notif .txt a:hover { color: var(--accent); }
.notif .when { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }

/* ---------- Dashboard / admin ---------- */
.dash-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.dash-nav { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 2px; }
.dash-nav button { text-align: left; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.dash-nav button:hover { background: var(--surface); color: var(--text); }
.dash-nav button[aria-selected='true'] { background: var(--accent-soft); color: var(--accent); }
.dash-nav .n { margin-left: auto; font-size: 11px; color: var(--text-3); }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: var(--s-3); }
.bar-chart .bar { flex: 1; background: var(--accent-soft); border-radius: 4px 4px 0 0; position: relative; min-height: 4px; }
.bar-chart .bar > span { position: absolute; inset: auto 0 0 0; background: var(--accent); border-radius: inherit; }
.bar-labels { display: flex; gap: 6px; font-size: 10px; color: var(--text-3); margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: center; min-height: calc(100vh - var(--header-h) - 120px); }
.auth-side h1 { font-size: var(--fs-3xl); letter-spacing: -0.025em; }
.auth-side p { color: var(--text-2); font-size: var(--fs-md); margin-top: var(--s-3); }
.auth-side ul { margin-top: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3); }
.auth-side li { display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.auth-side li .icon { color: var(--accent); }
.auth-card { padding: var(--s-8); }
.auth-card h2 { font-size: var(--fs-xl); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: var(--fs-xs); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.provider-btn { justify-content: flex-start; gap: 12px; }
.provider-btn .lbl-demo { margin-left: auto; font-size: 10px; color: var(--text-3); font-weight: 500; }

/* ---------- AI hub ---------- */
.ai-hub { padding: var(--s-5); }
.ai-hub .tabs { margin-bottom: var(--s-4); }
