/* Fonts: DM Sans + Plus Jakarta Sans (layout.php). */

:root {
  /* Political / data palette (charts, alliance pills — unchanged semantics) */
  --palette-green: #006600;
  --palette-blue: #0078ff;
  --palette-red: #ff0000;
  --palette-orange: #f47216;

  /* RGB channels for tints (matches palette above) */
  --rgb-blue: 0 120 255;
  --rgb-green: 0 102 0;
  --rgb-orange: 244 114 22;
  --rgb-red: 255 0 0;
  /* UI ink / stone */
  --rgb-ink: 28 25 23;

  /* Corporate UI: light surfaces + muted crimson accent (reference-style) */
  --bg: #f5f5f4;
  --ink: rgb(var(--rgb-ink));
  --muted: #57534e;
  --periwinkle: #9f1b2f;
  --periwinkle-soft: #fce8ec;
  --periwinkle-mid: #9f1b2f;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface2: #fafaf9;
  --border: rgb(var(--rgb-ink) / 10%);
  --border-strong: rgb(var(--rgb-ink) / 16%);
  --accent: #9f1b2f;
  --accent-hover: #851a2a;
  --accent-soft: #9f1b2f;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --ok-bg: #ecfdf5;
  --ok-border: rgb(var(--rgb-green) / 32%);
  --shadow: 0 1px 3px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 4%);
  --shadow-lg: 0 4px 12px rgb(0 0 0 / 6%), 0 24px 48px rgb(0 0 0 / 5%);
  --radius: 8px;
  --radius-sm: 4px;
  /* Alliance colours: LDF red, UDF blue, NDA orange, Others green */
  --ldf: #ff0000;
  --udf: #0078ff;
  --nda: #f47216;
  --others: #006600;
  --font: "DM Sans", "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: -0.01em;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #fafafa 0%, var(--bg) 35%, #f0f0ef 100%);
  background-attachment: fixed;
}

body.lang-ml {
  font-family: "Noto Sans Malayalam", var(--font);
}

::selection {
  background: rgb(159 27 47 / 18%);
  color: var(--ink);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.btn-nav:focus-visible,
.home-btn:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 500;
}
a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* ——— Content cards ——— */
.card,
.chart-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 1.75rem 2rem;
}

/* ——— Home masthead (dark hero + white bar — corporate-style) ——— */
.home-masthead {
  position: relative;
  min-height: 380px;
  color: #fff;
  padding-bottom: 0;
}

@media (min-width: 640px) {
  .home-masthead {
    min-height: 420px;
  }
}

.home-masthead-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgb(15 23 42 / 92%) 0%, rgb(30 58 95 / 88%) 42%, rgb(15 23 42 / 94%) 100%),
    radial-gradient(ellipse 80% 60% at 70% 20%, rgb(59 130 246 / 15%) 0%, transparent 55%),
    radial-gradient(ellipse 50% 45% at 15% 80%, rgb(159 27 47 / 18%) 0%, transparent 50%);
  pointer-events: none;
}

.home-masthead-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 35%) 0%, rgb(15 23 42 / 55%) 45%, rgb(15 23 42 / 72%) 100%);
  pointer-events: none;
}

.home-masthead-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .home-masthead-inner {
    min-height: 400px;
  }
}

.home-masthead-top {
  display: block;
  width: calc(100% + 2.5rem);
  max-width: 100vw;
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgb(0 0 0 / 4%);
}

@media (min-width: 1100px) {
  .home-masthead-top {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(1.25rem, calc(50vw - 550px));
    padding-right: max(1.25rem, calc(50vw - 550px));
  }
}

.home-masthead .brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.home-masthead .brand:hover {
  color: var(--accent-soft);
  text-decoration: none;
}

.brand--logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.brand-logo {
  display: block;
  height: 100px;
  width: auto;
  max-width: min(400px, 85vw);
  object-fit: contain;
}
.brand--logo:hover {
  text-decoration: none;
  opacity: 0.9;
}
.brand--logo:hover .brand-logo {
  filter: brightness(0.98);
}

/* Header: logo | centered nav | login + tools */
.header-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 1rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.header-brand {
  justify-self: start;
  min-width: 0;
}

