/* ==========================================================================
   Väljarportal 2026 - Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Colors - Dark theme default */
  --color-bg: #0d0d0d;
  --color-bg-elevated: #1a1a1a;
  --color-bg-card: #242424;
  --color-bg-hover: #2d2d2d;

  --color-text: #f5f5f5;
  --color-text-muted: #a0a0a0;
  --color-text-subtle: #8a8a8a;

  --color-border: #333333;
  --color-border-subtle: #252525;

  --color-accent: #4a9eff;
  --color-accent-hover: #6bb3ff;

  /* Focus ring (WCAG 2.4.7) — used by inputs/selects som tar bort outline */
  --focus-ring: 0 0 0 3px rgba(74, 158, 255, 0.35);

  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-error: #f87171;

  /* 4% threshold line */
  --color-threshold: #ef4444;

  /* Party colors */
  --party-v: #AF0000;
  --party-s: #E8112D;
  --party-mp: #83CF39;
  --party-c: #009933;
  --party-l: #006AB3;
  --party-kd: #1F3C81;
  --party-m: #1B49DD;
  --party-sd: #b8a000;

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;

  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width: 1200px;
  --content-width: 800px;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* Light theme (optional toggle) */
[data-theme="light"] {
  --color-bg: #ffffff;
  --color-bg-elevated: #f8f8f8;
  --color-bg-card: #ffffff;
  --color-bg-hover: #f0f0f0;

  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-text-subtle: #666666;

  --color-border: #e0e0e0;
  --color-border-subtle: #f0f0f0;

  /* Mörkare accent i light mode — #4a9eff mot vit ger bara 3.5:1 (fail WCAG AA
     för text). #1d6fcf ger ~5.4:1 vilket klarar AA för normal text och länkar. */
  --color-accent: #1d6fcf;
  --color-accent-hover: #1557a1;
  --focus-ring: 0 0 0 3px rgba(29, 111, 207, 0.30);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

@media (min-width: 768px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }
}

p {
  margin-bottom: var(--space-4);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-8);
  }
}

section {
  padding: var(--space-16) 0;
}

@media (min-width: 768px) {
  section {
    padding: var(--space-24) 0;
  }
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 13, 13, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--color-text);
  text-decoration: none;
}

.site-logo span {
  color: var(--color-accent);
}

.main-nav {
  display: none;
}

@media (min-width: 1024px) {
  .main-nav {
    display: flex;
    gap: var(--space-6);
  }
}

.main-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) 0;
  position: relative;
}

.main-nav a:hover {
  color: var(--color-text);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  /* WCAG 2.5.5 — minst 44×44 px klickyta */
  width: 44px;
  height: 44px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-accent);
}

.theme-toggle:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Show sun icon in dark mode, moon in light mode */
.theme-icon-light {
  display: none;
}

[data-theme="light"] .theme-icon-dark {
  display: none;
}

[data-theme="light"] .theme-icon-light {
  display: block;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  /* WCAG 2.5.5 Target Size — minst 44×44 px för touch */
  min-width: 44px;
  min-height: 44px;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  padding: var(--space-8);
  z-index: 99;
}

.mobile-nav.is-open {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mobile-nav a {
  font-size: var(--text-lg);
  color: var(--color-text);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  background: linear-gradient(to bottom, var(--color-bg-elevated) 0%, var(--color-bg) 100%);
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero h1 {
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: var(--text-xl);
  }
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.countdown-item {
  text-align: center;
}

.countdown-value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  min-width: 70px;
}

@media (min-width: 768px) {
  .countdown-value {
    font-size: var(--text-4xl);
    padding: var(--space-4) var(--space-6);
    min-width: 90px;
  }
}

.countdown-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-2);
}

/* CTA Buttons */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  /* WCAG 2.5.5 Target Size — säkrar 44×44 px klickyta */
  min-height: 44px;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-accent);
  color: #000;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #000;
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-text-muted);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Quick Guide Section
   -------------------------------------------------------------------------- */
.quick-guide {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.quick-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .quick-guide-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .quick-guide-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.quick-guide-item {
  text-align: center;
  padding: var(--space-6);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.quick-guide-item .number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-accent);
  display: block;
  margin-bottom: var(--space-2);
}

.quick-guide-item .label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Tools Placeholder Sections
   -------------------------------------------------------------------------- */
.tool-section {
  border-bottom: 1px solid var(--color-border-subtle);
}

.tool-placeholder {
  background: var(--color-bg-card);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  text-align: center;
}

.tool-placeholder-icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.tool-placeholder p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Parties Section
   -------------------------------------------------------------------------- */
.parties-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

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

@media (min-width: 1024px) {
  .parties-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.party-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.party-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.party-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.party-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: #fff;
  flex-shrink: 0;
}

.party-logo-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  object-fit: contain;
}

.party-card-header h3 {
  font-size: var(--text-lg);
  margin: 0;
}

