:root {
  --bg: #eaeef5;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-solid: #ffffff;
  --panel-soft: #f5f8fc;
  --text: #0d1424;
  --muted: #5b6b85;
  --line: rgba(148, 163, 184, 0.28);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.22), 0 4px 12px -6px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 30px 70px -28px rgba(15, 23, 42, 0.42);
  --accent: #1d5fb8;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  background:
    radial-gradient(50rem 34rem at 6% -6%, rgba(29, 95, 184, 0.22), transparent 60%),
    radial-gradient(46rem 32rem at 98% 2%, rgba(216, 104, 30, 0.18), transparent 58%),
    radial-gradient(60rem 50rem at 50% 116%, rgba(56, 78, 122, 0.18), transparent 62%),
    linear-gradient(165deg, #dfe6f1 0%, #d6dded 44%, #e6e1da 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

/* subtle textured backdrop so the glass cards sit on something */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(13, 20, 36, 0.06) 1px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(130% 110% at 50% -10%, #000 50%, transparent 100%);
  mask-image: radial-gradient(130% 110% at 50% -10%, #000 50%, transparent 100%);
}

.hero-meta {
  margin: 14px 0 0;
}

.view-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #2a3852;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

button,
.file-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #1b2436, #0d1424);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.66rem 1.05rem;
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), opacity 200ms ease, background 200ms ease;
}

button:hover,
.file-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

button:active,
.file-button:active {
  transform: translateY(0);
}

button.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: #111827;
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow: none;
}