.nav--primary {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.35rem 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav--primary a {
  color: var(--muted);
  text-decoration: none !important;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav--primary a:hover,
.nav--primary a.active {
  color: var(--ink);
}

.nav--primary a.active {
  border-bottom-color: var(--accent);
}

.header-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.65rem 1rem;
  flex-wrap: wrap;
}

.header-end__link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
}
.header-end__link:hover {
  color: var(--ink);
}

/* Guest login + signup: hidden in header on small screens (use hero CTAs, login page, etc.). */
@media (max-width: 767px) {
  .site-header .header-end__auth,
  .home-masthead .header-end__auth {
    display: none;
  }
}

.home-masthead .btn-nav {
  background: var(--accent);
  border: none;
  color: #fff !important;
  padding: 0.5rem 1.15rem;
  border-radius: 2px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: none;
}
.home-masthead .btn-nav:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

@media (max-width: 820px) {
  .header-shell {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .header-brand {
    grid-column: 1;
  }
  .header-end {
    grid-column: 2;
    grid-row: 1;
  }
  .nav--primary {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
  }
}

.home-masthead-hero {
  margin-top: auto;
  padding-top: 2.5rem;
  text-align: center;
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.home-masthead-title {
  font-weight: 700;
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 0.65rem;
  color: #fff;
  max-width: none;
}

.home-masthead-tagline {
  margin: 0 auto;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 400;
  color: rgb(255 255 255 / 82%);
  letter-spacing: 0.02em;
  max-width: 40ch;
}

.home-masthead-actions {
  margin-top: 1.75rem;
  padding-bottom: 0.25rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.home-masthead-actions .home-actions--masthead {
  margin-bottom: 0;
  justify-content: center;
}

/* ——— Inner site header ——— */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgb(0 0 0 / 4%);
}

.header-inner {
  max-width: none;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
}

.site-header .brand {
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
  color: var(--ink);
}
.site-header .brand:hover {
  color: var(--accent-soft);
  text-decoration: none;
}

.site-header .brand--logo:hover {
  color: inherit;
  opacity: 0.92;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.nav-lang {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.site-header .nav--primary a {
  color: var(--muted);
}
.site-header .nav--primary a:hover,
.site-header .nav--primary a.active {
  color: var(--ink);
}

.site-header .header-end__link {
  color: var(--muted);
}

.btn-nav {
  background: var(--accent);
  color: #fff !important;
  padding: 0.5rem 1.15rem;
  border-radius: 2px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  box-shadow: none;
}
.btn-nav:hover {
  background: var(--accent-hover);
}

/* ——— Promo ribbon ——— */
.site-banner--promo-ribbon {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(90deg, #1e293b 0%, #451a2e 50%, #7f1d1d 100%);
  border-bottom: 1px solid rgb(0 0 0 / 12%);
  box-shadow: none;
}

.site-banner-promo-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.65rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.25rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 800;
  font-size: clamp(0.92rem, 2.8vw, 1.08rem);
  letter-spacing: -0.02em;
  text-align: center;
  text-shadow: 0 1px 2px rgb(0 0 0 / 22%);
}

.site-banner-promo__icon {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 25%));
}

.site-banner-promo__shine {
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgb(255 255 255 / 18%) 48%,
    transparent 62%
  );
  animation: promo-shine 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes promo-shine {
  0%,
  100% {
    transform: translateX(-12%) rotate(0deg);
  }
  50% {
    transform: translateX(12%) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-banner-promo__shine {
    animation: none;
  }
}

/* ——— Info banner (all pages) ——— */
.site-banner--info {
  position: relative;
  width: 100%;
  padding: 1.25rem 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

@media (max-width: 767px) {
  .site-banner--info {
    display: none;
  }
}

.site-banner-stat--visits dd {
  color: var(--accent);
  font-weight: 800;
}

.site-banner-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, #f5f5f4 0%, #fafafa 50%, #f0f0ef 100%);
  pointer-events: none;
}

.site-banner-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgb(var(--rgb-ink) / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--rgb-ink) / 3%) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 35%), rgb(0 0 0 / 8%));
}