.party-card-header .party-leader {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.party-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.party-stat {
  text-align: center;
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.party-stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
}

.party-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.party-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.party-sources {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
  line-height: 1.5;
}

.party-sources a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.party-sources a:hover,
.party-sources a:focus {
  color: var(--color-text);
}

/* Noscript-fallback för sidor som annars kräver JS */
.noscript-fallback {
  padding: var(--space-5);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: var(--space-4);
}

.noscript-fallback p {
  margin-bottom: var(--space-3);
  color: var(--color-text);
  line-height: 1.6;
}

.noscript-parties {
  margin-left: var(--space-5);
  margin-bottom: var(--space-3);
}

.noscript-parties li {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.noscript-fallback a {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Återanvändbar källrad — används av history-source, seatcalc-source m.fl. */
.history-source,
.seatcalc-source {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-subtle);
  line-height: 1.6;
}

.history-source a,
.seatcalc-source a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.history-source a:hover,
.history-source a:focus,
.seatcalc-source a:hover,
.seatcalc-source a:focus {
  color: var(--color-text);
}

/* Metodik-disclosure i quizet */
.quiz-method {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.quiz-method summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.quiz-method summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.2s ease;
  color: var(--color-text-muted);
}

.quiz-method[open] summary::before {
  transform: rotate(90deg);
}

.quiz-method-content {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.quiz-method-content ol {
  margin-left: var(--space-5);
  margin-bottom: var(--space-3);
}

.quiz-method-content li {
  margin-bottom: var(--space-1);
}

.quiz-method-content a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.quiz-method-content a:hover,
.quiz-method-content a:focus {
  color: var(--color-text);
}

.party-ideology {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: var(--space-4);
}

.party-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.party-link svg {
  width: 16px;
  height: 16px;
}

/* Valmanifest-länk: framträdande färgmarkerad så den syns när partier
   släpper sina manifest. Kommer aldrig synas på partikort där
   valmanifest_2026_url är null. */
.party-link-manifest {
  display: inline-flex;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.party-link-manifest:hover,
.party-link-manifest:focus-visible {
  color: var(--color-accent-hover);
}

/* Block indicators */
.party-block {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.party-block.regering {
  background: rgba(74, 158, 255, 0.15);
  color: var(--color-accent);
}

.party-block.opposition {
  background: rgba(160, 160, 160, 0.15);
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Polls Section
   -------------------------------------------------------------------------- */
.polls-section {
  background: var(--color-bg-elevated);
}

.polls-container {
  max-width: var(--content-width);
  margin: 0 auto;
}

.poll-chart {
  margin-bottom: var(--space-8);
}

.poll-bar-container {
  margin-bottom: var(--space-4);
}

.poll-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.poll-bar-party {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.poll-bar-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.poll-bar-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
}

.poll-bar-name {
  font-size: var(--text-sm);
  font-weight: 500;
}

.poll-bar-value {
  font-family: var(--font-display);
  font-weight: 600;
}

.poll-bar-track {
  height: 8px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.poll-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* 4% threshold line */
.poll-threshold {
  position: absolute;
  left: calc(4% / 35 * 100%); /* 4% of max ~35% */
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-threshold);
}

.poll-threshold-label {
  position: absolute;
  left: calc(4% / 35 * 100%);
  top: -20px;
  transform: translateX(-50%);
  font-size: var(--text-xs);
  color: var(--color-threshold);
  white-space: nowrap;
}

.poll-meta {
  text-align: center;
  padding: var(--space-4);
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
}

.poll-meta p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.poll-meta .update-date {
  font-weight: 500;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   About Section
   -------------------------------------------------------------------------- */
.about-section {
  border-top: 1px solid var(--color-border-subtle);
}

.about-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.about-grid {
  display: grid;
  gap: var(--space-8);
}

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

.about-item h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.about-item p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer-meta {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

/* --------------------------------------------------------------------------
   Political Compass
   -------------------------------------------------------------------------- */
.compass-section {
  background: var(--color-bg);
}

.compass-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.compass-controls {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.compass-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.compass-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.compass-toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition-base);
}

.compass-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-text-muted);
  border-radius: 50%;
  transition: all var(--transition-base);
}

.compass-toggle input:checked + .compass-toggle-slider {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.compass-toggle input:checked + .compass-toggle-slider::after {
  left: 22px;
  background: #000;
}

.compass-toggle input:focus-visible + .compass-toggle-slider {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.compass-toggle-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.compass-svg-container {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.compass-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  display: block;
}

.compass-party {
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.compass-party:hover .compass-party-circle,
.compass-party:focus .compass-party-circle {
  filter: brightness(1.2);
}

.compass-party:hover {
  outline: none;
}

.compass-party:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .compass-party:hover {
    transform: scale(1.1);
  }
}

.compass-legend {
  text-align: center;
  margin-bottom: var(--space-4);
}

.compass-legend-hint {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  margin: 0;
}

.compass-disclaimer {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.compass-disclaimer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.compass-disclaimer-toggle:hover {
  color: var(--color-text);
}

.compass-disclaimer-toggle svg {
  flex-shrink: 0;
}

.compass-disclaimer-content {
  display: none;
  padding: 0 var(--space-4) var(--space-4);
}

.compass-disclaimer.is-open .compass-disclaimer-content {
  display: block;
}

.compass-disclaimer-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.compass-disclaimer-sources {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin: 0;
}

/* Compass Tooltip */
.compass-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 320px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.compass-tooltip-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.compass-tooltip-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.compass-tooltip-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
}

.compass-tooltip-motivation {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.compass-tooltip-coords {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-xs);
  font-family: var(--font-display);
  color: var(--color-text-subtle);
  margin-bottom: var(--space-2);
}

.compass-tooltip-source {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin: 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
}

/* --------------------------------------------------------------------------
   Quiz Section
   -------------------------------------------------------------------------- */
.quiz-section {
  background: var(--color-bg-elevated);
}

.quiz-wrapper {
  max-width: 700px;
  margin: 0 auto;
}

/* Quiz Start Screen */
.quiz-start {
  text-align: center;
  padding: var(--space-8);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.quiz-start-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.quiz-start h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.quiz-start-description {
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto var(--space-6);
}

.quiz-categories {
  margin-bottom: var(--space-6);
}

.quiz-categories-label {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  margin-bottom: var(--space-3);
}

.quiz-categories-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.quiz-category-tag {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}

.quiz-info {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.quiz-info-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.quiz-start-btn {
  margin-bottom: var(--space-4);
}

.quiz-resume-prompt {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  text-align: center;
}

.quiz-resume-text {
  margin: 0 0 var(--space-4) 0;
  font-size: var(--text-sm);
}

.quiz-resume-buttons {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.quiz-disclaimer-note {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin: 0;
}

/* Quiz Question */
.quiz-question-container {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.quiz-progress {
  margin-bottom: var(--space-6);
}

.quiz-progress-bar {
  height: 4px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.quiz-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.quiz-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.quiz-progress-category {
  font-size: var(--text-xs);
}

.quiz-question {
  margin-bottom: var(--space-6);
}

.quiz-statement {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: var(--leading-normal);
  text-align: center;
}

@media (min-width: 640px) {
  .quiz-statement {
    font-size: var(--text-2xl);
  }
}

/* Answer Options */
.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.quiz-answer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-answer:hover {
  border-color: var(--color-text-muted);
}

.quiz-answer.is-selected {
  border-color: var(--color-accent);
  background: rgba(74, 158, 255, 0.1);
}

.quiz-answer input {
  position: absolute;
  opacity: 0;
}

.quiz-answer-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition-fast);
}

.quiz-answer.is-selected .quiz-answer-radio {
  border-color: var(--color-accent);
}

.quiz-answer.is-selected .quiz-answer-radio::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
}

.quiz-answer input:focus-visible + .quiz-answer-radio {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.quiz-answer-label {
  font-size: var(--text-base);
}

/* Important Toggle */
.quiz-important-toggle {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: var(--space-6);
}

.quiz-important-toggle input {
  position: absolute;
  opacity: 0;
}

.quiz-important-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition-fast);
}

.quiz-important-toggle input:checked + .quiz-important-checkbox {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.quiz-important-toggle input:checked + .quiz-important-checkbox::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #000;
  font-weight: bold;
}

.quiz-important-toggle input:focus-visible + .quiz-important-checkbox {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.quiz-important-label strong {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.quiz-important-label small {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Navigation */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.quiz-nav button {
  flex: 1;
}

.quiz-nav-prev:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quiz-skip-info {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin: 0;
}

/* Quiz Results */
.quiz-results {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.quiz-results-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.quiz-results-header h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.quiz-results-summary {
  color: var(--color-text-muted);
  margin: 0;
}

/* Match List */
.quiz-matches {
  margin-bottom: var(--space-8);
}

.quiz-matches h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.quiz-match-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.quiz-match-item {
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.quiz-match-item.is-top {
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid var(--color-accent);
}

.quiz-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.quiz-match-party {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.quiz-match-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
}

.quiz-match-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.quiz-match-name {
  font-weight: 500;
}

.quiz-match-percent {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.quiz-match-bar {
  height: 8px;
  background: var(--color-bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.quiz-match-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.quiz-match-details-btn {
  background: none;
  border: none;
  font-size: var(--text-sm);
  color: var(--color-accent);
  cursor: pointer;
  padding: 0;
}

.quiz-match-details-btn:hover {
  text-decoration: underline;
}

.quiz-match-details {
  display: none;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}

.quiz-match-details.is-open {
  display: block;
}

/* Question Comparison */
.quiz-comparison-category {
  margin-bottom: var(--space-4);
}

.quiz-comparison-category h5 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
}

.quiz-comparison-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: var(--text-sm);
}

.quiz-comparison-item:last-child {
  border-bottom: none;
}

.quiz-comparison-item.perfect {
  background: rgba(74, 222, 128, 0.1);
  margin: 0 calc(-1 * var(--space-2));
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  border-radius: var(--radius-sm);
}

.quiz-comparison-item.disagree {
  opacity: 0.7;
}

.quiz-comparison-statement {
  flex: 1;
  color: var(--color-text-muted);
}

.quiz-comparison-values {
  display: flex;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.quiz-comparison-user {
  color: var(--color-accent);
}

.quiz-comparison-party {
  color: var(--color-text-subtle);
}

/* Compass Result */
.quiz-compass-result {
  margin-bottom: var(--space-8);
}

.quiz-compass-result h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.quiz-compass-container {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.quiz-compass-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  max-width: 400px;
  margin: 0 auto;
  display: block;
}

.quiz-compass-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.quiz-compass-you {
  color: var(--color-accent);
}

/* Pulse animation for user marker */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.3); opacity: 0.1; }
  100% { transform: scale(1); opacity: 0.3; }
}

.pulse-ring {
  animation: pulse-ring 2s ease-in-out infinite;
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-ring {
    animation: none;
  }
}

/* Share */
.quiz-share {
  margin-bottom: var(--space-6);
}

.quiz-share h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.quiz-share-url {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.quiz-share-url input {
  flex: 1;
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: var(--font-body);
}

.quiz-share-url input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.quiz-share-note {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin: 0;
}

/* Actions */
.quiz-actions {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.quiz-actions .btn {
  flex: 1;
}

/* Results Disclaimer */
.quiz-results-disclaimer {
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  text-align: center;
}

.quiz-results-disclaimer p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Compare Section (Sakfråge-jämförelse)
   -------------------------------------------------------------------------- */
.compare-section {
  background: var(--color-bg);
}

.compare-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

/* Party Selector */
.compare-party-selector {
  margin-bottom: var(--space-6);
}

.compare-selector-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  text-align: center;
}

.compare-party-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.compare-party-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 80px;
}

.compare-party-btn:hover {
  border-color: var(--color-text-muted);
}

.compare-party-btn.is-selected {
  border-color: var(--party-color);
  background: color-mix(in srgb, var(--party-color) 15%, transparent);
}

.compare-party-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.compare-party-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
}

.compare-party-abbr {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--party-color);
  color: var(--party-text);
}

.compare-party-name {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .compare-party-btn {
    min-width: 60px;
    padding: var(--space-2);
  }

  .compare-party-name {
    display: none;
  }
}

/* Category Filter */
.compare-category-filter {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.compare-category-select {
  padding: var(--space-3) var(--space-4);
  padding-right: var(--space-8);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-base);
  font-family: var(--font-body);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0a0'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.compare-category-select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* Issues List */
.compare-issues {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.compare-no-issues {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-8);
}

/* Issue Card */
.compare-issue {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.compare-issue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.compare-issue-header:hover {
  background: var(--color-bg-hover);
}

.compare-issue-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.compare-issue-category {
  font-size: var(--text-lg);
}

.compare-issue-title h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}

@media (min-width: 640px) {
  .compare-issue-title h3 {
    font-size: var(--text-lg);
  }
}

.compare-issue-expand {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: var(--space-2);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.compare-issue.is-expanded .compare-issue-expand {
  transform: rotate(180deg);
}

/* Quick Stance Indicators */
.compare-stances-quick {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-4);
  flex-wrap: wrap;
}

.compare-stance-quick {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.compare-stance-party {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  padding: 2px 6px;
  border-radius: 3px;
}

.compare-stance-icon {
  font-size: var(--text-base);
}

/* Stance Colors */
.stance-for .compare-stance-icon { color: var(--color-success); }
.stance-partial-for .compare-stance-icon { color: #86efac; }
.stance-neutral .compare-stance-icon { color: var(--color-text-muted); }
.stance-partial-against .compare-stance-icon { color: #fca5a5; }
.stance-against .compare-stance-icon { color: var(--color-error); }

/* Issue Details (Expanded) */
.compare-issue-details {
  display: none;
  padding: var(--space-4);
  padding-top: 0;
  border-top: 1px solid var(--color-border-subtle);
}

.compare-issue.is-expanded .compare-issue-details {
  display: block;
}

.compare-position {
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.compare-position:last-child {
  margin-bottom: 0;
}

.compare-position-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.compare-position-party {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.compare-position-name {
  font-weight: 500;
  font-size: var(--text-sm);
}

.compare-position-stance {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  margin-left: auto;
}

.compare-position-stance.stance-for {
  background: rgba(74, 222, 128, 0.2);
  color: var(--color-success);
}

.compare-position-stance.stance-partial-for {
  background: rgba(134, 239, 172, 0.2);
  color: #86efac;
}

.compare-position-stance.stance-neutral {
  background: rgba(160, 160, 160, 0.2);
  color: var(--color-text-muted);
}

.compare-position-stance.stance-partial-against {
  background: rgba(252, 165, 165, 0.2);
  color: #fca5a5;
}

.compare-position-stance.stance-against {
  background: rgba(248, 113, 113, 0.2);
  color: var(--color-error);
}

.compare-position-summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2);
}

.compare-position-source {
  font-size: var(--text-xs);
  color: var(--color-accent);
}

/* Legend */
.compare-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.compare-legend-title {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.compare-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.compare-legend-icon {
  font-size: var(--text-base);
}

/* --------------------------------------------------------------------------
   Timeline Section
   -------------------------------------------------------------------------- */
.timeline-section {
  background: var(--color-bg-elevated);
}

.timeline-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* Filters */
.timeline-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.timeline-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

@media (min-width: 640px) {
  .timeline-filter-group {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
  }
}

.timeline-filter-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.timeline-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.timeline-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.timeline-filter-btn:hover {
  border-color: var(--color-text-muted);
}

.timeline-filter-btn.is-active {
  border-color: var(--filter-color, var(--color-accent));
  background: color-mix(in srgb, var(--filter-color, var(--color-accent)) 15%, transparent);
  color: var(--color-text);
}

.timeline-filter-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.timeline-filter-btn.party-btn {
  font-family: var(--font-display);
  font-weight: 700;
  padding: var(--space-2);
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.timeline-filter-icon {
  font-size: var(--text-base);
}

.timeline-filter-text {
  display: none;
}

@media (min-width: 768px) {
  .timeline-filter-text {
    display: inline;
  }
}

/* Timeline container */
.timeline-container {
  position: relative;
  margin-bottom: var(--space-6);
}

.timeline-track {
  position: relative;
}

/* Year groups */
.timeline-year {
  position: relative;
  margin-bottom: var(--space-8);
}

.timeline-year:last-child {
  margin-bottom: 0;
}

.timeline-year-label {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.timeline-year-events {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  padding-left: var(--space-6);
}

/* Timeline line */
.timeline-year-events::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

/* Event cards */
.timeline-event {
  position: relative;
  display: flex;
  gap: var(--space-4);
}

.timeline-event-marker {
  position: absolute;
  left: calc(-1 * var(--space-6) - 2px);
  top: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--event-color, var(--color-bg-card));
  border: 2px solid var(--color-bg);
  border-radius: 50%;
  z-index: 1;
}

.timeline-event-icon {
  font-size: var(--text-sm);
}

.timeline-event-content {
  flex: 1;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

.timeline-event-content:hover {
  box-shadow: var(--shadow-md);
}

.timeline-event-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
}

.timeline-event-header:hover {
  background: var(--color-bg-hover);
}

.timeline-event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
  padding: var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  text-align: center;
}

.timeline-event-date .date-day {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1;
}

.timeline-event-date .date-month {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.timeline-event-title-wrap {
  flex: 1;
  min-width: 0;
}

.timeline-event-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 var(--space-2);
  line-height: var(--leading-tight);
}

@media (min-width: 640px) {
  .timeline-event-title {
    font-size: var(--text-lg);
  }
}

.timeline-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.timeline-event-type,
.timeline-event-party {
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: #fff;
}

.timeline-event-party {
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.timeline-party-logo {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: contain;
}

.timeline-event-toggle {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: var(--space-2);
  cursor: pointer;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.timeline-event.is-expanded .timeline-event-toggle {
  transform: rotate(180deg);
}

/* Event details */
.timeline-event-details {
  display: none;
  padding: 0 var(--space-4) var(--space-4);
  padding-top: 0;
  border-top: 1px solid var(--color-border-subtle);
}

.timeline-event.is-expanded .timeline-event-details {
  display: block;
  padding-top: var(--space-4);
}

.timeline-event-summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.timeline-event-source {
  font-size: var(--text-xs);
  color: var(--color-accent);
}

/* Meta */
.timeline-meta {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

/* Felmeddelande för verktyg som inte kunde ladda data */
.error {
  padding: var(--space-5);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-align: center;
}

.error::before {
  content: "⚠ ";
  color: var(--color-error);
  font-weight: 700;
  margin-right: var(--space-1);
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: #000;
  padding: var(--space-2) var(--space-4);
  z-index: 200;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* --------------------------------------------------------------------------
   Coalition Builder
   -------------------------------------------------------------------------- */
.coalition-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

/* Source toggle */
.coalition-source-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.coalition-source-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.coalition-source-buttons {
  display: flex;
  gap: var(--space-2);
}

.coalition-source-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.coalition-source-btn:hover {
  background: var(--color-bg-hover);
}

.coalition-source-btn.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #000;
}

/* Seat meter */
.coalition-meter {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.coalition-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.coalition-meter-title {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.coalition-meter-count {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.coalition-meter-count.has-majority {
  color: var(--color-success);
}

.coalition-meter-bar {
  position: relative;
  height: 24px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: visible;
}

.coalition-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.coalition-meter-fill.has-majority {
  background: linear-gradient(90deg, var(--color-success), #4ade80);
}

.coalition-meter-threshold {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 3px;
  background: var(--color-error);
  transform: translateX(-50%);
}

.coalition-meter-threshold-label {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-error);
  white-space: nowrap;
}

.coalition-meter-status {
  margin-top: var(--space-4);
  text-align: center;
}

.coalition-status-success {
  color: var(--color-success);
  font-weight: 600;
}

.coalition-status-pending {
  color: var(--color-text-muted);
}

/* Party selector */
.coalition-parties {
  margin-bottom: var(--space-6);
}

.coalition-parties h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.coalition-party-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .coalition-party-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.coalition-party-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.coalition-party-card:hover {
  background: var(--color-bg-hover);
  border-color: var(--party-color, var(--color-border));
}

.coalition-party-card.is-selected {
  background: color-mix(in srgb, var(--party-color) 15%, var(--color-bg-card));
  border-color: var(--party-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--party-color) 30%, transparent);
}

.coalition-party-card.under-threshold {
  opacity: 0.7;
}

.coalition-party-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
}

.coalition-party-name {
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  color: var(--color-text);
}

.coalition-party-seats {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.coalition-party-warning {
  font-size: var(--text-xs);
  color: var(--color-error);
  font-weight: 500;
}

/* Coalition summary */
.coalition-summary {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.coalition-summary h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.coalition-summary-parties {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.coalition-summary-party {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.coalition-summary-badge {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.coalition-summary-seats {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.coalition-summary-plus,
.coalition-summary-equals {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-muted);
}

.coalition-summary-total {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.coalition-summary-total.has-majority {
  color: var(--color-success);
  background: color-mix(in srgb, var(--color-success) 15%, var(--color-bg));
}

/* Preset coalitions */
.coalition-presets {
  margin-bottom: var(--space-6);
}

.coalition-presets h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.coalition-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

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

.coalition-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.coalition-preset-btn:hover {
  background: var(--color-bg-hover);
}

.coalition-preset-btn.is-active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.coalition-preset-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.coalition-preset-parties {
  display: flex;
  gap: var(--space-1);
}

.coalition-preset-parties span {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Coalition info */
.coalition-info {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Guess the Party Quiz
   -------------------------------------------------------------------------- */
.guess-intro {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.guess-intro-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

.guess-intro h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.guess-intro p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Progress */
.guess-progress {
  margin-bottom: var(--space-6);
}

.guess-progress-bar {
  height: 6px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.guess-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.guess-progress-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

/* Quote */
.guess-quote {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  position: relative;
}

.guess-quote-mark {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.3;
}

.guess-quote-text {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  font-style: italic;
  padding-left: var(--space-8);
}

@media (min-width: 640px) {
  .guess-quote-text {
    font-size: var(--text-2xl);
  }
}

/* Options */
.guess-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

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

.guess-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.guess-option:hover:not(:disabled) {
  border-color: var(--party-color);
  background: color-mix(in srgb, var(--party-color) 10%, var(--color-bg-card));
}

.guess-option:disabled {
  cursor: default;
  opacity: 0.6;
}

.guess-option.is-correct {
  border-color: var(--color-success);
  background: color-mix(in srgb, var(--color-success) 15%, var(--color-bg-card));
  opacity: 1;
}

.guess-option.is-wrong {
  border-color: var(--color-error);
  background: color-mix(in srgb, var(--color-error) 15%, var(--color-bg-card));
  opacity: 1;
}

.guess-option-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
}

.guess-option-name {
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  color: var(--color-text);
}

@media (min-width: 640px) {
  .guess-option-name {
    font-size: var(--text-sm);
  }
}

/* Feedback */
.guess-feedback-box {
  text-align: center;
  padding: var(--space-6);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.guess-feedback-box.is-correct {
  border-color: var(--color-success);
}

.guess-feedback-box.is-wrong {
  border-color: var(--color-error);
}

.guess-feedback-icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-2);
}

.guess-feedback-box.is-correct .guess-feedback-icon {
  color: var(--color-success);
}

.guess-feedback-box.is-wrong .guess-feedback-icon {
  color: var(--color-error);
}

.guess-feedback-text {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.guess-feedback-source {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* Results */
.guess-results {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.guess-results-emoji {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

.guess-results h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.guess-results-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.guess-results-number {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--color-accent);
}

.guess-results-total {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
}

.guess-results-percent {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.guess-results-message {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

/* --------------------------------------------------------------------------
   Poll Graph
   -------------------------------------------------------------------------- */
.section-subheader {
  margin-top: var(--space-12);
  margin-bottom: var(--space-6);
}

.section-subheader h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
}

.pollgraph-wrapper {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* Filter */
.pollgraph-filter {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.pollgraph-filter-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.pollgraph-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pollgraph-filter-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.5;
}

.pollgraph-filter-btn:hover {
  opacity: 0.8;
}

.pollgraph-filter-btn.is-active {
  opacity: 1;
  border-color: var(--party-color);
  background: color-mix(in srgb, var(--party-color) 15%, var(--color-bg));
}

.pollgraph-filter-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: contain;
}

/* Graph container */
.pollgraph-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

.pollgraph-svg {
  width: 100%;
  min-width: 600px;
  height: auto;
}

/* Info */
.pollgraph-info {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Mobile Improvements
   -------------------------------------------------------------------------- */

/* Better touch targets on mobile */
@media (max-width: 640px) {
  /* Poll graph filter buttons */
  .pollgraph-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .pollgraph-filter-buttons {
    justify-content: center;
  }

  .pollgraph-filter-btn {
    padding: var(--space-2) var(--space-3);
  }

  /* Guess quiz options - larger touch targets */
  .guess-option {
    padding: var(--space-4);
    min-height: 80px;
  }

  .guess-option-logo {
    width: 36px;
    height: 36px;
  }

  /* Quiz answer buttons */
  .quiz-answer-btn {
    padding: var(--space-3);
    min-height: 48px;
  }

  /* Coalition party cards */
  .coalition-party-card {
    padding: var(--space-3);
  }

  .coalition-party-logo {
    width: 40px;
    height: 40px;
  }

  .coalition-party-name {
    font-size: var(--text-xs);
  }

  /* Quote text smaller on mobile */
  .guess-quote {
    padding: var(--space-4);
  }

  .guess-quote-text {
    font-size: var(--text-lg);
    padding-left: var(--space-6);
  }

  .guess-quote-mark {
    font-size: 3rem;
  }

  /* Timeline compact on mobile */
  .timeline-event-header {
    padding: var(--space-3);
  }

  .timeline-event-title {
    font-size: var(--text-base);
  }

  /* Navigation overflow prevention */
  .main-nav {
    display: none;
  }

  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }

  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  /* Section headers smaller */
  .section-header h2 {
    font-size: var(--text-2xl);
  }

  /* Countdown compact */
  .countdown {
    gap: var(--space-2);
  }

  .countdown-value {
    font-size: var(--text-3xl);
  }

  /* Poll bars with logo */
  .poll-bar-logo {
    width: 24px;
    height: 24px;
  }

  .poll-bar-name {
    font-size: var(--text-sm);
  }

  /* Compare party buttons compact */
  .compare-party-btn {
    min-width: 50px;
    padding: var(--space-2);
  }

  .compare-party-logo {
    width: 28px;
    height: 28px;
  }

  /* About grid single column */
  .about-grid {
    grid-template-columns: 1fr;
  }

  /* Quick guide items */
  .quick-guide-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .quick-guide-item .number {
    font-size: var(--text-3xl);
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .countdown-item {
    min-width: 60px;
  }

  .countdown-value {
    font-size: var(--text-2xl);
  }

  .countdown-label {
    font-size: var(--text-xs);
  }

  .coalition-party-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .guess-options {
    gap: var(--space-2);
  }

  .cta-group {
    flex-direction: column;
    gap: var(--space-3);
  }

  .cta-group .btn {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   Votes Section - Riksdagsröstningar
   ========================================================================== */

.votes-section {
  background: var(--color-bg);
}

.votes-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Filters */
.votes-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.votes-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.votes-filter-group label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.votes-select {
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
  min-width: 200px;
}

.votes-select:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.votes-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.votes-tag-btn {
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.votes-tag-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.votes-tag-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* Stats */
.votes-stats {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.votes-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.votes-stat .stat-number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-accent);
}

.votes-stat .stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Vote List */
.votes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.votes-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-8);
}

/* Vote Card */
.vote-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.vote-card:hover {
  border-color: var(--color-border-subtle);
}

.vote-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.vote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.vote-date,
.vote-committee,
.vote-category {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
}

.vote-committee {
  background: var(--color-accent);
  background: rgba(74, 158, 255, 0.15);
  color: var(--color-accent);
}

.vote-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-2) 0;
}

.vote-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.vote-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.vote-tag {
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-bg-hover);
  color: var(--color-text-subtle);
}

/* Vote Breakdown */
.vote-breakdown {
  padding: var(--space-4);
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.breakdown-party {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  border-left: 3px solid var(--party-color, var(--color-border));
}

.breakdown-party.ja {
  background: rgba(74, 222, 128, 0.1);
}

.breakdown-party.nej {
  background: rgba(248, 113, 113, 0.1);
}

.breakdown-party.avstar {
  background: rgba(251, 191, 36, 0.1);
}

.breakdown-party-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.breakdown-bar {
  display: flex;
  height: 6px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-bg-card);
}

.breakdown-ja {
  background: var(--color-success);
}

.breakdown-nej {
  background: var(--color-error);
}

.breakdown-avstar {
  background: var(--color-warning);
}

.breakdown-summary {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.breakdown-summary .ja {
  color: var(--color-success);
}

.breakdown-summary .nej {
  color: var(--color-error);
}

.breakdown-summary .avstar {
  color: var(--color-warning);
}

.breakdown-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.legend-item::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-item.ja::before {
  background: var(--color-success);
}

.legend-item.nej::before {
  background: var(--color-error);
}

.legend-item.avstar::before {
  background: var(--color-warning);
}

/* Vote Footer */
.vote-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
}

.vote-result {
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.vote-result-passed {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
}

.vote-result-rejected {
  background: rgba(248, 113, 113, 0.15);
  color: var(--color-error);
}

.vote-source {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.vote-source:hover {
  color: var(--color-accent);
}

/* Party Comparison */
.votes-party-comparison {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.votes-party-comparison h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
}

.votes-comparison-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4) 0;
}

.votes-party-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
}

.party-stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  border-left: 3px solid var(--party-color, var(--color-border));
}

.party-stat-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.party-stat-logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.party-stat-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
}

.party-stat-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.party-stat-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

.party-stat-bar .party-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 90px;
}

.party-stat-fill {
  height: 6px;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.party-stat-fill.ja {
  background: var(--color-success);
}

.party-stat-fill.nej {
  background: var(--color-error);
}

.party-stat-bar .party-stat-value {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  min-width: 35px;
  text-align: right;
}

.party-stat-count {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin-top: var(--space-2);
  text-align: center;
}

/* Votes Disclaimer */
.votes-disclaimer {
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.votes-disclaimer p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

.votes-disclaimer strong {
  color: var(--color-text);
}

/* Responsive - Votes Section */
@media (max-width: 768px) {
  .votes-filters {
    flex-direction: column;
  }

  .votes-select {
    width: 100%;
    min-width: auto;
  }

  .votes-stats {
    flex-direction: column;
    align-items: center;
  }

  .breakdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .vote-footer {
    flex-direction: column;
    gap: var(--space-2);
  }

  .votes-party-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .votes-party-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Budget Section
   -------------------------------------------------------------------------- */
.budget-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* Budget Summary Cards */
.budget-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
}

.budget-summary-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
}

.budget-summary-card.gov {
  border-left: 4px solid var(--color-accent);
}

.budget-summary-card.party {
  border-left: 4px solid var(--party-color);
}

.summary-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.summary-value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.summary-value.positive {
  color: #22c55e;
}

.summary-value.negative {
  color: #ef4444;
}

/* Budget Controls */
.budget-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.budget-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}

.budget-party-selector {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.budget-party-toggles {
  display: flex;
  gap: var(--space-2);
}

.budget-party-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.budget-party-toggle:hover {
  border-color: var(--party-color);
}

.budget-party-toggle.active {
  background: color-mix(in srgb, var(--party-color) 15%, transparent);
  border-color: var(--party-color);
}

.budget-party-toggle input {
  display: none;
}

.toggle-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
}

.budget-filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.budget-filter-group label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.budget-select {
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
}

.budget-select:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

/* Budget Highlights */
.budget-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-3);
}

.budget-highlight {
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.budget-highlight strong {
  font-size: var(--text-sm);
  color: var(--color-accent);
}

.budget-highlight span {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Budget Table */
.budget-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.budget-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.budget-table th,
.budget-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.budget-table thead {
  background: var(--color-bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.budget-table th {
  font-weight: 600;
  white-space: nowrap;
}

.th-unit {
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.col-area {
  min-width: 200px;
}

.col-gov {
  text-align: right;
  min-width: 100px;
}

.col-party {
  text-align: right;
  min-width: 90px;
  border-left: 3px solid var(--party-color, var(--color-border));
}

.budget-table tbody tr {
  transition: background var(--transition-fast);
}

.budget-table tbody tr:hover {
  background: var(--color-bg-elevated);
}

.area-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.area-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.area-name {
  font-weight: 500;
}

.area-category {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.gov-value {
  font-family: var(--font-display);
  font-weight: 600;
}

.diff-value {
  font-family: var(--font-display);
  font-weight: 600;
}

.col-party.positive .diff-value {
  color: #22c55e;
}

.col-party.negative .diff-value {
  color: #ef4444;
}

.col-party.neutral .diff-value {
  color: var(--color-text-muted);
}

.diff-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: var(--space-2);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  /* WCAG 2.5.5 — utöka klickytan till 44×44 via pseudo-element utan att
     ändra visuell 18×18-design (cirkel-ikon i tabellrad) */
  position: relative;
}

.diff-info-btn::before {
  content: "";
  position: absolute;
  inset: -13px;
}

.diff-info-btn:hover {
  background: var(--party-color);
  color: white;
  border-color: var(--party-color);
}

.total-row {
  background: var(--color-bg-card);
}

.total-row td {
  border-bottom: none;
}

/* Budget Party Cards */
.budget-party-details {
  margin-top: var(--space-4);
}

.budget-party-details h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.budget-party-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.budget-party-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border-top: 4px solid var(--party-color);
}

.budget-party-card .party-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg-elevated);
}

.party-card-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.party-card-title h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  margin: 0;
}

.party-motion-title {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

.party-card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.party-card-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--party-color);
}

.party-card-priorities {
  font-size: var(--text-sm);
}

.priorities-label,
.financing-label {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.party-card-priorities ul {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
}

.party-card-priorities li {
  padding: var(--space-1) 0;
  padding-left: var(--space-4);
  position: relative;
}

.party-card-priorities li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--party-color);
  border-radius: 50%;
}

.party-card-financing {
  font-size: var(--text-sm);
}

.party-card-financing span {
  color: var(--color-text-muted);
}

.party-card-footer {
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.party-motion-link {
  display: block;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
}

.party-motion-link:hover {
  text-decoration: underline;
}

/* Budget Category Chart */
.budget-viz-section {
  margin-top: var(--space-4);
}

.budget-viz-section h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.budget-category-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.category-chart-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.category-chart-label {
  width: 140px;
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: 600;
}

.category-chart-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.category-bar {
  height: 24px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 var(--space-2);
  min-width: fit-content;
}

.category-bar.gov {
  background: linear-gradient(90deg, var(--color-accent), #a855f7);
}

.bar-value {
  font-size: var(--text-xs);
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.category-diffs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.category-diff {
  font-size: var(--text-xs);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  border: 1px solid var(--party-color);
}

.category-diff.positive {
  color: #22c55e;
}

.category-diff.negative {
  color: #ef4444;
}

/* Budget Modal */
.budget-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}

.budget-modal {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 500px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.budget-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  font-size: var(--text-2xl);
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
}

.budget-modal-close:hover {
  color: var(--color-text);
}

.budget-modal h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: var(--space-2);
  padding-right: var(--space-8);
}

.area-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.modal-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.modal-gov,
.modal-party {
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  text-align: center;
}

.modal-party {
  border-left: 4px solid var(--party-color);
}

.modal-gov .label,
.modal-party .label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.modal-gov .value,
.modal-party .value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
}

.modal-comment {
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.modal-comment strong {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.modal-comment p {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
}

/* Budget Disclaimer */
.budget-disclaimer {
  padding: var(--space-4);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.budget-disclaimer p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

.budget-disclaimer p + p {
  margin-top: var(--space-2);
}

.budget-disclaimer strong {
  color: var(--color-text);
}

.budget-disclaimer a {
  color: var(--color-accent);
}

.budget-disclaimer a:hover {
  text-decoration: underline;
}

/* Responsive - Budget Section */
@media (max-width: 768px) {
  .budget-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .budget-party-selector {
    flex-direction: column;
    align-items: flex-start;
  }

  .budget-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .budget-highlights {
    grid-template-columns: 1fr;
  }

  .category-chart-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .category-chart-label {
    width: auto;
  }

  .category-chart-bars {
    width: 100%;
  }

  .modal-comparison {
    grid-template-columns: 1fr;
  }

  .budget-party-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .budget-party-toggles {
    flex-wrap: wrap;
  }

  .budget-summary {
    grid-template-columns: 1fr;
  }

  .col-area {
    min-width: 150px;
  }

  .col-gov,
  .col-party {
    min-width: 70px;
  }
}

/* --------------------------------------------------------------------------
   Election History Section
   -------------------------------------------------------------------------- */
.history-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* History Tabs */
.history-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.history-tab {
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-tab:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.history-tab.active {
  background: var(--color-accent);
  color: white;
}

/* Comparison View */
.history-comparison h3,
.history-eu h3,
.history-leaders h3,
.history-constituencies h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

/* Trends */
.history-trends {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.trend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.trend-party {
  font-family: var(--font-display);
  font-weight: 700;
}

.trend-arrow {
  font-size: var(--text-lg);
}

.trend-item.trend-up .trend-arrow {
  color: #22c55e;
}

.trend-item.trend-down .trend-arrow {
  color: #ef4444;
}

.trend-item.trend-stable .trend-arrow {
  color: var(--color-text-muted);
}

.trend-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Comparison Chart */
.comparison-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.comparison-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.comparison-party {
  width: 40px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--party-color);
}

.comparison-bars {
  flex: 1;
}

.comparison-bar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comparison-bar {
  height: 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 var(--space-2);
  min-width: fit-content;
}

.comparison-bar span {
  font-size: 10px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.comparison-bar.bar-2018 {
  background: rgba(255, 255, 255, 0.2);
}

.comparison-bar.bar-2022 {
  background: rgba(255, 255, 255, 0.4);
}

.comparison-bar.bar-now {
  /* Background set dynamically via party color */
}

.comparison-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.comparison-legend .legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.comparison-legend .legend-color {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
}

.comparison-legend .legend-color.bar-2018 {
  background: rgba(255, 255, 255, 0.2);
}

.comparison-legend .legend-color.bar-2022 {
  background: rgba(255, 255, 255, 0.4);
}

.comparison-legend .legend-color.bar-now {
  background: var(--color-accent);
}

/* Block Comparison */
.block-comparison {
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.block-comparison h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.block-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.block-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.block-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.block-bar-container {
  display: flex;
  height: 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.block-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: white;
}

.block-bar.left {
  background: linear-gradient(90deg, #E8112D, #AF0000);
}

.block-bar.right {
  background: linear-gradient(90deg, #1B49DD, #DDDD00);
}

.block-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}

.block-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: var(--space-1);
}

.block-dot.left {
  background: #E8112D;
}

.block-dot.right {
  background: #1B49DD;
}

/* Turnout */
.turnout-comparison {
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.turnout-comparison h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.turnout-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.turnout-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.turnout-label {
  width: 50px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.turnout-bar {
  height: 24px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
}

.turnout-value {
  font-family: var(--font-display);
  font-weight: 600;
}

/* EU 2024 View */
.eu-subtitle {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.eu-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.eu-highlight {
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.eu-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.eu-party-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--party-color);
  position: relative;
  overflow: hidden;
}

.eu-party-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  z-index: 1;
}

.eu-party-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.eu-party-name {
  font-family: var(--font-display);
  font-weight: 700;
}

.eu-party-stats {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: 1;
}

.eu-pct {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
}

.eu-change {
  font-size: var(--text-sm);
}

.eu-change.positive {
  color: #22c55e;
}

.eu-change.negative {
  color: #ef4444;
}

.eu-seats {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.eu-bar {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  opacity: 0.15;
}

.eu-vs-riksdag {
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.eu-vs-riksdag h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.eu-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.eu-source {
  text-align: center;
}

.eu-source a {
  font-size: var(--text-sm);
  color: var(--color-accent);
}

/* Leaders View */
.leaders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.leader-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border-top: 4px solid var(--party-color);
}

.leader-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg-elevated);
}

.leader-party-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.leader-party-info {
  display: flex;
  flex-direction: column;
}

.leader-party-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.leader-opinion {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
}

.leader-opinion.up {
  color: #22c55e;
}

.leader-opinion.down {
  color: #ef4444;
}

.leader-body {
  padding: var(--space-4);
}

.leader-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--space-1);
}

.leader-title {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.leader-background {
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 0 0 var(--space-2);
}

.leader-education {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.leader-warning {
  padding: var(--space-2) var(--space-4);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: var(--text-xs);
  text-align: center;
  font-weight: 600;
}

/* Tenure */
.leaders-tenure {
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.leaders-tenure h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.tenure-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.tenure-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.tenure-party {
  width: 30px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--party-color);
}

.tenure-name {
  width: 150px;
  font-size: var(--text-sm);
}

.tenure-bar {
  flex: 1;
  height: 8px;
  background: var(--party-color);
  border-radius: var(--radius-sm);
  max-width: 200px;
}

.tenure-years {
  width: 50px;
  text-align: right;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Constituencies View */
.const-subtitle {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.const-regions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.const-region {
  padding: var(--space-3);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
}

.region-name {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.region-mandates {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.const-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.const-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.const-table th,
.const-table td {
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.const-table thead {
  background: var(--color-bg-card);
}

.const-table th {
  font-weight: 600;
}

.const-table tbody tr:hover {
  background: var(--color-bg-elevated);
}

.const-name {
  font-weight: 500;
}

.const-mandates {
  font-family: var(--font-display);
  font-weight: 600;
}

.const-winner {
  font-family: var(--font-display);
  font-weight: 700;
}

.const-notes {
  padding: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.const-notes p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  padding-left: var(--space-4);
  position: relative;
}

.const-notes p::before {
  content: '•';
  position: absolute;
  left: 0;
}

.const-notes p + p {
  margin-top: var(--space-2);
}

/* Responsive - History Section */
@media (max-width: 768px) {
  .history-tabs {
    flex-direction: column;
  }

  .history-tab {
    text-align: center;
  }

  .history-trends {
    grid-template-columns: 1fr;
  }

  .comparison-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .comparison-party {
    width: auto;
  }

  .leaders-grid {
    grid-template-columns: 1fr;
  }

  .tenure-name {
    width: 100px;
  }

  .eu-party-row {
    flex-wrap: wrap;
  }

  .eu-party-stats {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Mega Menu Navigation
   ========================================================================== */

.mega-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
  border-radius: var(--radius-md);
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger:focus,
.nav-dropdown-trigger[aria-expanded="true"] {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.dropdown-arrow {
  transition: transform var(--transition-fast);
}

.nav-dropdown-trigger[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 280px;
  padding: var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: 1000;
}

.nav-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--color-bg-hover);
}

.dropdown-item.active {
  background: var(--color-bg-card);
}

.dropdown-item-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-sm);
}

.dropdown-item-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.nav-link {
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

/* Mobile Nav Categories */
.mobile-nav-category {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2);
}

.mobile-nav-category:first-child {
  border-top: none;
  margin-top: 0;
}

.mobile-nav a.active {
  color: var(--color-accent);
  background: rgba(74, 158, 255, 0.1);
}

/* ==========================================================================
   Page-specific Styles
   ========================================================================== */

/* Page Hero */
.page-hero {
  padding: var(--space-16) 0 var(--space-12);
  background: linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg) 100%);
}

.page-hero h1 {
  font-family: var(--font-display);
  /* Fluid: 1.75rem (mobil) → 2.5rem (desktop). Förhindrar 40px-rubrik
     på 320px-skärm där den tar 60%+ av bredden. */
  font-size: clamp(var(--text-3xl), 6vw, var(--text-4xl));
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.page-hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb span {
  color: var(--color-text-subtle);
}

/* ==========================================================================
   Overview Cards (Landing Page)
   ========================================================================== */

.tools-overview,
.facts-overview,
.analysis-overview {
  padding: var(--space-16) 0;
}

.tools-overview {
  background: var(--color-bg);
}

.facts-overview {
  background: var(--color-bg-elevated);
}

.analysis-overview {
  background: var(--color-bg);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.overview-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.overview-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.overview-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  box-shadow: 0 8px 30px rgba(74, 158, 255, 0.15);
}

.overview-card.featured {
  background: linear-gradient(135deg, var(--color-bg-card) 0%, rgba(74, 158, 255, 0.1) 100%);
  border-color: var(--color-accent);
}

.overview-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-hover);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  color: var(--color-accent);
}

.overview-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.overview-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex: 1;
  margin-bottom: var(--space-4);
}

.overview-card-cta {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
}

/* Opinion Preview */
.opinion-preview {
  padding: var(--space-16) 0;
  background: var(--color-bg-elevated);
}

.opinion-preview-cta {
  text-align: center;
  margin-top: var(--space-8);
}

/* ==========================================================================
   Footer Navigation (Multi-page)
   ========================================================================== */

.footer-brand {
  margin-bottom: var(--space-6);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.footer-logo span {
  color: var(--color-accent);
}

.footer-brand p {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.footer-nav-group h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.footer-nav-group a {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-1) 0;
  transition: color var(--transition-fast);
}

.footer-nav-group a:hover {
  color: var(--color-accent);
}

/* Source list */
.source-list {
  margin-top: var(--space-3);
  padding-left: var(--space-4);
}

.source-list li {
  margin-bottom: var(--space-2);
}

.source-list a {
  color: var(--color-accent);
  text-decoration: none;
}

.source-list a:hover {
  text-decoration: underline;
}

/* About contact */
.about-contact {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
}

.about-contact h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.about-update {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Compass explanation */
.compass-explanation {
  margin-top: var(--space-12);
  padding: var(--space-8);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
}

.compass-explanation h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
}

.compass-explanation-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.compass-explanation-item h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-3);
  color: var(--color-accent);
}

.compass-explanation-item p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* Block analysis */
.block-analysis {
  margin-top: var(--space-12);
  padding: var(--space-8);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
}

.block-analysis h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
}

.block-bar-visual {
  display: flex;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.block-bar-left,
.block-bar-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  transition: flex var(--transition-base);
}

.block-bar-left {
  background: linear-gradient(135deg, #E8112D 0%, #AF0000 100%);
  flex: 1;
}

.block-bar-right {
  background: linear-gradient(135deg, #1B49DD 0%, #1F3C81 100%);
  flex: 1;
}

.block-bar-left .block-label,
.block-bar-right .block-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: white;
}

.block-value {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.8);
}

.block-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

/* Polls graph section */
.polls-graph-section {
  margin-top: var(--space-12);
}

.polls-graph-section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
}

/* ==========================================================================
   Party Comparison
   ========================================================================== */

.partycompare-section {
  padding: var(--space-6) 0;
}

.partycompare-selector {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  margin-bottom: var(--space-6);
}

.partycompare-selector h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
}

.partycompare-select-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-6);
  align-items: start;
}

.partycompare-select-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

.partycompare-party-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.partycompare-party-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.partycompare-party-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.partycompare-party-btn span {
  font-size: var(--text-xs);
  font-weight: 600;
}

.partycompare-party-btn:hover {
  border-color: var(--party-color);
  background: var(--color-bg-hover);
}

.partycompare-party-btn.is-selected {
  border-color: var(--party-color);
  background: var(--party-color);
  color: var(--party-text);
}

.partycompare-vs {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-muted);
  padding-top: var(--space-10);
}

.partycompare-hint {
  margin-top: var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Compact selector (after selection) */
.partycompare-selector--compact {
  padding: var(--space-4);
}

.partycompare-selected-parties {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.partycompare-selected-party {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 2px solid var(--party-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.partycompare-selected-party img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.partycompare-selected-party span {
  font-weight: 500;
}

.partycompare-change-btn {
  font-size: var(--text-xs);
  color: var(--color-accent);
  margin-left: var(--space-2);
}

.partycompare-selected-party:hover {
  background: var(--color-bg-hover);
}

.partycompare-vs-small {
  font-weight: 700;
  color: var(--color-text-muted);
}

/* Stats */
.partycompare-stats {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.partycompare-stat-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.partycompare-stat-row:last-child {
  border-bottom: none;
}

.partycompare-stat {
  text-align: center;
}

.partycompare-stat--left {
  border-left: 3px solid var(--party-color);
  padding-left: var(--space-3);
  text-align: left;
}

.partycompare-stat--right {
  border-right: 3px solid var(--party-color);
  padding-right: var(--space-3);
  text-align: right;
}

.partycompare-stat-value {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: var(--font-display);
}

.partycompare-stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.partycompare-stat-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Section */
.partycompare-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.partycompare-section-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* Leaders */
.partycompare-leaders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.partycompare-leader {
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--party-color);
}

.partycompare-leader-name {
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

.partycompare-leader-title {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Ideology */
.partycompare-ideology {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.partycompare-ideology-item {
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--party-color);
  font-size: var(--text-sm);
}

/* Compass comparison */
.partycompare-compass-comparison {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.partycompare-compass-axis {
  margin-bottom: var(--space-4);
}

.partycompare-compass-axis:last-child {
  margin-bottom: 0;
}

.partycompare-compass-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.partycompare-compass-scale {
  position: relative;
  height: 32px;
  background: linear-gradient(to right, var(--color-accent), var(--color-bg-hover), var(--color-warning));
  border-radius: var(--radius-sm);
}

.partycompare-compass-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

/* Category filter */
.partycompare-category-filter {
  margin-bottom: var(--space-4);
}

.partycompare-category-select {
  width: 100%;
  max-width: 300px;
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
}

/* Issues */
.partycompare-issues {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.partycompare-issue {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--color-border-subtle);
}

.partycompare-issue--match {
  border-color: var(--color-success);
}

.partycompare-issue-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.partycompare-issue-category {
  font-size: var(--text-lg);
}

.partycompare-issue-label {
  font-weight: 600;
  flex: 1;
}

.partycompare-issue-match-badge {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  background: var(--color-success);
  color: #000;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.partycompare-issue-positions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.partycompare-issue-position {
  padding-left: var(--space-3);
  border-left: 3px solid var(--party-color);
}

.partycompare-stance {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.partycompare-stance--for { color: var(--color-success); }
.partycompare-stance--delvis_for { color: #86efac; }
.partycompare-stance--neutral { color: var(--color-text-muted); }
.partycompare-stance--delvis_emot { color: #fca5a5; }
.partycompare-stance--emot { color: var(--color-error); }

.partycompare-position-summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  line-height: var(--leading-relaxed);
}

.partycompare-no-issues {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-6);
}

/* Responsive */
@media (max-width: 768px) {
  .partycompare-select-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .partycompare-vs {
    padding-top: 0;
  }

  .partycompare-party-buttons {
    grid-template-columns: repeat(4, 1fr);
  }

  .partycompare-stat-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .partycompare-stat-title {
    grid-column: 1 / -1;
    text-align: center;
    padding-bottom: var(--space-2);
  }

  .partycompare-leaders,
  .partycompare-ideology,
  .partycompare-issue-positions {
    grid-template-columns: 1fr;
  }

  .partycompare-selected-parties {
    flex-direction: column;
  }
}

/* ==========================================================================
   Responsive: Mega Menu & Pages
   ========================================================================== */

@media (max-width: 1024px) {
  .mega-nav {
    display: none;
  }

  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .compass-explanation-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-hero {
    padding: var(--space-12) 0 var(--space-8);
  }

  .page-hero h1 {
    font-size: var(--text-3xl);
  }

  .overview-grid,
  .overview-grid-3 {
    grid-template-columns: 1fr;
  }

  .overview-card {
    padding: var(--space-5);
  }

  .footer-nav {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ==========================================================================
   Seat Calculator (Mandatkalkylator)
   ========================================================================== */

.seatcalc-container {
  width: 100%;
}

.seatcalc-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-8);
  align-items: start;
}

/* Presets */
.seatcalc-presets {
  margin-bottom: var(--space-6);
}

.seatcalc-presets-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.seatcalc-preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.seatcalc-preset-btn {
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.seatcalc-preset-btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-accent);
}

/* Sliders */
.seatcalc-sliders {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.seatcalc-slider-row {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--party-color);
}

.seatcalc-slider-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.seatcalc-party-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.seatcalc-party-name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 500;
}

.seatcalc-party-value {
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: right;
}

.seatcalc-slider-wrapper {
  position: relative;
  height: 8px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.seatcalc-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.seatcalc-slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--party-color);
  border-radius: var(--radius-full);
  transition: width 0.1s;
  pointer-events: none;
}

.seatcalc-threshold-warning {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-warning);
  margin-top: var(--space-1);
}

/* Total */
.seatcalc-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.seatcalc-total--warning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid var(--color-warning);
}

.seatcalc-normalize-btn {
  padding: var(--space-2) var(--space-3);
  background: var(--color-warning);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}

/* Hemicycle */
.seatcalc-hemicycle-container {
  position: relative;
  margin-bottom: var(--space-6);
}

.seatcalc-hemicycle {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: block;
}

.seatcalc-hemicycle circle {
  transition: fill 0.3s;
}

.seatcalc-hemicycle-center {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  background: var(--color-surface);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
}

.seatcalc-majority-number {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
}

.seatcalc-majority-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Blocks */
.seatcalc-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.seatcalc-block {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  position: relative;
}

.seatcalc-block--left {
  border-top: 4px solid #e8112d;
}

.seatcalc-block--right {
  border-top: 4px solid #1b49dd;
}

.seatcalc-block--majority {
  box-shadow: 0 0 0 2px var(--color-success);
}

.seatcalc-block-name {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.seatcalc-block-parties {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.seatcalc-block-seats {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 700;
}

.seatcalc-block-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--color-success);
  color: white;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Breakdown */
.seatcalc-breakdown {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.seatcalc-breakdown-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.seatcalc-bar-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.seatcalc-bar-row {
  display: grid;
  grid-template-columns: 50px 1fr 40px;
  gap: var(--space-3);
  align-items: center;
}

.seatcalc-bar-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}

.seatcalc-bar-label img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.seatcalc-bar-track {
  height: 24px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.seatcalc-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}

.seatcalc-bar-value {
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Outside riksdag */
.seatcalc-outside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: rgba(255, 193, 7, 0.1);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.seatcalc-outside-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.seatcalc-outside-party {
  padding: var(--space-1) var(--space-2);
  background: var(--party-color);
  color: white;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Info */
.seatcalc-info {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.seatcalc-info h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.seatcalc-info p {
  margin-bottom: var(--space-2);
}

.seatcalc-info p:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .seatcalc-layout {
    grid-template-columns: 1fr;
  }

  .seatcalc-input-panel {
    order: 1;
  }

  .seatcalc-results-panel {
    order: 0;
  }
}

@media (max-width: 640px) {
  .seatcalc-hemicycle {
    max-width: 300px;
  }

  .seatcalc-blocks {
    grid-template-columns: 1fr;
  }

  .seatcalc-bar-row {
    grid-template-columns: 40px 1fr 35px;
  }
}

/* ==========================================================================
   Debates Calendar (Debattkalender)
   ========================================================================== */

.debates-container {
  width: 100%;
}

/* Countdown */
.debates-countdown {
  background: linear-gradient(135deg, var(--color-accent) 0%, #2563eb 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  text-align: center;
  color: white;
}

.debates-countdown-label {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-bottom: var(--space-2);
}

.debates-countdown-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.debates-countdown-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.debates-countdown-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.debates-countdown-days {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-weight: 600;
}

.debates-countdown-days--soon {
  background: var(--color-warning);
  color: #000;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Filter */
.debates-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.debates-filter-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.debates-filter-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.debates-filter-btn.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* Section */
.debates-section {
  margin-bottom: var(--space-8);
}

.debates-section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border);
}

/* Grid */
.debates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

/* Debate Card */
.debate-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid var(--color-border-subtle);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.debate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.debate-card--upcoming {
  border-left: 4px solid var(--color-accent);
}

.debate-card--past {
  opacity: 0.8;
}

.debate-card--past:hover {
  opacity: 1;
}

.debate-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.debate-card-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  min-width: 50px;
}

.debate-card-day {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1;
}

.debate-card-month {
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.debate-card-channel {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

.debate-card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.debate-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

.debate-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.debate-card-time {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
}

.debate-card-time svg {
  opacity: 0.6;
}

.debate-card-countdown {
  font-weight: 600;
  color: var(--color-accent);
}

.debate-card--past .debate-card-countdown {
  color: var(--color-text-muted);
}

/* Topics */
.debate-card-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.debate-card-topic {
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Participants */
.debate-card-participants {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.debate-card-participants-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.debate-card-parties {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.debate-card-party {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  color: white;
}

/* Link */
.debate-card-link {
  display: inline-block;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: background 0.2s;
}

.debate-card-link:hover {
  background: var(--color-bg-hover);
}

/* Reminder badge */
.debate-card-reminder {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: var(--space-1) var(--space-2);
  background: var(--color-warning);
  color: #000;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  animation: pulse 2s infinite;
}

/* Info */
.debates-info {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-top: var(--space-6);
}

.debates-info h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.debates-info p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

.debates-info p:last-child {
  margin-bottom: 0;
}

.debates-info a {
  color: var(--color-accent);
  text-decoration: none;
}

.debates-info a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .debates-countdown {
    padding: var(--space-4);
  }

  .debates-countdown-title {
    font-size: var(--text-xl);
  }

  .debates-countdown-meta {
    flex-direction: column;
    gap: var(--space-2);
  }

  .debates-grid {
    grid-template-columns: 1fr;
  }

  .debate-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* ==========================================================================
   Quiz Swipe Gestures
   ========================================================================== */

/* Swipe hint */
.quiz-swipe-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  transition: opacity 0.2s;
}

.quiz-swipe-hint-left {
  color: var(--color-error);
}

.quiz-swipe-hint-right {
  color: var(--color-success);
}

.quiz-swipe-hint-text {
  font-weight: 500;
}

/* Swipe wrapper */
.quiz-swipe-wrapper {
  position: relative;
  margin-bottom: var(--space-4);
  touch-action: pan-y;
}

/* Swipe card */
.quiz-swipe-card {
  position: relative;
  z-index: 2;
  will-change: transform;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.quiz-swipe-card:active {
  cursor: grabbing;
}

.quiz-swipe-card.swiping-right {
  border-color: var(--color-success);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.quiz-swipe-card.swiping-left {
  border-color: var(--color-error);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* Swipe indicators */
.quiz-swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.quiz-swipe-indicator span:first-child {
  font-size: var(--text-2xl);
}

.quiz-swipe-indicator--left {
  left: -60px;
  background: var(--color-error);
  color: white;
}

.quiz-swipe-indicator--right {
  right: -60px;
  background: var(--color-success);
  color: white;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .quiz-swipe-indicator--left {
    left: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
  }

  .quiz-swipe-indicator--right {
    right: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }

  .quiz-swipe-hint {
    padding: var(--space-3);
    font-size: var(--text-sm);
  }

  .quiz-swipe-card {
    touch-action: pan-y;
  }
}

/* Hide swipe elements on non-touch devices */
@media (hover: hover) and (pointer: fine) {
  .quiz-swipe-hint {
    display: none;
  }

  .quiz-swipe-indicator {
    display: none;
  }

  .quiz-swipe-card {
    cursor: default;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  /* Reset colors for print */
  :root {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-text: #000000;
    --color-text-muted: #333333;
    --color-text-subtle: #555555;
    --color-border: #cccccc;
    --color-border-subtle: #dddddd;
  }

  /* Base print styles */
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html {
    font-size: 12pt;
  }

  body {
    background: white !important;
    color: black !important;
    line-height: 1.5;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Hide non-essential elements */
  .site-header,
  .mobile-nav,
  .site-footer,
  .skip-link,
  .theme-toggle,
  .nav-toggle,
  .btn,
  button,
  .quiz-nav,
  .quiz-swipe-hint,
  .quiz-swipe-indicator,
  .quiz-start-btn,
  .quiz-resume-buttons,
  .coalition-controls,
  .coalition-party-btn,
  .seatcalc-preset-buttons,
  .seatcalc-slider,
  .seatcalc-normalize-btn,
  .debates-filter,
  .debate-card-link,
  .partycompare-party-btn,
  .partycompare-change-btn,
  .timeline-filters,
  .compare-filters,
  .pollgraph-legend-toggle,
  .issue-expand-btn,
  .back-to-top,
  [aria-hidden="true"] {
    display: none !important;
  }

  /* Page settings */
  @page {
    margin: 2cm;
    size: A4;
  }

  /* Headings */
  h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
    page-break-after: avoid;
    page-break-inside: avoid;
    margin-top: 1em;
  }

  h1 {
    font-size: 24pt;
    border-bottom: 2pt solid #000;
    padding-bottom: 0.5em;
  }

  h2 {
    font-size: 18pt;
    border-bottom: 1pt solid #666;
    padding-bottom: 0.3em;
  }

  h3 {
    font-size: 14pt;
  }

  /* Paragraphs and text */
  p, li, td, th {
    orphans: 3;
    widows: 3;
  }

  /* Links - show URL */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666 !important;
  }

  a[href^="#"]::after,
  a[href^="javascript"]::after,
  .site-logo::after,
  .footer-logo::after {
    content: none;
  }

  /* Images */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
  }

  th, td {
    border: 1pt solid #ccc;
    padding: 0.5em;
    text-align: left;
  }

  th {
    background: #f0f0f0 !important;
    font-weight: bold;
  }

  /* Cards and containers */
  .container {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .section {
    padding: 1em 0;
    page-break-inside: avoid;
  }

  /* Party cards */
  .party-card,
  .overview-card,
  .debate-card,
  .issue-card,
  .partycompare-issue {
    border: 1pt solid #ccc !important;
    padding: 1em;
    margin-bottom: 1em;
    page-break-inside: avoid;
  }

  /* Party logos */
  .party-card img,
  .partycompare-party-logo,
  .seatcalc-party-logo,
  .debate-card-party {
    width: 24px !important;
    height: 24px !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Preserve party colors for logos */
  .party-card-header,
  .debate-card-party,
  .partycompare-stat {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Quiz results */
  .quiz-results {
    page-break-before: always;
  }

  .quiz-results-grid {
    display: block;
  }

  .quiz-result-card {
    border: 1pt solid #ccc !important;
    padding: 0.5em;
    margin-bottom: 0.5em;
    page-break-inside: avoid;
  }

  .quiz-match-bar {
    background: #f0f0f0 !important;
    border: 1pt solid #ccc;
  }

  /* Compass */
  .compass-container {
    max-width: 400px;
    margin: 0 auto;
    page-break-inside: avoid;
  }

  /* Timeline */
  .timeline-event {
    border-left: 2pt solid #ccc !important;
    padding-left: 1em;
    margin-bottom: 1em;
    page-break-inside: avoid;
  }

  /* Budget comparison */
  .budget-comparison {
    page-break-inside: avoid;
  }

  /* Hemicycle - hide on print */
  .seatcalc-hemicycle-container {
    display: none;
  }

  /* Show seat breakdown instead */
  .seatcalc-breakdown {
    border: 1pt solid #ccc !important;
  }

  /* Poll graph */
  .pollgraph-container canvas,
  .pollgraph-container svg {
    max-width: 100%;
    page-break-inside: avoid;
  }

  /* Grids - linearize for print */
  .overview-grid,
  .overview-grid-3,
  .parties-grid,
  .debates-grid,
  .partycompare-select-grid,
  .seatcalc-layout {
    display: block;
  }

  /* Footer print info */
  .main-content::after {
    content: "Utskrivet från Val 2026 (val2026.se) - " attr(data-print-date);
    display: block;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1pt solid #ccc;
    font-size: 10pt;
    color: #666 !important;
    text-align: center;
  }

  /* Hide interactive charts on print, show data tables if available */
  .chart-container {
    page-break-inside: avoid;
  }

  /* Accessibility - ensure contrast */
  .text-muted,
  .text-subtle,
  small {
    color: #333 !important;
  }

  /* Print header */
  .section-header {
    text-align: center;
    margin-bottom: 1.5em;
  }

  .section-title {
    margin-bottom: 0.5em;
  }

  .section-subtitle {
    font-size: 11pt;
    color: #333 !important;
  }
}

/* ==========================================================================
   Candidates Database (Kandidatdatabas)
   ========================================================================== */

.candidates-container {
  width: 100%;
}

/* Controls */
.candidates-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

/* Search */
.candidates-search {
  position: relative;
}

.candidates-search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.candidates-search-input {
  width: 100%;
  padding: var(--space-4) var(--space-4) var(--space-4) 52px;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  font-size: var(--text-base);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.candidates-search-input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.candidates-search-input::placeholder {
  color: var(--color-text-muted);
}

/* Filters */
.candidates-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.candidates-filter {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 150px;
}

.candidates-filter-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.candidates-filter-select {
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
}

.candidates-filter-select:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

/* Results info */
.candidates-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.candidates-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.candidates-clear-btn {
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.2s;
}

.candidates-clear-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

/* Grid */
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.candidates-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-muted);
}

/* Candidate Card */
.candidate-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.candidate-card-header {
  position: relative;
  display: flex;
  justify-content: center;
  padding: var(--space-5);
  background: linear-gradient(135deg, var(--party-color) 0%, color-mix(in srgb, var(--party-color) 70%, black) 100%);
}

.candidate-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: white;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.candidate-party-badge {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  padding: var(--space-1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.candidate-party-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.candidate-card-body {
  padding: var(--space-4);
}

.candidate-name {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.candidate-role {
  font-size: var(--text-sm);
  color: var(--party-color);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.candidate-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.candidate-meta-item {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.candidate-occupation {
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.candidate-experience {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

/* Focus tags */
.candidate-focus {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.candidate-focus-tag {
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.candidate-focus-tag:hover {
  background: var(--party-color);
  border-color: var(--party-color);
  color: white;
}

/* Info */
.candidates-info {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.candidates-info h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.candidates-info p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

.candidates-info p:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .candidates-filters {
    flex-direction: column;
  }

  .candidates-filter {
    min-width: 100%;
  }

  .candidates-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .candidates-search-input {
    padding: var(--space-3) var(--space-3) var(--space-3) 44px;
    font-size: var(--text-sm);
  }

  .candidate-avatar {
    width: 64px;
    height: 64px;
    font-size: var(--text-xl);
  }
}