.file-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.shell {
  width: min(1720px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 0 0 44px;
}

.newsroom-shell {
  color-scheme: light;
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 12px 0 0;
  padding: 10px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(120deg, rgba(13, 20, 36, 0.92), rgba(22, 33, 56, 0.90));
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 14px 40px -16px rgba(13, 20, 36, 0.55);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  font-family: Sora, Inter, sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #fff;
}

.brand-text em {
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #93a4c4;
  margin-top: 3px;
}

.main-nav {
  display: flex;
  gap: 4px;
  margin-left: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab {
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #aeb9d0;
  text-decoration: none;
  transition: background 200ms var(--ease), color 200ms var(--ease);
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
  color: #0d1424;
  background: linear-gradient(180deg, #ffffff, #e7edf6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.masthead-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.masthead-actions button,
.masthead-actions .file-button {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.masthead-actions button:hover,
.masthead-actions .file-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ---------- hero ---------- */
.page-hero {
  padding: 30px 4px 18px;
}

.page-hero h1 {
  margin: 6px 0 0;
}

.page-hero .subtitle {
  margin-top: 10px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Sora, Inter, ui-sans-serif, system-ui, sans-serif;
}

h1 {
  max-width: 1050px;
  font-size: clamp(1.9rem, 2.8vw, 3.1rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #0d1424 0%, #1d3a66 55%, #0d1424 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.subtitle {
  max-width: 980px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.majority-card,
.panel-card,
.map-card {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}

.panel-card:hover {
  box-shadow: var(--shadow-lg);
}

.majority-card {
  min-width: 190px;
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.majority-card strong {
  display: block;
  font-family: Sora, Inter, sans-serif;
  font-size: 3.6rem;
  line-height: 1;
}

.majority-label {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.map-totals {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 12px;
}

.map-totals .kpi {
  padding: 9px 13px;
}

.map-totals .kpi span {
  font-size: 0.68rem;
}

.map-totals .kpi strong {
  font-size: 1.5rem;
}

.kpi {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.6));
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}

.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.kpi span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 4px;
  font-family: Sora, Inter, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 14px;
  align-items: start;
}

.dashboard.newsroom-grid {
  grid-template-columns: minmax(0, 1fr) 384px;
}

.map-card,
.panel-card {
  border-radius: 22px;
}

.map-card {
  min-height: 760px;
  padding: 14px;
}

.map-toolbar,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 12px 0 10px;
  padding: 10px 14px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  width: max-content;
  max-width: 100%;
}

.legend-rating-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.bloc-key {
  margin: 4px 0 10px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  max-width: 100%;
}

.bloc-key strong {
  color: var(--text);
}

.editor-hint {
  margin: 4px 0 8px;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
}

.editor-seat-name {
  font-weight: 900;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
  min-height: 1.1em;
}

.editor-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.editor-levels.is-disabled {
  opacity: 0.4;
}

.editor-btn {
  flex: 1 1 auto;
  min-width: 64px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.editor-btn:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.editor-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.editor-btn:disabled {
  cursor: default;
  opacity: 0.5;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-weight: 900;
  font-size: 0.9rem;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.1);
}

.map-wrap {
  position: relative;
  height: min(72vh, 720px);
  min-height: 650px;
  border: 1px solid #b8c2d2;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, #fffaf0 0%, #f7f9fc 55%, #eef3fb 100%);
}

.seat-map-shell::after {
  content: "Use + / - to zoom. Hover any constituency.";
  position: absolute;
  left: 16px;
  bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #475569;
  padding: 0.48rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
}

#india-map {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#india-map.dragging {
  cursor: grabbing;
}

.land-base {
  fill: #cfd8e4;
  stroke: #cfd8e4;
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.map-path {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 0.4;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: opacity 200ms var(--ease), filter 200ms var(--ease), stroke-width 200ms var(--ease), stroke 200ms var(--ease);
}

.map-path:hover,
.map-path.active {
  opacity: 1;
  filter: brightness(1.06) saturate(1.14) drop-shadow(0 3px 7px rgba(15, 23, 42, 0.32));
  stroke: #ffffff;
  stroke-width: 1.6;
}

.state-label {
  fill: rgba(15, 23, 42, 0.42);
  font-size: 10px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 2.4px;
  pointer-events: none;
}

.state-boundary-base {
  fill: none;
  stroke: rgba(15, 23, 42, 0.5);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.state-boundary {
  fill: none;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.island-path {
  stroke-width: 0.55;
}

.inset-label {
  fill: rgba(71, 85, 105, 0.75);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.tooltip {
  position: absolute;
  z-index: 5;
  min-width: 220px;
  max-width: 330px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(30, 41, 59, 0.94));
  color: #fff;
  padding: 10px 12px;
  font-size: 0.74rem;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px)) scale(0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.tooltip.visible {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 16px)) scale(1);
}

.tooltip-title {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 900;
}

.tooltip dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 7px 0 0;
}

.tooltip dt {
  color: #aeb6c7;
  font-size: 0.72rem;
  font-weight: 700;
}

.tooltip dd {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 400;
  color: #f4f6fb;
}

.tooltip dd.demo-fig {
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.28;
  color: #cdd4e2;
}

.tooltip-hint {
  margin: 7px 0 0;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #8fa0bd;
}

.side-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: stretch;
  position: sticky;
  top: 12px;
}

.rail-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.rail-kpis .kpi {
  padding: 12px;
}

.rail-kpis .kpi strong {
  font-size: 1.65rem;
}

.path-to-272 {
  display: grid;
  gap: 4px;
}

.path-to-272 strong {
  font-size: 3rem;
  letter-spacing: -0.06em;
}

.path-to-272 span {
  color: var(--muted);
  font-weight: 800;
}

.panel-card {
  padding: 16px;
  background-color: #ffffff;
}

.selection-card {
  color: var(--muted);
  line-height: 1.55;
}

.selected-race-panel {
  margin-top: 2px;
}

.selection-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 24px;
  align-items: start;
}

/* In the narrow right rail the selected-race card stacks vertically. */
.right-rail .selection-horizontal {
  grid-template-columns: 1fr;
  gap: 14px;
}

.right-rail .selected-title {
  font-size: 1.2rem;
}

.right-rail .selection-card {
  font-size: 0.9rem;
}

.selection-note {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--panel-soft, #f5f8fc);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
}

.selection-note span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sel-col h3:first-child {
  margin-top: 0;
}

.sel-col-summary .selected-meta {
  margin-top: 10px;
}

.selected-title {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.selected-meta {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.selection-card h3 {
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 1rem;
}

.demographic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.demographic-grid div {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px;
}

.demographic-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demographic-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
}

.religion-bars {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.religion-row,
.caste-row {
  display: grid;
  gap: 5px;
}

.religion-row-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 0.88rem;
}

.religion-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.religion-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #174f94, #3d5df2);
}

.caste-bars {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.caste-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.caste-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7a160c, #ef7a9d);
}

.demographic-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.meta-row span:first-child {
  color: var(--muted);
}

.editor-form {
  display: grid;
  gap: 12px;
}

.editor-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.editor-form input,
.editor-form select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--text);
  padding: 0.7rem 0.8rem;
}