.site-banner-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-banner-columns {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 880px) {
  .site-banner-inner {
    padding: 1.75rem 2rem;
  }
  .site-banner-columns {
    grid-template-columns: 1fr minmax(220px, 280px);
    gap: 2rem;
  }
}

.lang-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.82rem;
}

.lang-switcher-label {
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.lang-switcher-btns {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgb(var(--rgb-ink) / 10%);
  overflow: hidden;
  background: rgb(255 255 255 / 90%);
}

.lang-switcher-btn {
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none !important;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: inherit;
  line-height: 1.2;
}

.lang-switcher-btn:hover {
  color: var(--accent-soft);
  background: rgb(159 27 47 / 8%);
}

.lang-switcher-btn.is-active {
  color: #fff;
  background: var(--accent);
}

/* Nav link rules — anchor + classes wins */
.home-masthead .header-end a.lang-switcher-btn.is-active,
.site-header .header-end a.lang-switcher-btn.is-active {
  color: #fff;
}
.home-masthead .header-end a.lang-switcher-btn.is-active:hover,
.site-header .header-end a.lang-switcher-btn.is-active:hover {
  color: #fff;
}

.lang-switcher--nav {
  font-size: 0.75rem;
  gap: 0.35rem;
}

.lang-switcher--nav .lang-switcher-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-switcher--nav .lang-switcher-btns {
  border-color: var(--border-strong);
}

.lang-switcher--nav .lang-switcher-btn {
  padding: 0.28rem 0.65rem;
}

.site-banner-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-banner-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--ink);
  max-width: 26ch;
}

.site-banner-desc {
  margin: 0 0 1.1rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 58ch;
}

.site-banner-desc strong {
  color: var(--ink);
  font-weight: 600;
}

.site-banner-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.site-banner-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.45;
}

.site-banner-point-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--accent);
  display: flex;
}

.site-banner-aside {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  box-shadow: none;
}

