/* ============================================================
   KERALA ELECTION 2026 - COMPLETE STYLESHEET
   Design: Deep editorial / news-room aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Source+Sans+3:wght@300;400;500;600;700&family=Noto+Sans+Malayalam:wght@400;600&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  /* LIGHT MODE (DEFAULT) */
  --bg: #f5f5f0;
  --bg2: #ffffff;
  --bg3: #eeeee8;
  --border: rgba(0, 0, 0, .1);
  --text: #1a1a2e;
  --muted: #64748b;
  --shadow: 0 4px 24px rgba(0, 0, 0, .12);

  /* SHARED VARIABLES */
  --accent: #f97316;
  --accent2: #fbbf24;
  --ldf: #ef4444;
  --udf: #3b82f6;
  --nda: #f59e0b;
  --others: #6b7280;
  --green: #22c55e;
  --radius: 10px;
  --nav-h: 60px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Source Sans 3', system-ui, sans-serif;
  --trans: all .2s ease;
}

[data-theme="dark"] {
  /* DARK MODE */
  --bg: #0b0f1a;
  --bg2: #111827;
  --bg3: #1e2637;
  --border: rgba(255, 255, 255, .08);
  --text: #e8eaf0;
  --muted: #8892a4;
  --shadow: 0 4px 24px rgba(0, 0, 0, .5);
}

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

html {
  scroll-behavior: smooth
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s, color .3s
}

a {
  color: inherit;
  text-decoration: none
}

img {
  max-width: 100%;
  display: block
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none
}

ul {
  list-style: none
}

input,
select {
  font-family: inherit
}

/* ── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px
}

::-webkit-scrollbar-track {
  background: var(--bg)
}

::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 3px
}

/* ── TYPOGRAPHY ────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-serif);
  line-height: 1.2;
  color: var(--text)
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700
}

h3 {
  font-size: 1.2rem;
  font-weight: 600
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans)
}

/* ── LAYOUT ────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px
}

@media(max-width:900px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:600px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr
  }
}

/* ── NAVBAR ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 150;
  height: var(--nav-h);
  background: rgba(11, 15, 26, .95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, .95)
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%
}

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

.nav-brand .logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px
}

.nav-brand .brand-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1
}

.nav-brand .brand-text span {
  display: block;
  font-size: .7rem;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  margin-left: 8px
}

.nav-links a {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  transition: var(--trans)
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg3);
  color: var(--text)
}

.nav-links a.active {
  color: var(--accent)
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto
}

.nav-search-wrap {
  position: relative;
  display: flex;
  align-items: center
}

.nav-search-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 30px 7px 12px;
  border-radius: 20px;
  font-size: .85rem;
  width: 160px;
  outline: none;
  transition: var(--trans)
}

.nav-search-input:focus {
  width: 200px;
  border-color: var(--accent)
}

.nav-search-btn {
  position: absolute;
  right: 10px;
  color: var(--muted);
  font-size: .9rem
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
  display: none
}

.search-results-dropdown.show {
  display: block
}

.search-group-title {
  padding: 8px 14px 4px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent)
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--trans)
}

.search-item:hover {
  background: var(--bg3)
}

.search-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  background: var(--bg3);
  flex-shrink: 0
}

.search-item-name {
  font-size: .875rem;
  font-weight: 500
}

.search-item-meta {
  font-size: .75rem;
  color: var(--muted)
}

.search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: .875rem
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans)
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg3)
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--trans)
}

@media(max-width:768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg2);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    z-index: 99
  }

  .nav-links.open {
    display: flex
  }

  .nav-links a {
    padding: 10px 14px
  }

  .hamburger {
    display: flex
  }

  .nav-search-wrap {
    display: none
  }
}

/* ── LIVE BADGE ────────────────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #ef4444;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s infinite
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1)
  }

  50% {
    opacity: .5;
    transform: scale(1.3)
  }
}

/* ── COUNTDOWN BANNER ──────────────────────────────────────── */
.countdown-banner {
  background: linear-gradient(90deg, #0f172a, #1e293b);
  color: #fff;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-sans);
  position: sticky;
  top: var(--nav-h);
  z-index: 110;
}

[data-theme="light"] .countdown-banner {
  background: linear-gradient(90deg, #1e293b, #0f172a);
}

.countdown-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.countdown-label {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent2);
}

.countdown-timer {
  display: flex;
  gap: 15px;
  align-items: center;
}

.timer-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 45px;
}