.editor-form option {
  color: #101522;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 12px;
  margin-top: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.state-analysis {
  margin-top: 12px;
}

.state-analysis .table-wrap {
  max-height: 460px;
  overflow-y: auto;
}

.state-analysis thead th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  z-index: 1;
}

.party-split {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.party-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 800;
  color: #1f2937;
  white-space: nowrap;
}

.party-chip .swatch {
  width: 12px;
  height: 12px;
}

.deep-dives {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.deepdive-card h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}

.deepdive-summary {
  color: var(--text);
  font-size: 0.96rem;
  margin: 6px 0 14px;
}

.stack-bar {
  display: flex;
  width: 100%;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.stack-seg {
  height: 100%;
}

.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
}

.stack-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 700;
}

.trend-chart {
  margin: 6px 0 4px;
}

.trend-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.trend-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 120px;
  font-weight: 800;
  font-size: 0.9rem;
}

.trend-cells {
  display: flex;
  gap: 18px;
  align-items: flex-end;
}

.trend-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 86px;
}

.trend-barwrap {
  height: 70px;
  width: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.trend-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  min-height: 3px;
}

.trend-val {
  font-weight: 800;
  font-size: 0.82rem;
  margin-top: 4px;
}

.trend-x {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.reason-cell {
  max-width: 360px;
  color: var(--muted);
  font-size: 0.84rem;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent);
  font-weight: 900;
  font-size: 0.9rem;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
}

.tab-link:hover {
  background: var(--accent);
  color: #fff;
}