.site-banner-aside-label {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-banner-stats {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.site-banner-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgb(var(--rgb-ink) / 6%);
}

.site-banner-stat:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.site-banner-stat dt {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.site-banner-stat dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ——— Main + side ad columns ——— */
.page-shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 0.75rem;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0;
}

.page-center {
  min-width: 0;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.ad-rail {
  display: none;
}

@media (min-width: 1200px) {
  .page-shell {
    grid-template-columns: 172px minmax(0, 1fr) 172px;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .page-shell.page-shell--minimal {
    grid-template-columns: 1fr;
    max-width: 1100px;
  }

  .ad-rail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 5.5rem;
    padding-top: 0.5rem;
    align-self: start;
    z-index: 2;
  }
}

.ad-slot {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.ad-slot img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.ad-slot-caption {
  display: block;
  font-size: 0.65rem;
  text-align: center;
  color: var(--muted);
  padding: 0.35rem 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-top: 1px solid var(--border);
  background: rgb(248 250 252 / 95%);
}

/* ——— Ad sliders (carousels) ——— */
.ad-slider-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.ad-slider-track {
  display: flex;
  width: calc(var(--ad-n, 3) * 100%);
  transition: transform 0.45s cubic-bezier(0.25, 0.72, 0.25, 1);
  transform: translateX(calc(var(--ad-index, 0) * -100% / var(--ad-n, 3)));
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .ad-slider-track {
    transition: none;
  }
}

.ad-slider-slide {
  flex: 0 0 calc(100% / var(--ad-n, 3));
  box-sizing: border-box;
  min-width: 0;
}

.ad-slider-slide img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.ad-slider-ui {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.35rem 0.15rem;
  background: rgb(248 250 252 / 98%);
  border-top: 1px solid var(--border);
}

.ad-slider--rail .ad-slider-ui {
  padding-bottom: 0.35rem;
}

.ad-slider--single .ad-slider-ui {
  display: none;
}

.ad-slider-segments {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 9rem;
}

.ad-slider-seg {
  flex: 1 1 0;
  min-width: 0.5rem;
  max-width: 2.25rem;
  height: 3px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: rgb(var(--rgb-ink) / 16%);
  cursor: pointer;
  transition: background 0.15s ease, flex-grow 0.15s ease;
}

.ad-slider-seg:hover {
  background: rgb(var(--rgb-ink) / 32%);
}

.ad-slider-seg--active {
  background: var(--accent);
  flex-grow: 1.35;
}

.ad-slider-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.ad-slider-arrow:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
}

.ad-slot--slider {
  overflow: hidden;
}

.ad-slot--rail-slider {
  overflow: hidden;
}

.ad-rail .ad-slot--rail-slider {
  max-width: 160px;
  margin: 0 auto;
}

/* In-content ads on phones / tablets (hidden when side rails are visible) */
.ad-inline.ad-inline--between {
  display: block;
  margin: 1.35rem auto;
  max-width: min(100%, 728px);
  padding: 0 0.35rem;
  box-sizing: border-box;
}

@media (min-width: 1200px) {
  .ad-inline--between {
    display: none !important;
  }
}

.ad-slot--inline {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.ad-slot--inline.ad-slot--slider {
  padding: 0;
}

.ad-inline--rectangle {
  max-width: min(300px, 100%);
}

.ad-inline--rectangle .ad-slot--inline {
  margin-left: auto;
  margin-right: auto;
}

.pred-desktop-ad {
  margin: 1.35rem auto;
  max-width: 200px;
}

@media (min-width: 900px) {
  .pred-desktop-ad {
    display: none !important;
  }
}

.main {
  padding: 2rem 0 4rem;
}

.main-home {
  padding-top: 1.25rem;
}

.site-footer {
  max-width: none;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  background: #e7e5e4;
  text-align: center;
}

.site-footer p {
  margin: 0.35rem 0;
}

/* ——— Home page ——— */
.home-intro {
  margin-bottom: 1.5rem;
}

.home-intro-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.home-intro-text {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 450;
}

.home-progress {
  margin-bottom: 1.5rem;
  background: var(--surface2);
}

.home-progress-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.home-progress-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.home-btn:hover {
  text-decoration: none;
}

.home-masthead .home-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: none;
}
.home-masthead .home-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.home-masthead .home-btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgb(255 255 255 / 55%);
}
.home-masthead .home-btn-secondary:hover {
  background: rgb(255 255 255 / 12%);
  border-color: #fff;
  color: #fff;
}

.home-masthead .home-btn-outline {
  background: transparent;
  color: rgb(255 255 255 / 85%);
  border-color: rgb(255 255 255 / 35%);
}
.home-masthead .home-btn-outline:hover {
  border-color: rgb(255 255 255 / 65%);
  color: #fff;
}

.home-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: none;
}
.home-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.home-btn-secondary {
  background: var(--surface-solid);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: none;
}
.home-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.home-btn-outline {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-strong);
}
.home-btn-outline:hover {
  border-color: var(--accent);
  color: var(--ink);
}

/* ——— Home: “By the numbers” strip — light, editorial ——— */
.home-stats-strip {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0.5rem;
  margin-bottom: 2.75rem;
  padding: 3rem 1.25rem 3.25rem;
  overflow: hidden;
  color: var(--ink);
  text-align: center;
  background: #fafafa;
}

.home-stats-strip--banner {
  margin-top: 0;
  margin-bottom: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.home-stats-strip-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  pointer-events: none;
}

.home-stats-strip-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgb(0 0 0 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(0 0 0 / 4%) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
  pointer-events: none;
}

.home-stats-strip-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

.home-stats-eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-stats-title {
  margin: 0 auto 1rem;
  font-family: var(--font);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 38ch;
}

body.lang-ml .home-stats-title {
  font-family: "Noto Sans Malayalam", var(--font);
  font-weight: 700;
}

.home-stats-desc {
  margin: 0 auto 2.25rem;
  max-width: 52ch;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 450;
}

.home-stats-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem 1.25rem;
  text-align: center;
}

.home-stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.home-stats-value {
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.home-stats-label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 22ch;
}

@media (max-width: 900px) {
  .home-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .home-stats-strip {
    padding: 2.5rem 1rem 3rem;
  }
  .home-stats-grid {
    grid-template-columns: 1fr;
  }
}