.timer-unit span {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.timer-unit small {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
  letter-spacing: 0.05em;
}

@media (max-width: 600px) {
  .countdown-inner {
    padding: 10px 0;
    gap: 10px;
  }
  .countdown-label {
    font-size: 0.7rem;
  }
  .timer-unit span {
    font-size: 1.1rem;
  }
  .timer-unit {
    min-width: 35px;
  }
}

/* Adjust navbar sticky position */
.navbar {
  top: 0;
}

@media (max-width: 600px) {
  .navbar {
    top: 0;
  }
}

/* ── HERO ──────────────────────────────────────────────────── */
.hero {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(249, 115, 22, .08) 0%, transparent 70%);
  pointer-events: none
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px
}

.hero-title {
  margin-bottom: 12px
}

.hero-title span {
  display: block;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text
}

.hero-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 32px
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap
}

.hero-stat {
  text-align: center
}

.hero-stat .num {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent)
}

.hero-stat .lbl {
  font-size: .8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px
}

/* ── SECTION ───────────────────────────────────────────────── */
.section {
  padding: 40px 0
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 24px;
  background: var(--accent);
  border-radius: 2px
}

.section-link {
  font-size: .85rem;
  color: var(--accent);
  font-weight: 600
}

.section-link:hover {
  text-decoration: underline
}

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--trans)
}

.card:hover {
  border-color: rgba(249, 115, 22, .3);
  transform: translateY(-2px);
  box-shadow: var(--shadow)
}

.card-sm {
  padding: 16px
}

/* ── ARCHIVE CARDS ─────────────────────────────────────────── */
.archive-card {
  padding: 24px;
  text-align: left !important;
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  border-top: 4px solid var(--border);
  transition: var(--trans);
}

.archive-card.border-red {
  border-top-color: #ef4444;
}

.archive-card.border-blue {
  border-top-color: #3b82f6;
}

.archive-card.border-green {
  border-top-color: #22c55e;
}

.archive-card.border-orange {
  border-top-color: #f97316;
}

.archive-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.archive-title {
  font-family: var(--font-serif);
  font-size: 1.3rem !important;
  margin: 0 !important;
  color: var(--text);
}

.archive-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.archive-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  transition: var(--trans);
}

.archive-link:hover {
  gap: 8px;
  text-decoration: underline;
}

/* ── STATS ROW ─────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0
}

.stat-icon.orange {
  background: rgba(249, 115, 22, .15)
}

.stat-icon.blue {
  background: rgba(59, 130, 246, .15)
}

.stat-icon.green {
  background: rgba(34, 197, 94, .15)
}

.stat-icon.yellow {
  background: rgba(251, 191, 36, .15)
}

.stat-icon.red {
  background: rgba(239, 68, 68, .15)
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1
}

.stat-label {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 3px
}

/* ── PREDICTION BAR ────────────────────────────────────────── */
.prediction-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px
}

.prediction-title {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 16px
}

.prediction-bar-row {
  display: flex;
  gap: 4px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px
}

.pred-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  transition: width .8s ease;
  cursor: default;
  position: relative
}

.pred-segment:hover .pred-tooltip {
  display: block
}

.pred-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  white-space: nowrap;
  font-size: .75rem;
  z-index: 10
}

.pred-segment.ldf {
  background: var(--ldf)
}

.pred-segment.udf {
  background: var(--udf)
}

.pred-segment.nda {
  background: var(--nda)
}

.pred-segment.others {
  background: var(--others)
}

.majority-line {
  position: relative;
  border-top: 2px dashed var(--muted);
  margin-bottom: 8px
}

.majority-line::before {
  content: 'Majority: 71';
  position: absolute;
  left: calc(71/140 * 100%);
  transform: translateX(-50%);
  bottom: 4px;
  font-size: .7rem;
  color: var(--muted);
  white-space: nowrap
}

.pred-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap
}

.pred-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem
}

.pred-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%
}

/* ── CHARTS ────────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px
}

@media(max-width:700px) {
  .chart-grid {
    grid-template-columns: 1fr
  }
}

.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px
}

.chart-card h4 {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em
}

.chart-container {
  position: relative;
  height: 260px
}

/* ── PARTY BADGE ───────────────────────────────────────────── */
.party-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em
}

.alliance-ldf,
.party-badge.ldf {
  background: rgba(239, 68, 68, .15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, .3)
}

.alliance-udf,
.party-badge.udf {
  background: rgba(59, 130, 246, .15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, .3)
}

.alliance-nda,
.party-badge.nda {
  background: rgba(245, 158, 11, .15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, .3)
}

.alliance-others,
.party-badge.others {
  background: rgba(107, 114, 128, .15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, .3)
}

/* ── CONSTITUENCY CARD ─────────────────────────────────────── */
.const-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--trans)
}

.const-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3)
}

.const-num {
  font-size: .7rem;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600
}

.const-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px
}

.const-district {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 8px
}

.const-mla {
  font-size: .82rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px
}