.assembly-nav {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.assembly-nav a {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-weight: 800;
  padding: 0.45rem 0.9rem;
  text-decoration: none;
}

.assembly-root {
  display: grid;
  gap: 16px;
}

.assembly-state {
  scroll-margin-top: 12px;
}

.assembly-summary {
  font-size: 0.98rem;
  margin: 6px 0 14px;
}

.assembly-map-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.assembly-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.assembly-map-head h3 {
  margin: 0;
  font-size: 1rem;
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle button {
  border: 0;
  background: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.34rem 0.7rem;
  cursor: pointer;
  color: var(--muted);
}

.view-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.zoom-controls {
  display: inline-flex;
  gap: 6px;
}

.zoom-controls button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.assembly-map-wrap {
  position: relative;
  height: min(70vh, 640px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.7);
  overflow: hidden;
}

.assembly-map {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.assembly-map:active {
  cursor: grabbing;
}

.ac-path {
  stroke: rgba(255, 255, 255, 0.65);
  stroke-width: 0.4;
  transition: filter 0.12s ease;
}

.ac-path:hover {
  filter: brightness(1.12) saturate(1.1);
  stroke: #0f172a;
  stroke-width: 0.8;
}

.assembly-tip {
  position: absolute;
  pointer-events: none;
}

.assembly-side h3 {
  margin: 4px 0 8px;
  font-size: 1rem;
}

.assembly-footer {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .assembly-map-grid {
    grid-template-columns: 1fr;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th,
td {
  padding: 0.82rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill {
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: var(--muted);
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 900;
}

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

.hosting-heading {
  margin-top: 18px;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-links a {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #174f94;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
}

@media (max-width: 1120px) {
  .topbar,
  .dashboard,
  .dashboard.newsroom-grid,
  .side-panel,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 16px, 1500px);
    padding-top: 8px;
  }

  .masthead {
    flex-wrap: wrap;
    gap: 10px;
    padding: 9px 12px;
    top: 6px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar { display: none; }

  .nav-tab {
    flex: 1 0 auto;
    padding: 7px 12px;
    font-size: 0.8rem;
    text-align: center;
  }

  .masthead-actions {
    margin-left: auto;
    flex-wrap: wrap;
  }

  .masthead-actions button,
  .masthead-actions .file-button {
    padding: 0.42rem 0.7rem;
    font-size: 0.78rem;
  }

  .page-hero {
    padding: 18px 2px 12px;
  }

  .subtitle {
    font-size: 0.98rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .kpi {
    padding: 11px 12px;
  }

  .kpi strong {
    font-size: 1.55rem;
  }

  .map-card {
    min-height: auto;
    padding: 12px;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .map-wrap {
    height: min(64vh, 540px);
    min-height: 380px;
  }

  .legend {
    width: 100%;
    gap: 8px 12px;
  }

  .map-toolbar .eyebrow,
  #map-mode {
    font-size: 0.7rem;
    word-break: break-word;
  }

  .editor-btn {
    min-width: 0;
    padding: 8px 8px;
    font-size: 0.82rem;
  }

  .seat-map-shell::after {
    font-size: 0.7rem;
    left: 10px;
    bottom: 8px;
  }

  .tooltip {
    max-width: calc(100vw - 28px);
    min-width: 0;
    font-size: 0.72rem;
  }

  .selection-horizontal,
  .demographic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .brand-text strong { font-size: 0.92rem; letter-spacing: 0.1em; }
  .brand-text em { font-size: 0.6rem; letter-spacing: 0.16em; }
  .kpi strong { font-size: 1.35rem; }
  .nav-tab { font-size: 0.74rem; padding: 6px 9px; }
}

/* ---------- premium motion layer ---------- */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(16px) scale(0.992); }
  to   { opacity: 1; transform: none; }
}
@keyframes map-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes toss-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.07) saturate(1.1); }
}

@media (prefers-reduced-motion: no-preference) {
  .map-card,
  .panel-card,
  .kpi,
  .battleground-strip,
  .state-analysis,
  .lower-grid > * {
    animation: reveal-up 720ms var(--ease) both;
  }
  .map-card { animation-delay: 40ms; }
  .right-rail .panel-card:nth-of-type(1) { animation-delay: 120ms; }
  .right-rail .panel-card:nth-of-type(2) { animation-delay: 180ms; }
  .right-rail .panel-card:nth-of-type(3) { animation-delay: 240ms; }
  .right-rail .panel-card:nth-of-type(4) { animation-delay: 300ms; }
  .rail-kpis { animation-delay: 100ms; }
  .selected-race-panel { animation-delay: 160ms; }
  .battleground-strip { animation-delay: 220ms; }
  .state-analysis { animation-delay: 120ms; }

  #india-map { animation: map-fade-in 900ms var(--ease) both; animation-delay: 120ms; }
}

/* smooth, eased zoom/pan when zooming via buttons */
#map-viewport.smooth-zoom {
  transition: transform 520ms var(--ease);
}

/* count-up shimmer when a total changes */
.kpi.bump strong {
  animation: kpi-bump 420ms var(--ease);
}
@keyframes kpi-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); color: var(--accent); }
  100% { transform: scale(1); }
}

/* legend swatch hover lift */
.legend-rating-scale span,
.legend [class*="swatch"] {
  transition: transform 220ms var(--ease);
}

/* tab link + headings polish */
.tab-link {
  text-decoration: none;
  font-weight: 700;
}
/* ============================================================
   Road to Two-Thirds — supermajority tracker (two-thirds.html)
   ============================================================ */
.tt-root { display: flex; flex-direction: column; gap: 20px; margin-top: 4px; }
.tt-root .card-head { margin-bottom: 14px; }
.tt-root .card-head h2 { margin: 0; }
.tt-root .card-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; font-weight: 600; }