.home-charts-heading {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.home-charts-sub {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

/* Mobile / narrow: charts and ads alternate in one column */
.home-charts-flow {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-charts-ad-slot {
  width: 100%;
}

.home-charts-ad-slot .ad-inline.ad-inline--between {
  margin-top: 0;
  margin-bottom: 0;
}

/* Tablet/desktop: three charts in one row; ads full-width rows below */
@media (min-width: 900px) {
  .home-charts-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
  }
  .home-charts-flow > .chart-card--const {
    grid-column: 1;
    grid-row: 1;
  }
  .home-charts-flow > .chart-card--dist {
    grid-column: 2;
    grid-row: 1;
  }
  .home-charts-flow > .chart-card--state {
    grid-column: 3;
    grid-row: 1;
  }
  .home-charts-flow > .home-charts-ad-slot--1 {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    max-width: min(100%, 728px);
  }
  .home-charts-flow > .home-charts-ad-slot--2 {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    max-width: min(100%, 728px);
  }
}

/* Wide desktop: side rails replace inline ads — hide in-flow slots */
@media (min-width: 1200px) {
  .home-charts-ad-slot {
    display: none !important;
  }

  /* With side rails visible, avoid a cramped 3-up chart row that can collide with rail space. */
  .home-charts-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .home-charts-flow > .chart-card--const {
    grid-column: 1;
    grid-row: 1;
  }

  .home-charts-flow > .chart-card--dist {
    grid-column: 2;
    grid-row: 1;
  }

  .home-charts-flow > .chart-card--state {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 520px;
    justify-self: center;
  }
}

.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.chart-card-note {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.chart-wrap {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  aspect-ratio: 1;
}

.chart-wrap canvas {
  max-height: 280px;
}

.home-charts-flow > .chart-card--const {
  width: 100%;
}

.home-charts-flow > .chart-card--const .chart-wrap {
  max-width: min(100%, 760px);
}

.home-charts-flow > .chart-card--const .chart-wrap canvas {
  max-height: none;
}

.chart-empty {
  text-align: center;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.hero h1 {
  margin-top: 0;
  font-size: 1.75rem;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--ink);
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 52ch;
  font-weight: 450;
}

.stats-row {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.stats-row li {
  background: var(--surface2);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.35rem;
  border-radius: 2px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.25;
  min-height: 2.75rem;
  box-shadow: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  border-color: var(--accent-soft);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 4px 14px rgb(15 23 42 / 10%);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 2px;
  text-shadow: none;
}
.btn.primary:hover {
  background: var(--accent-hover);
  color: #fff;
  border-color: var(--accent-hover);
}

.btn-lg {
  padding: 0.85rem 1.65rem;
  font-size: 1.05rem;
  min-height: 3.1rem;
  border-radius: 2px;
}

.btn-secondary {
  background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
  color: #9a3412;
  font-weight: 700;
}
.btn-secondary:hover {
  background: linear-gradient(145deg, #fffbeb 0%, #fed7aa 100%);
  border-color: #fb923c;
  color: #7c2d12;
}

.btn-skip {
  background: rgb(248 250 252);
  border-color: var(--border-strong);
  color: var(--muted);
  font-weight: 600;
}
.btn-skip:hover {
  background: #fff;
  color: var(--ink);
}

.login-google-wrap {
  margin-bottom: 0.75rem;
}

.login-google-wrap .btn-google {
  width: 100%;
  justify-content: center;
  gap: 0.65rem;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #dadce0;
  color: #3c4043;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
  text-decoration: none;
}
.btn-google:hover {
  background: #f8f9fa;
  border-color: #dadce0;
  color: #202124;
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
}
.btn-google__icon {
  flex-shrink: 0;
}

.login-or {
  text-align: center;
  font-size: 0.88rem;
  margin: 0 0 1rem;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.btn.ghost:hover {
  border-color: var(--accent-soft);
  color: var(--ink);
}

.ok-hint {
  color: var(--palette-green);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.otp-send-hint {
  font-size: 0.85rem;
  margin: -0.25rem 0 1rem;
  line-height: 1.45;
}

.otp-dev-banner {
  background: rgb(254 252 232);
  border: 1px solid rgb(250 204 21 / 45%);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.otp-dev-banner__why {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.otp-dev-banner__code {
  margin: 0;
}
.otp-dev-digits {
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.form-inline-cancel {
  margin-top: 0.75rem;
}

.form.otp-resend {
  margin-top: 0.5rem;
}

.narrow {
  max-width: 420px;
  margin: 0 auto;
}

.form label {
  display: block;
  margin-bottom: 1rem;
}
.form label input,
.form label select,
.form input,
.form select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--ink);
  font-family: inherit;
}

.form label textarea,
.form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--ink);
  font-family: inherit;
  resize: vertical;
}

.error {
  color: var(--danger);
  background: var(--danger-bg);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
}

.contact-page .error p {
  margin: 0.25rem 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.flash {
  background: rgb(var(--rgb-green) / 8%);
  border: 1px solid var(--ok-border);
  color: var(--palette-green);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
}

/* Predictions */
.predictions-page h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
  border-bottom: none;
  padding-bottom: 0;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.58rem 1rem;
  border-radius: 8px;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgb(var(--rgb-ink) / 6%);
  text-decoration: none;
  cursor: pointer;
}
.tabs a:hover {
  background: var(--surface2);
  border-color: var(--accent-soft);
  text-decoration: none;
  color: var(--ink);
}
.tabs a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgb(159 27 47 / 28%);
}

.district-block {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}

.district-block summary,
.district-block__summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.district-block__heading {
  flex: 1 1 auto;
  min-width: 0;
}

.district-block__share {
  flex-shrink: 0;
}

.district-block__share .share-ui {
  vertical-align: middle;
}

/* Share menu above neighbouring district rows (dropdown is inside <details>). */
.district-block .share-ui {
  position: relative;
  z-index: 1;
}

.district-block .share-ui__menu {
  z-index: 200;
}

.district-block summary::-webkit-details-marker {
  display: none;
}

.badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.const-grid {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .const-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.const-jump {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgb(var(--rgb-blue) / 5%);
}

.const-jump-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

.const-jump-input {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-family: inherit;
  font-size: 0.92rem;
}

.const-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: start;
  font-size: 0.88rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgb(var(--rgb-ink) / 6%);
}

.const-row-inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.const-row--flash {
  outline: 2px solid var(--palette-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
  transition: outline 0.2s ease;
}

.const-share {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  align-self: center;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.85);
}
.const-share:hover {
  border-color: var(--palette-blue);
  text-decoration: none;
}

.const-label {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  color: var(--muted);
}

.const-label .cn {
  font-size: 0.75rem;
  color: var(--periwinkle-mid);
  font-weight: 700;
}

.const-row select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--ink);
  font-family: inherit;
}

.seat-totals-form .seat-totals-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  margin: 1rem 0 0.5rem;
}

.seat-totals-form .seat-totals-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}

.seat-totals-form .seat-totals-grid input {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  font-family: inherit;
  font-size: 1rem;
}

.seat-totals-sum {
  font-weight: 700;
  font-size: 1rem;
  margin: 0.75rem 0 1rem;
  color: var(--ink);
}

.seat-totals-clear {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.form-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

/* Keep prediction save actions visible while scrolling on all screen sizes. */
.predictions-page .form-actions {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.35rem);
  z-index: 40;
  padding: 0.8rem 0;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  backdrop-filter: blur(6px);
}

.vote-cta-row--gate {
  gap: 0.85rem 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.data-table select {
  min-width: 140px;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--ink);
}

/* Public constituency (share) page */
.vote-page .vote-header {
  margin-bottom: 1.25rem;
}

.vote-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--palette-blue);
  margin: 0 0 0.35rem;
}