.const-mla span {
  color: var(--muted)
}

.const-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px
}

.const-pred {
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px
}

.const-margin {
  font-size: .75rem;
  color: var(--muted)
}

/* ── CANDIDATE CARD ────────────────────────────────────────── */
.cand-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--trans)
}

.cand-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px)
}

.cand-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 10px
}

.cand-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px
}

.cand-party {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 6px
}

.cand-const {
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px
}

.cand-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap
}

.cand-meta-item {
  font-size: .72rem;
  background: var(--bg3);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--muted)
}

/* ── PARTY CARD ────────────────────────────────────────────── */
.party-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: var(--trans)
}

.party-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px)
}

.party-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px
}

.party-symbol {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 2px solid var(--border)
}

.party-card-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700
}

.party-card-full {
  font-size: .78rem;
  color: var(--muted)
}

.party-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px
}

.party-stat-item {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg3);
  border-radius: 6px
}

.party-stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-serif)
}

.party-stat-lbl {
  font-size: .6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap
}

/* ── NEWS CARD ─────────────────────────────────────────────── */
.news-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: var(--trans)
}

.news-card:hover {
  border-color: var(--accent)
}

.news-img {
  width: 90px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem
}

.news-source {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px
}

.news-title {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px
}

.news-time {
  font-size: .72rem;
  color: var(--muted)
}

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

/* ── POLL ──────────────────────────────────────────────────── */
.poll-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px
}

.poll-question {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px
}

.poll-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--trans)
}

.poll-option:hover:not(.voted) {
  background: var(--bg3);
  border-color: var(--accent)
}

.poll-option.voted {
  cursor: default
}

.poll-option.voted .poll-bar {
  display: block
}

.poll-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: var(--trans)
}

.poll-radio.selected {
  background: var(--accent);
  border-color: var(--accent)
}

.poll-label {
  flex: 1;
  font-size: .9rem;
  font-weight: 500
}

.poll-pct {
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent)
}

.poll-bar-wrap {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  margin-top: 6px;
  display: none
}

.poll-bar {
  height: 4px;
  border-radius: 2px;
  transition: width .6s ease
}

.poll-votes {
  font-size: .75rem;
  color: var(--muted);
  text-align: right
}

/* ── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform .25s;
  box-shadow: var(--shadow)
}

.modal-overlay.open .modal {
  transform: translateY(0)
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg3);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--trans)
}

.modal-close:hover {
  background: var(--accent);
  color: #fff
}

.modal-body {
  padding: 24px
}

.modal-section {
  margin-bottom: 20px
}

.modal-section-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600
}

.modal-table {
  width: 100%;
  border-collapse: collapse
}

.modal-table td,
.modal-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  text-align: left
}

.modal-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em
}

.cand-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border)
}

.cand-list-item:last-child {
  border: none
}

/* ── FILTERS ───────────────────────────────────────────────── */
.filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px
}

.filter-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: .875rem;
  outline: none;
  transition: var(--trans)
}

.filter-input:focus {
  border-color: var(--accent)
}

.filter-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: .875rem;
  outline: none;
  cursor: pointer;
  transition: var(--trans);
  appearance: none;
  padding-right: 30px
}

.filter-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px
}

.filter-search-wrap input {
  width: 100%
}

.filter-search-wrap .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .85rem
}

.results-count {
  font-size: .85rem;
  color: var(--muted);
  align-self: center;
  margin-left: auto
}

/* ── PAGINATION ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  cursor: pointer;
  transition: var(--trans)
}

.page-btn:hover,
.page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.page-btn:disabled {
  opacity: .4;
  cursor: not-allowed
}

/* ── TABS ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px
}

.tab-btn {
  padding: 10px 20px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: var(--trans)
}

.tab-btn:hover {
  color: var(--text)
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent)
}

.tab-panel {
  display: none
}

.tab-panel.active {
  display: block
}

/* ── PAGE HEADER ───────────────────────────────────────────── */
.page-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px
}

.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 6px
}

.page-header p {
  color: var(--muted)
}

/* ── GRID CARDS ────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px
}

.cards-grid-sm {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px
}

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted)
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block
}

.empty-state p {
  font-size: .95rem
}

/* ── LOADING ───────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--muted)
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px
}

@keyframes shimmer {
  to {
    background-position: -200% 0
  }
}

/* ── FOOTER ────────────────────────────────────────────────── */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 60px;
  text-align: center;
  color: var(--muted);
  font-size: .82rem
}

.footer a {
  color: var(--accent)
}

/* ── MISC UTILS ────────────────────────────────────────────── */
.flex {
  display: flex;
  align-items: center
}

.flex-gap {
  gap: 8px
}

