/*
 * GamePulse — Global Styles
 *
 * Design system:
 *   - Dark-first aesthetic targeting gaming culture
 *   - Font: Inter (body) + JetBrains Mono (data/labels)
 *   - Colour-coded source badges + entity type badges
 *   - Category chips for filtering
 *   - Deep trends: sentiment tables + source/topic heatmap
 *   - 8px spacing scale, mobile-first responsive layout
 */

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

/* ── Tokens ────────────────────────────────────────────────────── */
:root {
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --bg: #0b0d11;
  --surface: #13161c;
  --surface-raised: #1a1e27;
  --surface-hover: #212633;

  --text: #e4e6eb;
  --text-dim: #8b8f9a;
  --text-faint: #5a5e6a;

  --accent: #6d5cff;
  --accent-soft: rgba(109,92,255,0.12);

  --border: #22262f;
  --border-hover: #3a3f4d;

  --cat-industry: #6d5cff;
  --cat-pc: #e95e26;
  --cat-console: #107c10;
  --cat-entertainment: #ec4899;
  /* Backward-compatible alias for older cached category labels. */
  --cat-culture: #ec4899;
  --cat-business: #06b6d4;

  --max-w: 1200px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 9999px;

  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2.5rem;
  --sp-2xl: 4rem;
}

/* ── Base ──────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: #8577ff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,13,17,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-md) 0;
  gap: var(--sp-md);
}
.nav-logo {
  display: inline-flex; align-items: center; gap: var(--sp-sm);
  font-size: 1.1rem; font-weight: 800; color: var(--text);
  text-decoration: none; letter-spacing: -0.03em;
}
.nav-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; transform: scale(1); }
  50% { opacity:0.5; transform: scale(1.3); }
}
.nav-links { display: flex; gap: var(--sp-lg); list-style: none; }
.nav-links a {
  color: var(--text-dim); font-size: 0.85rem; font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover, .nav-links a.nav-active { color: var(--text); }
.nav-active { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero { padding: var(--sp-2xl) 0 var(--sp-xl); }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: var(--sp-xs);
}
.hero-sub { color: var(--text-dim); font-size: 1rem; max-width: 560px; }
.hero-meta {
  display: flex; align-items: center; gap: var(--sp-lg);
  margin-top: var(--sp-md);
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-faint);
}
.hero-meta .count { color: var(--accent); font-weight: 700; }

/* ── Graph badge ──────────────────────────────────────────────── */
.graph-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-faint);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.graph-badge--ok { color: #10b981; border-color: #10b981; }
.graph-badge--off { color: #ef4444; border-color: #ef4444; }

/* ── Filter bar ───────────────────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}
.filter-chip {
  padding: 0.3rem 0.75rem;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  color: var(--text-dim); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  cursor: pointer; transition: all .15s; user-select: none;
}
.filter-chip:hover { color: var(--text); border-color: var(--accent); }
.filter-chip--active { color: #fff; background: var(--accent); border-color: var(--accent); }
.filter-chip--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-style: dashed;
}
.filter-chip__count { opacity: 0.6; margin-left: 0.2rem; }

/* ── Search bar ───────────────────────────────────────────────── */
.search-bar { display: flex; gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.search-input {
  flex: 1; padding: 0.55rem 0.9rem;
  font-family: var(--font-body); font-size: 0.85rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s;
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus { border-color: var(--accent); outline: none; }

/* ── Two-column layout ────────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--sp-xl);
  align-items: start;
}
.main-grid > * {
  min-width: 0;
}
@media (max-width: 900px) { .main-grid { grid-template-columns: 1fr; } }

/* ── Article card ─────────────────────────────────────────────── */
.article-list { display: flex; flex-direction: column; gap: var(--sp-md); }
.article-card {
  display: grid; grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-lg);
  transition: border-color .15s, transform .15s;
  cursor: pointer;
}
.article-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.article-card--has-image { grid-template-columns: 1fr 140px; gap: var(--sp-lg); }
.article-card__img {
  width: 140px; height: 95px; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-raised);
}
.article-card__meta {
  display: flex; align-items: center; gap: var(--sp-sm);
  margin-bottom: var(--sp-xs); flex-wrap: wrap;
}
.article-card__title { font-size: 1rem; font-weight: 600; margin-bottom: var(--sp-xs); line-height: 1.35; }
.article-card__title a { color: var(--text); }
.article-card__title a:hover { color: var(--accent); }
.article-card__summary {
  font-size: 0.82rem; color: var(--text-dim); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.article-card__date { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-faint); }

/* ── Badges ───────────────────────────────────────────────────── */
.source-badge {
  display: inline-block; padding: 0.1rem 0.45rem;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600;
  border-radius: var(--radius-pill); border: 1px solid currentColor;
  white-space: nowrap;
}
.cat-chip {
  font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--text-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.type-badge {
  display: inline-block; padding: 0.1rem 0.4rem;
  font-family: var(--font-mono); font-size: 0.58rem; font-weight: 600;
  border-radius: var(--radius-pill); border: 1px solid currentColor;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.source-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  border: 1px solid currentColor;
}
.source-pill--ok {
  color: #10b981;
}
.source-pill--off {
  color: #ef4444;
}
.social-post-link {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.4;
  display: block;
}
.social-post-link:hover {
  color: var(--accent);
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: var(--sp-lg); }
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-lg);
}
.sidebar-card__title {
  font-family: var(--font-mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); margin-bottom: var(--sp-md);
  font-weight: 700;
  display: flex; align-items: center; gap: var(--sp-sm);
}
.sidebar-card__desc {
  font-size: 0.72rem; color: var(--text-faint);
  margin-bottom: var(--sp-md); margin-top: calc(-1 * var(--sp-sm));
}
.sidebar-icon { font-size: 0.85rem; }

/* ── Trending list ────────────────────────────────────────────── */
.trend-list { list-style: none; }
.trend-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.trend-item:last-child { border-bottom: none; }
.trend-term { font-weight: 500; text-transform: capitalize; }
.trend-count { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }
.trend-bar { height: 3px; border-radius: 2px; background: var(--accent); opacity: 0.4; margin-top: 2px; }

/* ── Surge badges ─────────────────────────────────────────────── */
.surge-badge {
  display: inline-block; padding: 0.15rem 0.5rem;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
  border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent);
}
.surge-badge.surge--new { background: rgba(16,185,129,0.15); color: #10b981; }
.surge-badge.surge--hot { background: rgba(239,68,68,0.15); color: #ef4444; }
.surge-badge-sm {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  color: var(--accent);
}

/* ── Source list ───────────────────────────────────────────────── */
.source-list { list-style: none; }
.source-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-xs) 0; font-size: 0.82rem;
  cursor: pointer; transition: color .15s;
}
.source-item:hover { color: var(--accent); }
.source-item__name { display: flex; align-items: center; gap: var(--sp-sm); }
.source-item__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.source-item__count { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }

/* ── Loading / empty states ───────────────────────────────────── */
.loading-msg, .empty-msg {
  text-align: center; padding: var(--sp-2xl);
  color: var(--text-dim); font-size: 0.9rem;
}
.loading-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
  animation: pulse-dot 1s ease-in-out infinite;
  margin-right: 4px;
}

/* ── Pagination ───────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: var(--sp-sm); margin-top: var(--sp-xl); }
.page-btn {
  padding: 0.4rem 0.9rem;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  color: var(--text-dim); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--text); }
.page-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-xl) 0; margin-top: var(--sp-2xl);
  text-align: center; color: var(--text-faint); font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   Deep Trends Page Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Trend sections ───────────────────────────────────────────── */
.trend-section {
  margin-bottom: var(--sp-2xl);
}
.trend-section__header {
  margin-bottom: var(--sp-lg);
}
.trend-section__header h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: var(--sp-sm);
  margin-bottom: var(--sp-xs);
}
.trend-section__desc {
  color: var(--text-dim); font-size: 0.85rem;
}
.section-icon { font-size: 1.1rem; color: var(--accent); }
.section-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}
.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
}
.control-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.control-select {
  min-height: 28px;
  padding: 0.2rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
}
.control-select:focus {
  border-color: var(--accent);
}

/* ── Trend table ──────────────────────────────────────────────── */
.trend-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.trend-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
.trend-table th {
  text-align: left; padding: var(--sp-sm) var(--sp-md);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--surface); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.trend-table td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.trend-table tr:last-child td { border-bottom: none; }
.trend-table tr:hover td { background: var(--surface-raised); }
.table-rank {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--text-faint); margin-right: var(--sp-sm);
  display: inline-block; width: 1.5em; text-align: right;
}
.table-term { font-weight: 500; text-transform: capitalize; }
.td-num {
  font-family: var(--font-mono); font-size: 0.8rem;
  text-align: center; color: var(--text-dim);
}
.score-bar-wrap {
  display: flex; align-items: center; gap: var(--sp-sm);
}
.score-bar {
  height: 6px; border-radius: 3px;
  background: var(--accent); opacity: 0.6;
}
.score-val {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint);
  white-space: nowrap;
}