.tt-gauges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.gauge-card { border-radius: var(--radius); padding: 20px 20px 18px; }
.gauge-card .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gauge-card .card-head h2 { font-size: 1.18rem; }
.gauge-card .card-sub { color: #d8531e; font-weight: 800; white-space: nowrap; }
.gauge-svg { width: 100%; height: auto; display: block; margin: 2px 0 6px; }
.gauge-track { fill: none; stroke: rgba(148,163,184,0.28); stroke-width: 13; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: url(#none); stroke: #1f9d5b; stroke-width: 13; stroke-linecap: round;
  filter: drop-shadow(0 3px 8px rgba(31,157,91,0.35)); animation: gauge-grow 900ms var(--ease) both; }
@keyframes gauge-grow { from { stroke-dasharray: 0 999; } }
.gauge-tick-major { stroke: #d8531e; stroke-width: 3.2; stroke-linecap: round; }
.gauge-tick-floor { stroke: #1d5fb8; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 2 2; }
.gauge-num { font-family: Sora, Inter, sans-serif; font-size: 2.5rem; font-weight: 800; fill: var(--text); }
.gauge-cap { font-size: 0.74rem; font-weight: 700; fill: var(--muted); letter-spacing: 0.02em; }
.gauge-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 8px; }
.gauge-note { margin: 6px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.legend-item i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.gl-fill i { background: #1f9d5b; }
.gl-major i { background: #d8531e; }
.gl-floor i { background: #1d5fb8; }
.legend-item.d1 i { background: #137a47; }
.legend-item.d2 i { background: #1f9d5b; }
.legend-item.d3 i { background: #1d5fb8; }
.legend-item.d4 i { background: #c9781f; }
.legend-item.d5 i { background: #d8531e; }
.cl-line i { background: repeating-linear-gradient(90deg,#1d5fb8 0 4px,transparent 4px 7px); border-radius: 0; height: 4px; }

/* climb chart */
.climb-card { border-radius: var(--radius); padding: 20px; }
.scenario-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px;
  background: var(--panel-soft); border: 1px solid var(--line); margin: 2px 0 14px; }
.scenario-pill { padding: 8px 16px; border: 0; border-radius: 9px; background: transparent;
  font-size: 0.88rem; font-weight: 800; color: var(--muted); cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease); }
.scenario-pill:hover { color: var(--text); }
.scenario-pill.active { background: linear-gradient(180deg,#ffffff,#e9eef7); color: #0d1424; box-shadow: var(--shadow-sm); }
.lock-banner { margin: 0 0 12px; padding: 11px 14px; border-radius: 12px; font-size: 0.92rem; line-height: 1.5;
  color: #7c2d12; background: rgba(216,83,30,0.10); border: 1px solid rgba(216,83,30,0.28); }
.climb-chart-wrap { width: 100%; overflow-x: auto; }
.climb-svg { width: 100%; min-width: 680px; height: auto; display: block; }
.climb-bar { transform-origin: bottom; animation: bar-rise 560ms var(--ease) both; animation-delay: var(--delay,0ms); }
@keyframes bar-rise { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.climb-bar.d1 { fill: #137a47; }
.climb-bar.d2 { fill: #1f9d5b; }
.climb-bar.d3 { fill: #1d5fb8; }
.climb-bar.d4 { fill: #c9781f; }
.climb-bar.d5 { fill: #d8531e; }
.climb-bar.crossed { filter: drop-shadow(0 4px 12px rgba(19,122,71,0.45)); }
.climb-step { fill: none; stroke: rgba(91,107,133,0.55); stroke-width: 1.6; stroke-dasharray: 3 3; }
.climb-total { font-family: Sora, Inter, sans-serif; font-size: 15px; font-weight: 800; fill: var(--text); }
.climb-add { font-size: 12px; font-weight: 800; fill: #ffffff; }
.climb-xlabel { font-size: 10.5px; font-weight: 700; fill: var(--muted); }
.climb-goal-line { stroke: #1d5fb8; stroke-width: 2; stroke-dasharray: 5 4; }
.climb-goal-label { font-size: 12px; font-weight: 800; fill: #1d5fb8; }
.climb-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }

/* tier table */
.tiers-card { border-radius: var(--radius); padding: 20px; }
.tier-grid { display: flex; flex-direction: column; gap: 10px; }
.tier-row { padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-soft);
  border-left: 4px solid #1f9d5b; }
.tier-row.d1 { border-left-color: #137a47; }
.tier-row.d2 { border-left-color: #1f9d5b; }
.tier-row.d3 { border-left-color: #1d5fb8; }
.tier-row.d4 { border-left-color: #c9781f; }
.tier-row.d5 { border-left-color: #d8531e; }
.tier-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tier-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tier-name { font-family: Sora, Inter, sans-serif; font-weight: 800; font-size: 1rem; color: var(--text); }
.diff-pill { font-size: 0.68rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em;
  text-transform: uppercase; color: #fff; }
.diff-pill.d1 { background: #137a47; }
.diff-pill.d2 { background: #1f9d5b; }
.diff-pill.d3 { background: #1d5fb8; }
.diff-pill.d4 { background: #c9781f; }
.diff-pill.d5 { background: #d8531e; }
.tier-tag { flex-basis: 100%; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.pdot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex: 0 0 auto; }
.pdot.d1 { background: #137a47; } .pdot.d2 { background: #1f9d5b; } .pdot.d3 { background: #1d5fb8; }
.pdot.d4 { background: #c9781f; } .pdot.d5 { background: #d8531e; }
.tier-running { display: flex; align-items: baseline; gap: 8px; }
.run-add { font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.run-total { font-family: Sora, Inter, sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--text); }
.party-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.party-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 7px 5px 11px; border-radius: 999px;
  background: #ffffff; border: 1px solid var(--line); font-size: 0.82rem; font-weight: 600; color: var(--text); }
.party-chip b { font-family: Sora, Inter, sans-serif; min-width: 20px; padding: 1px 7px; border-radius: 999px;
  background: var(--panel-soft); text-align: center; font-size: 0.8rem; }
.party-chip.south { border-color: rgba(216,83,30,0.4); }
.party-chip.south b { background: rgba(216,83,30,0.14); color: #a3380f; }

/* mechanics */
.mech-card { border-radius: var(--radius); padding: 20px; }
.mech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mech-item { padding: 14px 15px; border-radius: 14px; background: var(--panel-soft); border: 1px solid var(--line); }
.mech-item h3 { margin: 0 0 6px; font-family: Sora, Inter, sans-serif; font-size: 0.96rem; font-weight: 800; color: var(--accent); }
.mech-item p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--text); }

/* dead + bottom line */
.bottom-card { border-radius: var(--radius); padding: 20px; }
.dead-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.dead-chip { padding: 5px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--muted);
  background: var(--panel-soft); border: 1px dashed var(--line); }
.bottom-line { margin-top: 16px; padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(120deg, rgba(29,95,184,0.08), rgba(216,83,30,0.06)); border: 1px solid var(--line); }
.bottom-line p:last-child { margin: 0; font-size: 1.02rem; line-height: 1.6; color: var(--text); font-weight: 500; }

@media (max-width: 760px) {
  .tt-gauges { grid-template-columns: 1fr; }
  .mech-grid { grid-template-columns: 1fr; }
  .gauge-card .card-head { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* House toggle (Lok Sabha / Rajya Sabha) + Rajya Sabha resign-and-refill panel */
.house-toggle { display: inline-flex; gap: 4px; padding: 5px; border-radius: 13px;
  background: linear-gradient(120deg, rgba(13,20,36,0.92), rgba(22,33,56,0.90)); margin: 2px 0 14px; box-shadow: var(--shadow-sm); }
.house-pill { padding: 9px 20px; border: 0; border-radius: 9px; background: transparent;
  font-family: Sora, Inter, sans-serif; font-size: 0.92rem; font-weight: 800; color: #aeb9d0; cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease); }
.house-pill:hover { color: #fff; }
.house-pill.active { color: #0d1424; background: linear-gradient(180deg,#ffffff,#e7edf6); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.climb-card .scenario-toggle { margin-left: 10px; }

.refill-panel { margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: var(--panel-soft); border: 1px solid var(--line); }
.refill-note { margin: 0 0 12px; font-size: 0.92rem; line-height: 1.55; color: var(--text); }
.refill-table { display: flex; flex-direction: column; gap: 8px; }
.refill-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px;
  background: #ffffff; border: 1px solid var(--line); }
.rf-resign { font-weight: 700; color: #a3380f; background: rgba(216,83,30,0.10); padding: 3px 10px; border-radius: 999px; font-size: 0.85rem; }
.rf-assembly { display: flex; flex-direction: column; line-height: 1.15; font-size: 0.85rem; }
.rf-assembly b { font-weight: 800; color: var(--text); }
.rf-assembly em { font-style: normal; color: var(--muted); font-size: 0.76rem; font-weight: 600; }
.rf-arrow { color: var(--muted); font-weight: 800; }
.rf-refill { font-weight: 800; color: #137a47; background: rgba(31,157,91,0.12); padding: 3px 12px; border-radius: 999px; font-size: 0.85rem; margin-left: auto; }
.refill-bottom { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 0.96rem; line-height: 1.55; font-weight: 600; color: var(--text); }

@media (max-width: 760px) {
  .rf-refill { margin-left: 0; }
  .house-pill { padding: 9px 15px; }
}
