/* ═══════════════════════════════════════════════════
   UP Political Intelligence Platform — Style Sheet
   Light theme, high contrast, saffron + deep blue
═══════════════════════════════════════════════════ */

:root {
  --saffron: #FF6B1A;
  --saffron-light: #FFF3EC;
  --saffron-mid: #FFD9BF;
  --blue: #1A237E;
  --blue-light: #E8EAF6;
  --blue-mid: #7986CB;
  --green: #1B7A3E;
  --green-light: #E8F5E9;
  --red: #C62828;
  --red-light: #FFEBEE;
  --neutral: #546E7A;
  --neutral-light: #ECEFF1;
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface2: #F0F2F5;
  --border: #E2E5EA;
  --border-strong: #C5CAD4;
  --text-primary: #0F1520;
  --text-secondary: #3D4657;
  --text-muted: #7A8399;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ════════════════════════════════════
   HEADER
════════════════════════════════════ */
.app-header {
  background: var(--surface);
  border-bottom: 2px solid var(--saffron);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(255,107,26,0.12);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-icon { display: flex; }
.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
}
.nav-btn:hover { background: var(--saffron-light); color: var(--saffron); }
.nav-btn.active { background: var(--saffron); color: #fff; }

.header-controls { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red-light);
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(198,40,40,0.2);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.time-display {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 80px;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  white-space: nowrap;
}
.refresh-btn:hover { background: #283593; box-shadow: 0 4px 12px rgba(26,35,126,0.3); }
.refresh-btn:active { transform: scale(0.97); }
.refresh-btn.loading { opacity: 0.75; pointer-events: none; }
.refresh-btn.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ════════════════════════════════════
   STATUS BAR
════════════════════════════════════ */
.status-bar {
  background: var(--blue-light);
  border-bottom: 1px solid rgba(26,35,126,0.12);
  padding: 8px 24px;
}
.status-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
#statusText {
  font-size: 12px;
  font-weight: 500;
  color: var(--blue);
  flex: 1;
}
.progress-track {
  width: 200px;
  height: 4px;
  background: rgba(26,35,126,0.15);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--blue));
  border-radius: 99px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ════════════════════════════════════
   MAIN + SECTIONS
════════════════════════════════════ */
.app-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.section { display: none; padding-top: 24px; }
.section.active { display: block; }

/* ════════════════════════════════════
   STATS GRID
════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
#statTotal::after { background: var(--neutral); }
#statFav::after { background: var(--saffron); }
#statOpp::after { background: var(--blue); }
#statViral::after { background: var(--red); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon.orange { background: var(--saffron-light); color: var(--saffron); }
.stat-icon.saffron { background: #FFF8E1; color: #F57C00; }
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-icon.red { background: var(--red-light); color: var(--red); }

.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.5px; }

.stat-trend { font-size: 16px; font-weight: 700; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.stat-trend.neutral { color: var(--text-muted); }

/* ════════════════════════════════════
   CHARTS ROW
════════════════════════════════════ */
.charts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.chart-header h3 { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.chart-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--saffron-light);
  color: var(--saffron);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--saffron-mid);
}
.chart-wrap { position: relative; }