.text-muted {
  color: var(--muted)
}

.text-accent {
  color: var(--accent)
}

.text-sm {
  font-size: .85rem
}

.text-xs {
  font-size: .75rem
}

.font-serif {
  font-family: var(--font-serif)
}

.mt-1 {
  margin-top: 6px
}

.mt-2 {
  margin-top: 12px
}

.mt-3 {
  margin-top: 20px
}

.mb-1 {
  margin-bottom: 6px
}

.mb-2 {
  margin-bottom: 12px
}

.mb-3 {
  margin-bottom: 20px
}

.w-full {
  width: 100%
}

.text-center {
  text-align: center
}

.hidden {
  display: none !important
}

.tag {
  display: inline-block;
  background: var(--bg3);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 500
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0
}

.highlight-box {
  background: rgba(249, 115, 22, .08);
  border: 1px solid rgba(249, 115, 22, .2);
  border-radius: 8px;
  padding: 12px 16px
}

/* ── TOAST ─────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .875rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .3s ease
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

.toast.success {
  border-color: rgba(34, 197, 94, .4)
}

.toast.error {
  border-color: rgba(239, 68, 68, .4)
}

/* ── WINNING INDICATOR ─────────────────────────────────────── */
.winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .05em
}

.winner-badge::before {
  content: '▲';
  font-size: .55rem
}

/* ── BACK BUTTON ───────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .875rem;
  margin-bottom: 20px;
  transition: var(--trans)
}

.back-btn:hover {
  color: var(--accent)
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media(max-width:600px) {
  .stats-row {
    grid-template-columns: 1fr 1fr
  }

  .chart-grid {
    grid-template-columns: 1fr
  }

  .hero {
    padding: 40px 0 24px
  }

  .hero-stats {
    gap: 24px
  }

  .section {
    padding: 28px 0
  }

  .filters-row {
    flex-direction: column
  }

  .filter-input,
  .filter-select {
    width: 100%
  }
}

.hide-prediction {
  display: none !important;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .schedule-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.schedule-card {
  padding: 24px 16px;
  text-align: center;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.schedule-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: var(--primary);
}

.schedule-event {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schedule-date {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.schedule-card.highlight {
  border: 2px solid var(--accent);
  background: rgba(239, 68, 68, 0.03);
}

.schedule-card.highlight .schedule-date {
  color: var(--accent);
  font-size: 1.6rem;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .schedule-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.schedule-card {
  padding: 24px 16px;
  text-align: center;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.schedule-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: var(--primary);
}

.schedule-event {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schedule-date {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.schedule-card.highlight {
  border: 2px solid var(--accent);
  background: rgba(239, 68, 68, 0.03);
}

.schedule-card.highlight .schedule-date {
  color: var(--accent);
  font-size: 1.6rem;
}

/* --- Navigation Dropdown --- */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px 0;
  min-width: 160px;
  display: none;
  z-index: 1000;
  list-style: none;
  margin: 0;
}

.nav-dropdown-wrapper:hover .nav-dropdown {
  display: block;
}

.nav-dropdown li {
  display: block;
  margin: 0;
}

.nav-dropdown a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.875rem;
  border-radius: 0;
  transition: background 0.2s;
}

.nav-dropdown a:hover {
  background: var(--bg3);
  color: var(--accent);
}

.nav-dropdown-toggle::after {
  content: ' ▾';
  font-size: 0.8em;
}

@media (max-width: 768px) {
  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 20px;
    background: transparent;
    display: none;
    width: 100%;
  }

  .nav-dropdown-wrapper.open .nav-dropdown {
    display: block;
  }

  .nav-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.dropdown-header {
  padding: 8px 16px;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.dropdown-item-text {
  padding: 4px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  word-break: break-all;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* --- Chief Minister Detailed Views --- */
.cm-header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 50px;
  padding: 0;
  background: transparent;
  border: none;
}
.cm-header img {
  width: 260px;
  height: auto;
  max-height: 380px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: none;
  border: none;
  flex-shrink: 0;
}
.cm-header > div {
  flex: 1;
  min-width: 0;
  width: 100%;
}
.cm-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  margin: 0 0 10px 0;
  color: var(--text);
  line-height: 1.2;
}
.cm-subtitle {
  font-size: 1.15rem;
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 25px 0;
}
.quick-facts {
  margin-top: 25px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  max-width: 800px;
}
.quick-facts span {
  word-break: break-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
}
.cm-content {
  line-height: 1.8;
  font-size: 1.05rem;
  color: var(--text);
}
.cm-content h2, .cm-content h3 {
  font-family: var(--font-serif);
  color: var(--text);
  margin-top: 30px;
  margin-bottom: 15px;
}
.cm-content p {
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .cm-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}