:root {
  --nfn-primary: #003580;
  --nfn-secondary: #d21034;
  --nfn-gold: #ffce00;
  --nfn-bg: #f4f6f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --pos: #10b981;
  --neu: #64748b;
  --neg: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--nfn-bg);
  color: var(--text);
  padding: 20px;
  line-height: 1.5;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
}

/* Header */
.brand-header {
  background: linear-gradient(135deg, var(--nfn-primary) 0%, #002255 100%);
  color: #ffffff;
  padding: 22px 24px;
  border-radius: 12px;
  border-bottom: 4px solid var(--nfn-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.85rem;
  opacity: 0.88;
}

.updated-badge {
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
}

/* Sections & Cards */
.section-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--nfn-primary);
  margin: 26px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* Sentiment Meter */
.sentiment-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
  margin: 12px 0;
}

.bar-pos { background: var(--pos); transition: width 0.4s ease; }
.bar-neu { background: var(--neu); transition: width 0.4s ease; }
.bar-neg { background: var(--neg); transition: width 0.4s ease; }

.sentiment-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 500;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

/* Trending Topics Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px;
}

.topic-card {
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.topic-card:hover {
  transform: translateY(-2px);
  border-left-color: var(--nfn-primary);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.topic-card.active {
  border-color: var(--nfn-primary);
  border-left: 4px solid var(--nfn-secondary);
  background: #f8faff;
}

.topic-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--nfn-primary);
  margin-bottom: 4px;
}

.topic-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.badge-hot {
  display: inline-block;
  background: var(--nfn-secondary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* Headlines & Thumbnails */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 18px;
}

.article-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.article-content {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.article-thumb {
  width: 96px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #e5e7eb;
  border: 1px solid var(--border);
}

.article-title {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.article-title:hover {
  color: var(--nfn-secondary);
}

.article-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 5px;
}

.pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-Positive { background: #d1fae5; color: #065f46; }
.pill-Neutral { background: #f1f5f9; color: #334155; }
.pill-Negative { background: #fee2e2; color: #991b1b; }

.clear-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nfn-secondary);
  background: #ffffff;
  border: 1px solid var(--nfn-secondary);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.clear-btn:hover {
  background: var(--nfn-secondary);
  color: #ffffff;
}

@media (max-width: 540px) {
  body {
    padding: 12px;
  }
  .article-thumb {
    width: 76px;
    height: 56px;
  }
}