.vote-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.vote-meta {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.vote-disclaimer {
  margin: 0;
  font-size: 0.88rem;
}

.vote-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.vote-subheading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.vote-cand-table {
  font-size: 0.88rem;
}

.vote-others-note {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.alliance-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.alliance-pill--ldf {
  background: rgb(var(--rgb-red) / 12%);
  color: var(--palette-red);
}

.alliance-pill--udf {
  background: rgb(var(--rgb-blue) / 12%);
  color: var(--palette-blue);
}

.alliance-pill--nda {
  background: rgb(var(--rgb-orange) / 15%);
  color: var(--palette-orange);
}

.share-panel {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.share-url-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.share-url {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  word-break: break-all;
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.share-buttons .share-btn {
  min-height: 2.85rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.share-btn--wa {
  border-color: #25d366;
  color: #128c7e;
  background: rgba(37, 211, 102, 0.12);
}

.share-btn--tw {
  border-color: var(--border-strong);
}

.share-btn--fb {
  border-color: #1877f2;
  color: #1877f2;
  background: rgba(24, 119, 242, 0.08);
}

/* Reports */
.reports-page h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--surface2);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.report-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.report-filters select {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--ink);
  min-width: 220px;
}

.reports-page h2 {
  font-size: 1.1rem;
  margin: 2rem 0 1rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.report-block {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.report-block:last-child {
  border-bottom: none;
}

.report-block h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 100px;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
}

.bar-label {
  font-weight: 500;
  color: var(--ink);
}

.bar-track {
  height: 10px;
  background: rgb(var(--rgb-ink) / 6%);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.3s ease;
}

.bar-fill.ldf {
  background: var(--ldf);
}
.bar-fill.udf {
  background: var(--udf);
}
.bar-fill.nda {
  background: var(--nda);
}
.bar-fill.others {
  background: var(--others);
}

.bar-num {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.reports-page h1 {
  margin-top: 0;
}

/* ——— Flash rails (header + sidebars) ——— */
body.has-flash-layout {
  padding-top: 8px;
  padding-left: 11px;
  padding-right: 11px;
}

.flash-rail {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
}

.flash-rail--top {
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(
    90deg,
    rgb(var(--rgb-blue) / 48%) 0%,
    rgb(255 255 255 / 96%) 45%,
    rgb(var(--rgb-orange) / 42%) 100%
  );
  background-size: 220% 100%;
  animation: flash-sweep-h 4.5s linear infinite;
  box-shadow: 0 1px 0 rgb(var(--rgb-ink) / 6%);
}

.flash-rail--left {
  top: 8px;
  left: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(
    180deg,
    rgb(var(--rgb-green) / 42%) 0%,
    rgb(255 255 255 / 38%) 40%,
    rgb(var(--rgb-red) / 20%) 100%
  );
  background-size: 100% 220%;
  animation: flash-sweep-v 5.5s linear infinite;
}

.flash-rail--right {
  top: 8px;
  right: 0;
  left: auto;
  bottom: 0;
  width: 10px;
  background: linear-gradient(
    180deg,
    rgb(var(--rgb-blue) / 48%) 0%,
    rgb(255 255 255 / 38%) 40%,
    rgb(var(--rgb-orange) / 34%) 100%
  );
  background-size: 100% 220%;
  animation: flash-sweep-v 5.5s linear infinite reverse;
}

@keyframes flash-sweep-h {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 220% 0;
  }
}

@keyframes flash-sweep-v {
  0% {
    background-position: 0 0%;
  }
  100% {
    background-position: 0 220%;
  }
}

/* ——— Login gate modal (anonymous visitors) ——— */
.login-gate-modal[hidden] {
  display: none !important;
}

.login-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

body.login-gate-open {
  overflow: hidden;
}

.login-gate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 48%);
  backdrop-filter: blur(5px);
}

.login-gate-modal__panel {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  padding: 1.75rem 1.5rem 1.5rem;
  background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
  border: 1px solid rgb(226 232 240);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgb(255 255 255 / 80%) inset;
}

.login-gate-modal__panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.login-gate-modal__intro {
  margin: 0 0 1.25rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--muted);
}

.login-gate-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.login-gate-modal__actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.login-gate-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  border: none;
  background: transparent;
  font-size: 1.65rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
}
.login-gate-modal__close:hover {
  color: var(--ink);
  background: rgb(241 245 249);
}