/* ════════════════════════════════════
   SECTION HEADERS
════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.view-all-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.view-all-btn:hover { background: var(--blue); color: #fff; }

/* ════════════════════════════════════
   NEWS GRID (top stories)
════════════════════════════════════ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.news-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--saffron); }

.news-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.news-source-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-bjp { background: #FFF3E0; color: #E65100; border: 1px solid #FFCC80; }
.badge-opposition { background: var(--blue-light); color: var(--blue); border: 1px solid #C5CAE9; }
.badge-neutral { background: var(--neutral-light); color: var(--neutral); border: 1px solid #CFD8DC; }
.badge-viral { background: var(--red-light); color: var(--red); border: 1px solid #FFCDD2; }

.traction-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
}

.news-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.news-source-name { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.news-time { font-size: 11px; color: var(--text-muted); }

.sentiment-bar-mini {
  margin: 8px 0;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}
.sentiment-fill-bjp { height: 100%; background: linear-gradient(90deg, #FF8C00, #FF6B1A); border-radius: 99px; }
.sentiment-fill-opp { height: 100%; background: linear-gradient(90deg, var(--blue-mid), var(--blue)); border-radius: 99px; }
.sentiment-fill-neutral { height: 100%; background: linear-gradient(90deg, #90A4AE, #546E7A); border-radius: 99px; }

/* ════════════════════════════════════
   DISTRICT GRID
════════════════════════════════════ */
.district-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.district-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid;
  cursor: default;
  transition: transform 0.15s;
}
.district-chip:hover { transform: scale(1.05); }
.district-hot { background: #FFF3E0; color: #BF360C; border-color: #FFCCBC; }
.district-warm { background: #FFF8E1; color: #E65100; border-color: #FFE0B2; }
.district-cool { background: var(--blue-light); color: var(--blue); border-color: #C5CAE9; }
.district-count { font-size: 10px; font-weight: 800; }

/* ════════════════════════════════════
   EMPTY STATES
════════════════════════════════════ */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.fetch-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--saffron);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.fetch-prompt-btn:hover { background: #E55A10; box-shadow: 0 4px 16px rgba(255,107,26,0.4); transform: translateY(-1px); }

/* ════════════════════════════════════
   NEWS FEED SECTION
════════════════════════════════════ */
.feed-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--text-muted);
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.search-box:focus-within { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(255,107,26,0.1); }
.search-box input { border: none; outline: none; font-size: 13px; color: var(--text-primary); background: transparent; width: 100%; font-family: inherit; }
.search-box input::placeholder { color: var(--text-muted); }

.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all 0.15s;
  font-family: inherit;
}
.pill:hover, .pill.active { background: var(--neutral); color: #fff; border-color: var(--neutral); }
.pill.saffron:hover, .pill.saffron.active { background: var(--saffron); color: #fff; border-color: var(--saffron); }
.pill.blue-pill:hover, .pill.blue-pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pill.red-pill:hover, .pill.red-pill.active { background: var(--red); color: #fff; border-color: var(--red); }
.pill.neutral-pill:hover, .pill.neutral-pill.active { background: var(--neutral); color: #fff; border-color: var(--neutral); }

.sort-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sort-controls label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.sort-controls select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  cursor: pointer;
  outline: none;
}

.feed-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.news-list-item:hover { border-color: var(--saffron); box-shadow: var(--shadow); transform: translateX(3px); }
.news-list-item.selected { border-color: var(--saffron); background: var(--saffron-light); }

.news-list-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--saffron-light);
  color: var(--saffron);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.news-list-body { flex: 1; min-width: 0; }
.news-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-list-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.news-list-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.news-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.news-list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.sentiment-score-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 7px;
}
.score-bjp { background: #FFF3E0; color: #E65100; }
.score-opp { background: var(--blue-light); color: var(--blue); }
.score-neutral { background: var(--neutral-light); color: var(--neutral); }

.traction-score {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ════════════════════════════════════
   NEWS DETAIL PANEL
════════════════════════════════════ */
.news-detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 80px;
  box-shadow: var(--shadow);
  min-height: 400px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.detail-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 300px; gap: 12px; }
.detail-placeholder p { color: var(--text-muted); font-size: 13px; }

.detail-source { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.detail-title { font-size: 16px; font-weight: 800; color: var(--text-primary); line-height: 1.4; margin-bottom: 12px; }
.detail-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }

.detail-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; margin-top: 16px; }

.sentiment-meter {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.meter-labels { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; margin-bottom: 6px; }
.meter-label-bjp { color: var(--saffron); }
.meter-label-opp { color: var(--blue); }
.meter-track {
  height: 10px;
  background: linear-gradient(90deg, var(--saffron-light), var(--blue-light));
  border-radius: 99px;
  border: 1px solid var(--border);
  position: relative;
  overflow: visible;
}
.meter-needle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--text-primary);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.traction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}
.traction-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.traction-item .t-val { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.traction-item .t-lbl { font-size: 10px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

.district-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.district-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 4px;
}

.detail-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.detail-action-btn {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  font-family: inherit;
  transition: all 0.15s;
  text-align: center;
}
.btn-action { background: var(--saffron-light); color: var(--saffron); border-color: var(--saffron-mid); }
.btn-action:hover { background: var(--saffron); color: #fff; }
.btn-narrative { background: var(--blue-light); color: var(--blue); border-color: #C5CAE9; }
.btn-narrative:hover { background: var(--blue); color: #fff; }

/* ════════════════════════════════════
   ACTION PLAN SECTION
════════════════════════════════════ */
.action-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.action-header-card, .narrative-header-card {
  background: linear-gradient(135deg, var(--saffron-light), #fff);
  border: 1px solid var(--saffron-mid);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.action-header-card h2, .narrative-header-card h2 { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.action-header-card p, .narrative-header-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.action-config, .narrative-config {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.config-group { margin-bottom: 16px; }
.config-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.radio-group { display: flex; flex-direction: column; gap: 6px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.radio-option:hover { background: var(--saffron-light); }
.radio-option input { accent-color: var(--saffron); }

.config-select, .config-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}
.config-select:focus, .config-input:focus { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(255,107,26,0.1); }
.config-input::placeholder { color: var(--text-muted); }

.generate-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--saffron), #E55A10);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  box-shadow: 0 4px 12px rgba(255,107,26,0.3);
}
.generate-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,107,26,0.4); }
.generate-btn:active { transform: translateY(0); }
.generate-btn.green-btn {
  background: linear-gradient(135deg, #2E7D32, #1B5E20);
  box-shadow: 0 4px 12px rgba(27,122,62,0.3);
}
.generate-btn.green-btn:hover { box-shadow: 0 6px 20px rgba(27,122,62,0.4); }
.generate-btn.loading { opacity: 0.7; pointer-events: none; }

.priority-stories, .trending-topics {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.priority-stories h3, .trending-topics h3 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }

.priority-story-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.priority-story-item:last-child { border-bottom: none; }
.priority-num {
  width: 22px;
  height: 22px;
  background: var(--saffron);
  color: #fff;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.priority-title { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.priority-score { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.action-plan-output, .narrative-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 500px;
  box-shadow: var(--shadow);
}

.plan-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Plan Output Styling */
.plan-output-inner h1 { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--saffron); }
.plan-output-inner h2 { font-size: 14px; font-weight: 800; color: var(--blue); margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.plan-output-inner h3 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin: 12px 0 6px; }
.plan-output-inner p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
.plan-output-inner ul, .plan-output-inner ol { padding-left: 20px; margin-bottom: 10px; }
.plan-output-inner li { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 4px; }
.plan-output-inner strong { color: var(--text-primary); }
.plan-output-inner hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.action-box {
  border: 1.5px solid;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
}
.action-box.urgent { background: var(--red-light); border-color: #FFCDD2; }
.action-box.important { background: #FFF8E1; border-color: #FFE082; }
.action-box.normal { background: var(--green-light); border-color: #C8E6C9; }
.action-box-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.action-box.urgent .action-box-title { color: var(--red); }
.action-box.important .action-box-title { color: #E65100; }
.action-box.normal .action-box-title { color: var(--green); }

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.copy-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ════════════════════════════════════
   NARRATIVE SECTION
════════════════════════════════════ */
.narrative-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.topic-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: default;
  border: 1px solid;
}
.topic-tag.placeholder { background: var(--bg); color: var(--text-muted); border-color: var(--border); }
.topic-tag.tag-hot { background: #FFF3E0; color: #BF360C; border-color: #FFCCBC; }
.topic-tag.tag-warm { background: #FFF8E1; color: #E65100; border-color: #FFE0B2; }
.topic-tag.tag-cool { background: var(--blue-light); color: var(--blue); border-color: #C5CAE9; }
.topic-tag.tag-bjp { background: #FFF3E0; color: #E65100; border-color: #FFCC80; font-weight: 700; }
.topic-tag.tag-opp { background: var(--blue-light); color: var(--blue); border-color: #C5CAE9; }

.narrative-right { display: flex; flex-direction: column; gap: 16px; }
.narrative-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.narrative-history h3 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.muted-text { font-size: 12px; color: var(--text-muted); }

.narrative-history-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.narrative-history-item:last-child { border-bottom: none; }
.nh-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.nh-preview { font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }

/* ════════════════════════════════════
   MODAL
════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--red-light); color: var(--red); border-color: #FFCDD2; }

/* ════════════════════════════════════
   TOAST NOTIFICATIONS
════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--text-primary);
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: toastIn 0.3s ease;
  max-width: 360px;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(30px); } }
.toast.out { animation: toastOut 0.3s ease forwards; }

/* ════════════════════════════════════
   INTENT BAR
════════════════════════════════════ */
.intent-bar {
  background: #FFFBF5;
  border-bottom: 1.5px solid #FFE0B2;
  padding: 8px 24px;
}
.intent-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.intent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.intent-row2 {
  padding-top: 5px;
  border-top: 1px dashed #FFE0B2;
}
.intent-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 90px;
}
.intent-chips { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

.intent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  font-family: inherit;
  transition: all 0.18s ease;
  white-space: nowrap;
  background: var(--surface);
}
.intent-chip:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.12); }

/* BJP Favorable */
.chip-bjp { border-color: #FFCC80; color: #E65100; background: #FFF8F0; }
.chip-bjp.active { background: var(--saffron); color: #fff; border-color: var(--saffron); box-shadow: 0 3px 10px rgba(255,107,26,0.35); }

/* Attack Opposition */
.chip-attack { border-color: #C8E6C9; color: #2E7D32; background: #F1F8E9; }
.chip-attack.active { background: #2E7D32; color: #fff; border-color: #2E7D32; box-shadow: 0 3px 10px rgba(46,125,50,0.3); }

/* Counter Opposition */
.chip-counter { border-color: #B3E5FC; color: #0277BD; background: #E1F5FE; }
.chip-counter.active { background: #0277BD; color: #fff; border-color: #0277BD; box-shadow: 0 3px 10px rgba(2,119,189,0.3); }

/* Viral */
.chip-viral { border-color: #FFCDD2; color: var(--red); background: var(--red-light); }
.chip-viral.active { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 3px 10px rgba(198,40,40,0.3); }

/* Hyper Local */
.chip-local { border-color: #E1BEE7; color: #6A1B9A; background: #F3E5F5; }
.chip-local.active { background: #6A1B9A; color: #fff; border-color: #6A1B9A; box-shadow: 0 3px 10px rgba(106,27,154,0.3); }

/* ════ TIMEFRAME SELECT DROPDOWN ════ */
.timeframe-select {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #C5CAE9;
  background: var(--surface);
  color: var(--blue);
  font-family: inherit;
  transition: all 0.15s;
  outline: none;
  height: 32px;
  min-width: 185px;
}
.timeframe-select:focus,
.timeframe-select:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,35,126,0.1); }

/* ════ INTENT FETCH BUTTON (orange, in row2) ════ */
.intent-fetch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 32px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, var(--saffron), #E05A00);
  color: #fff;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(255,107,26,0.35);
}
.intent-fetch-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255,107,26,0.45); }
.intent-fetch-btn:active { transform: translateY(0); }

/* ════ LOAD MORE BUTTON ════ */
.fetch-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 13px;
  height: 32px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #C5CAE9;
  background: var(--blue-light);
  color: var(--blue);
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.fetch-more-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.fetch-more-btn:disabled { opacity: 0.5; cursor: wait; }

.intent-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  font-style: italic;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}


/* ════════════════════════════════════
   NARRATIVE TOOLBAR + PDF BUTTON
════════════════════════════════════ */
.narrative-output-header { display: flex; flex-direction: column; height: 100%; }
.narrative-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #C5CAE9;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  transition: all 0.15s;
}
.pdf-btn:hover { background: #0D1B6E; box-shadow: 0 4px 12px rgba(26,35,126,0.3); transform: translateY(-1px); }


/* ════════════════════════════════════
   DATE / TIME DISPLAY
════════════════════════════════════ */
.news-time-full {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.news-datetime {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.detail-datetime {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid #C5CAE9;
  border-radius: 6px;
  padding: 5px 10px;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-meta-left { display: flex; flex-direction: column; gap: 2px; }

/* ════════════════════════════════════
   LINK BUTTONS & TITLE LINKS
════════════════════════════════════ */
.card-title-link {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  line-height: inherit;
  display: block;
}
.card-title-link:hover { color: var(--saffron); text-decoration: underline; }

.card-read-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--saffron);
  text-decoration: none;
  background: var(--saffron-light);
  border: 1px solid var(--saffron-mid);
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.card-read-link:hover { background: var(--saffron); color: #fff; }

.news-title-link {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}
.news-title-link:hover { color: var(--blue); text-decoration: underline; }

.read-link-btn {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  background: var(--blue-light);
  border: 1px solid #C5CAE9;
  border-radius: 6px;
  padding: 5px 10px;
  transition: all 0.15s;
  white-space: nowrap;
  text-align: center;
}
.read-link-btn:hover { background: var(--blue); color: #fff; }
.read-link-btn.disabled { color: var(--text-muted); background: var(--surface2); border-color: var(--border); cursor: default; }

.detail-title-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: inherit;
  line-height: inherit;
}
.detail-title-link:hover { color: var(--blue); text-decoration: underline; }

/* ════════════════════════════════════
   NEW PILL VARIANTS
════════════════════════════════════ */
.pill.green-pill:hover, .pill.green-pill.active { background: #2E7D32; color: #fff; border-color: #2E7D32; }
.pill.purple-pill:hover, .pill.purple-pill.active { background: #6A1B9A; color: #fff; border-color: #6A1B9A; }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .feed-layout { grid-template-columns: 1fr; }
  .action-layout, .narrative-layout { grid-template-columns: 1fr; }
  .news-detail-panel { position: static; }
  .charts-row { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .news-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app-main { padding: 0 12px 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .header-inner { padding: 0 12px; gap: 10px; }
  .brand-sub { display: none; }
}

/* ════════════════════════════════════
   INTELLIGENCE COMMAND PANEL (Dashboard top)
════════════════════════════════════ */
.command-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #FFF8F0 0%, #FFF3E8 50%, #F5F8FF 100%);
  border: 1.5px solid #FFD9A8;
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px rgba(255,107,26,0.08);
  flex-wrap: wrap;
}

.command-panel-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.command-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--saffron);
}

.command-intents {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Command panel chips — match intent bar chips but bigger */
.cmd-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid;
  font-family: inherit;
  transition: all 0.18s ease;
  white-space: nowrap;
  background: white;
}
.cmd-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.cmd-chip.cmd-bjp  { border-color: #FFCC80; color: #E65100; }
.cmd-chip.cmd-bjp.active  { background: var(--saffron); color: #fff; border-color: var(--saffron); box-shadow: 0 3px 12px rgba(255,107,26,0.40); }
.cmd-chip.cmd-attack { border-color: #A5D6A7; color: #2E7D32; }
.cmd-chip.cmd-attack.active { background: #2E7D32; color: #fff; border-color: #2E7D32; box-shadow: 0 3px 12px rgba(46,125,50,0.35); }
.cmd-chip.cmd-counter { border-color: #90CAF9; color: #0277BD; }
.cmd-chip.cmd-counter.active { background: #0277BD; color: #fff; border-color: #0277BD; box-shadow: 0 3px 12px rgba(2,119,189,0.35); }
.cmd-chip.cmd-viral { border-color: #EF9A9A; color: #C62828; }
.cmd-chip.cmd-viral.active { background: #C62828; color: #fff; border-color: #C62828; box-shadow: 0 3px 12px rgba(198,40,40,0.35); }
.cmd-chip.cmd-local { border-color: #CE93D8; color: #6A1B9A; }
.cmd-chip.cmd-local.active { background: #6A1B9A; color: #fff; border-color: #6A1B9A; box-shadow: 0 3px 12px rgba(106,27,154,0.35); }

/* Right side: timeframe + buttons */
.command-panel-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cmd-timeframe {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #C5CAE9;
  background: white;
  color: var(--blue);
  font-family: inherit;
  outline: none;
  min-width: 175px;
  height: 40px;
  transition: border-color 0.15s;
}
.cmd-timeframe:focus,
.cmd-timeframe:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,35,126,0.1); }

.cmd-fetch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 40px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, #FF6B1A, #E05000);
  color: #fff;
  font-family: inherit;
  transition: all 0.18s;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255,107,26,0.40);
  letter-spacing: 0.2px;
}
.cmd-fetch-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,107,26,0.50); }
.cmd-fetch-btn:active { transform: translateY(0); }

.cmd-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 40px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #C5CAE9;
  background: var(--blue-light);
  color: var(--blue);
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.cmd-more-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }


/* ════════════════════════════════════
   STRATEGY BUILDER & REPORT
════════════════════════════════════ */
.strategy-article-ctx {
  background: linear-gradient(135deg, #FFF8F0, #FFF3E8);
  border: 1.5px solid #FFD9A8;
  border-radius: 10px;
  padding: 12px 14px;
}

/* In-app report styles */
.strategy-report { display: flex; flex-direction: column; gap: 0; }
.sr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 2.5px solid var(--saffron);
}
.sr-eyebrow {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--saffron);
  margin-bottom: 5px;
}
.sr-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 8px;
}
.sr-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.sr-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid;
}
.sr-badge-plain { font-size: 11px; color: var(--text-muted); }
.sr-source-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  background: var(--blue-light);
  border: 1px solid #C5CAE9;
  border-radius: 5px;
  padding: 2px 8px;
}
.sr-source-link:hover { background: var(--blue); color: #fff; }

.sr-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.sr-stat {
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  border: 1px solid;
}
.sr-stat-val { font-size: 18px; font-weight: 800; }
.sr-stat-lbl { font-size: 10px; color: var(--text-muted); margin-top: 3px; font-weight: 600; }

.sr-section { margin-bottom: 18px; }
.sr-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--saffron);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #FFE0B2;
}
.sr-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--saffron);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Report content boxes */
.sr-box { border-radius: 8px; padding: 12px 14px; }
.sr-box-grey { background: var(--bg); border: 1px solid var(--border); }
.sr-box-blue { background: #E8F5FE; border: 1.5px solid #B3E5FC; }
.sr-box-green { background: #F1F8E9; border: 1.5px solid #C8E6C9; }
.sr-box-saffron { background: var(--saffron-light); border: 1.5px solid var(--saffron-mid); }
.sr-box-red { background: var(--red-light); border: 1.5px solid #FFCDD2; }
.sr-box-yellow { background: #FFF8E1; border: 1.5px solid #FFE082; }
.sr-box-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 7px; }

/* "Build Strategy" button on news cards */
.build-strategy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #FF6B1A, #E05000);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255,107,26,0.35);
}
.build-strategy-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255,107,26,0.50); }


.news-card-actions {
  padding: 6px 12px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ════════════════════════════════════
   MOBILE RESPONSIVENESS
════════════════════════════════════ */
@media (max-width: 768px) {
  /* Header adjustments */
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }
  .header-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  .nav-btn {
    padding: 8px 12px;
    font-size: 14px;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Intent bar & Command panel */
  .intent-bar-inner {
    padding: 12px 16px;
  }
  .intent-row, .intent-row2 {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .intent-chips {
    flex-wrap: wrap;
    gap: 6px;
  }
  .intent-chip {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }
  .command-panel {
    flex-direction: column;
  }
  .command-panel-left, .command-panel-right {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }
  .command-intents {
    flex-wrap: wrap;
  }
  .cmd-chip {
    flex: 1 1 auto;
    justify-content: center;
  }
  .timeframe-select, .intent-fetch-btn, .fetch-more-btn {
    width: 100%;
    justify-content: center;
  }

  /* Grids */
  .top-stories-grid, .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .stats-row, .sr-stats {
    grid-template-columns: 1fr 1fr;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  
  /* Narrative Builder Layout */
  .narrative-split {
    flex-direction: column;
  }
  .narrative-left, .narrative-right {
    width: 100%;
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .narrative-config {
    grid-template-columns: 1fr;
  }
  .narrative-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .generate-btn, .copy-btn, .pdf-btn {
    width: 100%;
    justify-content: center;
  }

  /* Modals */
  .modal-content {
    width: 95%;
    margin: 20px auto;
    padding: 20px;
  }
  
  /* general spacing */
  .app-container {
    padding: 16px;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* More aggressive mobile resets to prevent overflow */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }
  .app-main, .app-header {
    width: 100%;
    overflow-x: hidden;
  }
  .header-inner {
    padding: 10px 12px;
  }
  .brand-title {
    font-size: 14px;
    white-space: normal;
    word-break: break-word;
  }
  .nav-btn, .refresh-btn {
    white-space: normal;
    font-size: 12px;
    text-align: center;
    padding: 6px 10px;
    min-width: 0;
  }
  .time-display {
    display: none; /* Hide clock on small screens to save space */
  }
  .status-inner {
    flex-direction: column;
    text-align: center;
    padding: 8px 12px;
  }
  .intent-row, .intent-row2 {
    white-space: normal;
  }
  .intent-chip {
    white-space: normal;
    font-size: 11px;
    padding: 6px 8px;
    min-width: 0;
  }
  .cmd-chip {
    white-space: normal;
    font-size: 11px;
    padding: 6px 8px;
  }
  .timeframe-select, .intent-fetch-btn {
    font-size: 12px;
    padding: 8px;
  }
  .command-panel-left {
    min-width: 0;
  }
  .search-box {
    min-width: 0 !important;
    width: 100% !important;
  }
  .news-card {
    min-width: 0;
    width: 100%;
  }
  .news-card-title {
    font-size: 14px;
    line-height: 1.4;
  }
  .news-card-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
  .sr-header {
    flex-direction: column;
  }
  .sr-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .pdf-btn {
    width: 100%;
    margin-top: 10px;
  }
  .intent-meta {
    text-align: center;
    width: 100%;
    font-size: 10px;
  }
  table, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }
  th { display: none; }
  tr { border: 1px solid var(--border); margin-bottom: 10px; }
  td { text-align: right; border-bottom: 1px dotted var(--border); }
  td::before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    text-transform: uppercase;
  }
  td:last-child { border-bottom: 0; }
}