/* ── Sentiment section ───────────────────────────────────────── */
.sentiment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}
.sentiment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sentiment-card__label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}
.sentiment-card__value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}
.sentiment-card__sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.sentiment-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sentiment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.sentiment-table th {
  text-align: left;
  padding: var(--sp-sm) var(--sp-md);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sentiment-table td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sentiment-table tr:last-child td { border-bottom: none; }
.sentiment-table tr:hover td { background: var(--surface-raised); }

.sentiment-topic-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
}
.sentiment-expand-btn {
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  cursor: pointer;
  white-space: nowrap;
}
.sentiment-expand-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}
.sentiment-details-row td,
.sentiment-details-cell {
  background: rgba(255, 255, 255, 0.015);
}
.sentiment-details-cell {
  padding: var(--sp-sm) var(--sp-md);
}
.sentiment-details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.sentiment-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.sentiment-breakdown-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}
.sentiment-breakdown-chip--all {
  color: var(--text-faint);
}
.sentiment-article-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sentiment-article-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  background: var(--surface);
}
.sentiment-article-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-sm);
}
.sentiment-article-title {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
}
.sentiment-article-title:hover {
  color: var(--accent);
}
.sentiment-article-meta {
  margin-top: 0.15rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}
.sentiment-article-summary {
  margin-top: 0.28rem;
  color: var(--text-dim);
  font-size: 0.74rem;
  line-height: 1.45;
}
.sentiment-details-empty {
  color: var(--text-faint);
  font-size: 0.76rem;
}

.sent-pos { color: #10b981; }
.sent-neg { color: #ef4444; }
.sent-mix { color: #f59e0b; }
.sent-neu { color: var(--text-dim); }

.sent-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.55rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  border: 1px solid currentColor;
}
.sent-shift {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}
.delta-up { color: #10b981; }
.delta-down { color: #ef4444; }
.delta-flat { color: var(--text-faint); }

.sentiment-method {
  margin-top: var(--sp-sm);
  padding: var(--sp-md);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}
.sentiment-method__title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 0.35rem;
}
.sentiment-method__desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.sentiment-method__thresholds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.threshold-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hover);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.02);
}
.sentiment-method__list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* ── Source coverage heatmap ───────────────────────────────────── */
.heatmap-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.heatmap-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.heatmap-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.75rem;
}
.heatmap-table th {
  padding: var(--sp-sm) var(--sp-xs);
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  color: var(--text-faint); text-transform: capitalize;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  text-align: left;
  min-width: 56px; max-width: 92px;
  height: 124px;
}
.heatmap-source {
  padding: var(--sp-xs) var(--sp-sm);
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 500;
  color: var(--text-dim); white-space: nowrap;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; left: 0; z-index: 1;
}
.heatmap-cell {
  padding: var(--sp-xs);
  text-align: center;
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  min-width: 50px;
}
.heatmap-table tr:last-child td { border-bottom: none; }
.heatmap-topic {
  border-right: 1px solid var(--border);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 var(--sp-md); }
  .nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0;
  }
  .nav-links {
    width: 100%;
    gap: 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
  }
  .nav-links li {
    display: inline-flex;
  }
  .nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding-right: 0.9rem;
    font-size: 0.78rem;
  }

  .article-card--has-image { grid-template-columns: 1fr; }
  .article-card__img { width: 100%; height: 160px; }
  .article-card {
    padding: var(--sp-md);
  }

  .hero { padding: var(--sp-xl) 0 var(--sp-lg); }
  .hero-sub {
    font-size: 0.92rem;
  }
  .hero-meta {
    gap: 0.55rem 0.9rem;
    font-size: 0.68rem;
  }

  .filter-bar {
    gap: 0.4rem;
  }
  .filter-chip {
    padding: 0.25rem 0.62rem;
    font-size: 0.66rem;
  }

  .table-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
  .control-field {
    justify-content: space-between;
    width: 100%;
    font-size: 0.62rem;
  }
  .control-select {
    flex: 1;
    min-width: 0;
    font-size: 0.68rem;
  }

  .trend-table th,
  .trend-table td,
  .sentiment-table th,
  .sentiment-table td {
    padding: 0.45rem 0.5rem;
    font-size: 0.76rem;
  }
  .table-rank {
    margin-right: 0.35rem;
  }

  .sentiment-topic-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
  .sentiment-expand-btn {
    font-size: 0.62rem;
  }
  .sentiment-details-cell {
    padding: 0.45rem 0.5rem;
  }
  .sentiment-article-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .sentiment-article-item {
    padding: 0.45rem 0.5rem;
  }
  .sentiment-article-title {
    font-size: 0.76rem;
  }
  .sentiment-article-meta {
    font-size: 0.62rem;
  }

  .sentiment-method {
    padding: 0.7rem;
  }
  .sentiment-method__desc {
    font-size: 0.74rem;
  }

  .heatmap-table th { height: 84px; max-width: 78px; }

  .pagination {
    flex-wrap: wrap;
  }
  .page-btn {
    min-height: 34px;
  }
}