.pred-guest-hint.flash--info {
  background: linear-gradient(90deg, rgb(219 234 254 / 90%), rgb(224 242 252 / 85%));
  border: 1px solid rgb(147 197 253 / 55%);
  color: #1e3a5f;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

/* ——— Predictions success flash modal ——— */
.flash-modal[hidden] {
  display: none !important;
}

.flash-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

body.flash-modal-open {
  overflow: hidden;
}

.flash-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(var(--rgb-ink) / 42%);
  backdrop-filter: blur(4px);
}

.flash-modal__panel {
  position: relative;
  z-index: 1;
  max-width: 400px;
  width: 100%;
  padding: 1.75rem 1.75rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.flash-modal__icon {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--palette-green);
  font-weight: 700;
}

.flash-modal__title {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.flash-modal__msg {
  margin: 0 0 1.25rem;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.45;
}

.flash-modal__ok {
  min-width: 7rem;
}

/* ——— Contact page address block ——— */
.contact-address-block {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.35rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.contact-address-block__title {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.contact-page .contact-address-block p {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.contact-page .contact-address-block p:last-child {
  margin-bottom: 0;
}

.contact-page .contact-address-block a {
  color: var(--palette-blue);
  font-weight: 600;
}

.footer-meta {
  margin: 0.75rem 0 0;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--palette-blue);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-link-btn:hover {
  color: var(--palette-green);
}

/* Share UI (predictions tabs, reports charts, site FAB) */
.share-ui {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.share-ui__btn {
  white-space: nowrap;
}

.share-ui__menu {
  position: absolute;
  z-index: 60;
  right: 0;
  top: calc(100% + 4px);
  min-width: 12.5rem;
  max-width: min(92vw, 18rem);
  padding: 0.35rem 0;
  margin: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--border-strong, rgba(0, 0, 0, 0.12));
  border-radius: var(--radius-sm, 8px);
  box-shadow: var(--shadow-lg, 0 8px 28px rgba(0, 0, 0, 0.12));
}

.share-ui__menu--fab {
  bottom: calc(100% + 8px);
  top: auto;
  right: 0;
}

@media (max-width: 640px) {
  .share-ui__menu {
    left: 0;
    right: auto;
    min-width: min(12.5rem, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
  }

  .share-ui__menu--fab {
    left: auto;
    right: 0;
    max-width: calc(100vw - 1.25rem);
  }
}

.share-ui__item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.85rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  color: var(--ink);
  text-decoration: none !important;
  cursor: pointer;
  box-sizing: border-box;
}

a.share-ui__item:hover {
  background: var(--bg, rgba(0, 0, 0, 0.04));
}

button.share-ui__item:hover {
  background: var(--bg, rgba(0, 0, 0, 0.04));
}

.share-ui__item--emph {
  font-weight: 600;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  margin-top: 0.25rem;
  padding-top: 0.65rem;
}

.pred-tab-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pred-tab-toolbar .pred-tab-toolbar__hint {
  flex: 1 1 12rem;
  margin: 0;
}

.report-share-unit {
  margin-bottom: 1.5rem;
}

.report-share-unit .share-ui {
  margin-bottom: 0.5rem;
}

.report-block--capture {
  padding: 0.75rem 1rem 1rem;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  background: var(--surface, #fff);
}

/* Off-screen posters for html2canvas */
.share-poster--const-block {
  width: 520px;
}

.share-poster {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 720px;
  padding: 1.5rem;
  background: #fff;
  font-family: system-ui, sans-serif;
  color: #1a1a1a;
}

.share-poster__card {
  border: 3px solid #9f1b2f;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(165deg, #fff 0%, #faf8f6 100%);
}

.share-poster__brand {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.share-poster__region {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #444;
}

.share-poster__list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.share-poster__list li {
  break-inside: avoid;
  margin-bottom: 0.35rem;
}

.share-poster__k {
  font-weight: 600;
}

.share-poster__more {
  font-style: italic;
  color: #666;
}

.share-poster__lead {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #444;
}

.share-poster__big {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.share-poster__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.1rem;
}

.share-poster__table td {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
}

.share-poster__table td:first-child {
  font-weight: 600;
}

.site-share-fab {
  position: fixed;
  z-index: 55;
  right: 1.1rem;
  bottom: 1.1rem;
}

.site-share-fab__toggle {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--palette-red, #9f1b2f);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.site-share-fab__toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
}

.site-share-fab__icon {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 700;
}

@media (max-width: 640px) {
  .share-poster__list {
    columns: 1;
  }
}
