/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  line-height: 1.6;
}

/* Header Styles */
.site-header {
  background: white;
  border-bottom: 1px solid #e5e5e5;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 4px;
  object-fit: contain;
}

.logo a {
  color: #003087;
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 2rem;
  flex: 1;
  justify-content: center;
}

.main-nav a {
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.main-nav a:hover {
  color: #003087;
}

.main-nav-sim {
  background: #003087;
  color: #fff !important;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-size: 0.88rem !important;
}

.main-nav-sim:hover {
  background: #0a2a8a;
  color: #fff !important;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid #d7ddea;
  border-radius: 8px;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: #1f2f59;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.countdown-badge {
  background: #f8f9fa;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #003087;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
}

.countdown-badge:hover {
  opacity: 0.85;
}

.countdown-badge--ongoing {
  background: #dc2626;
  color: #fff;
}

.countdown-badge--completed {
  background: #e2e3e5;
  color: #383d41;
}

/* Main Content */
main {
  min-height: calc(100vh - 300px);
}

/* Inner Pages */
.inner-main {
  background: #f2f4f8;
  min-height: 70vh;
  padding: 18px 0 40px;
}

.inner-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  align-items: start;
}

.inner-sidebar {
  background: transparent;
}

.inner-sidebar-title {
  font-size: 10px;
  letter-spacing: 2px;
  color: #9aa3ba;
  margin: 12px 0 8px;
}

.inner-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inner-sidebar-nav a {
  text-decoration: none;
  color: #5f6d8c;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  padding: 9px 10px;
  border: 1px solid transparent;
}

.inner-sidebar-nav a:hover {
  background: #e9edf7;
  color: #1f2f59;
}

.inner-sidebar-nav a.is-active {
  background: #082b82;
  color: #fff;
}

.inner-content-wrap {
  min-width: 0;
}

.inner-breadcrumb {
  margin: 2px 0 14px;
  font-size: 12px;
  color: #96a2bc;
}

.inner-breadcrumb a {
  color: #7a88a8;
  text-decoration: none;
}

.inner-breadcrumb a:hover {
  text-decoration: underline;
}

.inner-breadcrumb span {
  margin: 0 6px;
}

.inner-content h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 46px;
  line-height: 1.1;
  color: #182449;
  margin: 0;
}

.inner-hero-row {
  margin-bottom: 16px;
}

.inner-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ef3340;
  color: #fff;
  font-size: 11px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 600;
}

.inner-subtitle {
  color: #8b97b2;
  margin-top: 4px;
  font-size: 13px;
}

.inner-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.inner-stats-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inner-stat-card {
  background: #fff;
  border: 1px solid #e3e7f1;
  border-radius: 4px;
  padding: 12px;
}

.inner-stat-card h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 3px;
  color: #202d51;
  font-size: 19px;
  font-family: Georgia, 'Times New Roman', serif;
}

.inner-stat-card h3 span {
  color: #123687;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.inner-stat-card p {
  color: #6f7f9f;
  font-size: 12px;
  margin: 0;
}

.inner-stat-card small {
  display: block;
  margin-top: 5px;
  color: #99a5bf;
  font-size: 11px;
}

.inner-note {
  margin-top: 8px;
  background: #fff;
  border: 1px solid #e3e7f1;
  border-radius: 4px;
  padding: 14px;
}

.inner-note h2 {
  margin: 0 0 8px;
  color: #1d2b50;
  font-size: 25px;
  font-family: Georgia, 'Times New Roman', serif;
}

.inner-note p {
  margin: 0 0 6px;
  color: #7182a3;
  font-size: 12px;
}

.inner-note a,
.inner-back-link a {
  color: #123687;
  text-decoration: none;
}

.inner-note a:hover,
.inner-back-link a:hover {
  text-decoration: underline;
}

.inner-back-link {
  margin: 0 0 10px;
  font-size: 13px;
}

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

.inner-list-card {
  background: #fff;
  border: 1px solid #e3e7f1;
  border-radius: 4px;
  padding: 10px 12px;
  text-decoration: none;
  color: #25345f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.inner-list-card:hover {
  border-color: #b5c1dc;
}

/* Top election guide pages */
.guide-main {
  background: #f2f4f8;
  min-height: 70vh;
  padding: 18px 0 40px;
}

.guide-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.guide-content {
  max-width: 720px;
}

.guide-breadcrumb {
  margin: 0 0 10px;
  color: #97a2bb;
  font-size: 12px;
}

.guide-breadcrumb a {
  color: #7f8cab;
  text-decoration: none;
}

.guide-breadcrumb a:hover {
  text-decoration: underline;
}

.guide-breadcrumb span {
  margin: 0 6px;
}

.guide-hero {
  margin-bottom: 18px;
}

.guide-hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.1;
  color: #182449;
  margin-bottom: 6px;
}

.guide-hero p {
  color: #7f8dab;
  font-size: 14px;
  max-width: 700px;
}

.guide-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.guide-kpi-card {
  background: #fff;
  border: 1px solid #e3e8f1;
  border-radius: 4px;
  padding: 10px 12px;
}

.guide-kpi-card h3 {
  font-size: 14px;
  color: #22315a;
  margin-bottom: 2px;
  font-weight: 700;
}

.guide-kpi-card p {
  font-size: 11px;
  color: #8d9ab4;
}

/* Search Section Styles */
.search-section {
  margin-bottom: 32px;
  background: linear-gradient(135deg, #f8f9fd 0%, #fff 100%);
  border: 1px solid #e2e7f0;
  border-radius: 8px;
  padding: 24px;
}

.search-section h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  line-height: 1.2;
  color: #1e2b4f;
  margin-bottom: 6px;
}

.search-subtitle {
  font-size: 13px;
  color: #546485;
  margin-bottom: 20px;
}

/* Unified municipality/department search widget */
.mun-search-wrap {
  position: relative;
  max-width: 520px;
}

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

.mun-search-icon {
  position: absolute;
  left: 12px;
  color: #7a8cad;
  pointer-events: none;
  flex-shrink: 0;
}

.mun-search-input {
  width: 100%;
  padding: 11px 12px 11px 40px;
  font-size: 14px;
  border: 1px solid #d9e0ec;
  border-radius: 6px;
  background: #fff;
  color: #1e2b4f;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.mun-search-input:focus {
  outline: none;
  border-color: #003087;
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.1);
}

.mun-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d9e0ec;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(9, 26, 84, 0.12);
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
}

.mun-search-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #8d9ab4;
  padding: 8px 14px 4px;
  text-transform: uppercase;
}

.mun-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  text-decoration: none;
  color: #1e2b4f;
  gap: 12px;
  border-left: 2px solid transparent;
  transition: background 0.1s;
}

.mun-search-item:hover,
.mun-search-item.is-active {
  background: #f3f6fc;
  border-left-color: #003087;
}

.mun-search-item-name {
  font-size: 14px;
  font-weight: 500;
}

.mun-search-item-sub {
  font-size: 11px;
  color: #7a8cad;
  white-space: nowrap;
}

.mun-search-empty {
  padding: 14px;
  font-size: 13px;
  color: #8d9ab4;
  text-align: center;
}
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: start;
}

.search-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.search-label {
  font-size: 12px;
  font-weight: 600;
  color: #1e2b4f;
  margin-bottom: 2px;
}

.search-select,
.search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #d9e0ec;
  border-radius: 4px;
  background: white;
  color: #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-select:focus,
.search-input:focus {
  outline: none;
  border-color: #003087;
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.1);
}

.search-input:disabled {
  background: #f5f7fa;
  color: #8d9ab4;
  cursor: not-allowed;
}

.search-input-wrapper {
  position: relative;
}

.search-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #e2e7f0;
  border-top-color: #003087;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.search-status {
  font-size: 11px;
  color: #8d9ab4;
  min-height: 16px;
}

.communes-list {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.commune-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: white;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.commune-item:hover {
  border-color: #003087;
  background-color: #f8f9fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 48, 135, 0.08);
}

.commune-name {
  font-size: 13px;
  color: #1e2b4f;
  font-weight: 500;
  flex: 1;
}

.commune-code {
  font-size: 11px;
  color: #8d9ab4;
  font-weight: 500;
  margin-left: 12px;
}

.search-no-results {
  padding: 16px 12px;
  font-size: 13px;
  color: #8d9ab4;
  text-align: center;
}

.guide-section {
  margin-bottom: 22px;
}

.guide-section h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 34px;
  line-height: 1.15;
  color: #1e2b4f;
  margin-bottom: 8px;
}

.guide-section p,
.guide-section li,
.guide-section td,
.guide-section th {
  color: #546485;
  font-size: 13px;
  line-height: 1.65;
}

.guide-section p {
  margin: 0 0 8px;
}

.guide-box {
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 8px;
}

.guide-box h3 {
  margin-bottom: 4px;
  color: #2c3a61;
  font-size: 14px;
  font-weight: 700;
}

.guide-dot-list,
.guide-year-list {
  margin: 6px 0 0 18px;
}

.guide-dot-list li,
.guide-year-list li {
  margin-bottom: 4px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: #fff;
  border: 1px solid #e2e7f0;
}

.guide-table th,
.guide-table td {
  border-bottom: 1px solid #e9edf4;
  padding: 8px 10px;
  text-align: left;
}

.guide-table th {
  font-weight: 700;
  color: #2f3e67;
  background: #f7f9fc;
}

.guide-faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.guide-faq-card {
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 10px 12px;
}

.guide-faq-card h3 {
  font-size: 14px;
  color: #24335d;
  margin-bottom: 4px;
}

.guide-faq-card p {
  margin: 0;
  color: #6d7d9f;
  font-size: 13px;
}

/* Commune detail pages */
.commune-main {
  background: #f2f4f8;
  min-height: 70vh;
  padding: 18px 0 40px;
}

.commune-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.commune-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 20px;
  align-items: start;
}

.commune-content {
  min-width: 0;
}

.commune-breadcrumb {
  margin: 0 0 8px;
  font-size: 12px;
  color: #98a4bc;
}

.commune-breadcrumb a {
  color: #7e8bac;
  text-decoration: none;
}

.commune-breadcrumb a:hover {
  text-decoration: underline;
}

.commune-breadcrumb span {
  margin: 0 6px;
}

.commune-hero {
  margin-bottom: 16px;
}

.commune-hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(36px, 4vw, 50px);
  line-height: 1.1;
  color: #182449;
  margin-bottom: 6px;
}

.commune-hero p {
  color: #7f8caf;
  font-size: 13px;
}

.commune-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.commune-kpi-card,
.commune-card,
.commune-list-items article,
.commune-box,
.commune-empty-state,
.commune-faq-grid article {
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
}

.commune-kpi-card {
  padding: 10px 12px;
}

.commune-kpi-card h3 {
  margin-bottom: 2px;
  color: #24355f;
  font-size: 18px;
  font-weight: 700;
}

.commune-kpi-card p {
  color: #8c99b4;
  font-size: 11px;
}

.commune-card {
  padding: 12px;
  margin-bottom: 16px;
}

.commune-card-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #95a1ba;
  margin-bottom: 5px;
}

.commune-card h2 {
  font-size: 22px;
  color: #1e2d53;
  margin-bottom: 2px;
}

.commune-card p {
  font-size: 12px;
  color: #7383a3;
}

.commune-section {
  margin-bottom: 20px;
}

.commune-section h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 31px;
  color: #1e2b50;
  margin-bottom: 6px;
}

.commune-section > p {
  color: #6f7f9f;
  font-size: 12px;
  margin-bottom: 8px;
}

.commune-list-items {
  display: grid;
  gap: 6px;
}

.commune-list-items article {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dot-green { background: #16a34a; }
.dot-blue { background: #1d4ed8; }
.dot-red { background: #dc2626; }
.dot-orange { background: #f59e0b; }

.commune-list-items h3 {
  margin: 0;
  font-size: 13px;
  color: #22325d;
}

.commune-list-items p {
  margin: 0;
  font-size: 11px;
  color: #8a98b3;
}

.commune-numbered {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: n;
}

.commune-numbered li {
  counter-increment: n;
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 10px 12px 10px 36px;
  position: relative;
  color: #5c6d91;
  font-size: 12px;
}

.commune-numbered li::before {
  content: counter(n);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #edf2fb;
  color: #3f5486;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.commune-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.commune-metrics-grid article {
  background: #f7f9fc;
  padding: 20px;
  border-radius: 6px;
  border: 1px solid #e2e7f0;
  text-align: center;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 5px;
}

.metric-label {
  font-size: 13px;
  color: #59698b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.commune-box {
  padding: 10px 12px;
}

.commune-box ul {
  margin: 0 0 0 18px;
}

.commune-box p,
.commune-box li {
  color: #5c6c8e;
  font-size: 12px;
  margin-bottom: 4px;
}

.commune-empty-state {
  padding: 16px;
  text-align: center;
}

.commune-empty-state h3 {
  margin-bottom: 3px;
  color: #2a3a65;
  font-size: 15px;
}

.commune-empty-state p {
  color: #7d8cab;
  font-size: 12px;
}

.commune-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e7f0;
}

.commune-table th,
.commune-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e9edf4;
  text-align: left;
  font-size: 12px;
  color: #59698b;
}

.commune-table th {
  background: #f7f9fc;
  color: #2d3d66;
}

.commune-back-link {
  margin-top: 8px;
  font-size: 12px;
}

.commune-back-link a,
.commune-all-link a,
.commune-side nav a {
  color: #1f3f90;
  text-decoration: none;
}

.commune-back-link a:hover,
.commune-all-link a:hover,
.commune-side nav a:hover {
  text-decoration: underline;
}

.commune-faq-grid {
  display: grid;
  gap: 6px;
}

.commune-faq-grid article {
  padding: 10px 12px;
}

.commune-faq-grid h3 {
  font-size: 13px;
  color: #24345e;
  margin-bottom: 4px;
}

.commune-faq-grid h3 a {
  color: inherit;
  text-decoration: none;
}

.commune-faq-grid h3 a:hover {
  color: #1f3f90;
  text-decoration: underline;
}

.commune-faq-grid p {
  color: #6f7f9f;
  font-size: 12px;
  margin: 0;
}

.commune-side {
  position: sticky;
  top: 90px;
}

.commune-side-title {
  font-size: 10px;
  letter-spacing: 2px;
  color: #99a4bb;
  margin: 4px 0 8px;
}

.commune-side nav {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.commune-side nav a {
  font-size: 12px;
  color: #7180a0;
}

.commune-all-link {
  font-size: 12px;
}

/* Static pages (about, contact, legal) */
.static-main {
  background: #f2f4f8;
  min-height: 70vh;
  padding: 18px 0 40px;
}

.static-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.static-breadcrumb {
  margin: 0 0 8px;
  font-size: 12px;
  color: #98a4bc;
}

.static-breadcrumb a {
  color: #7e8bac;
  text-decoration: none;
}

.static-breadcrumb a:hover {
  text-decoration: underline;
}

.static-breadcrumb span {
  margin: 0 6px;
}

.static-hero {
  margin-bottom: 18px;
}

.static-hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(36px, 4vw, 50px);
  line-height: 1.1;
  color: #182449;
  margin-bottom: 6px;
}

.static-hero p {
  color: #7f8caf;
  font-size: 13px;
}

.static-section {
  max-width: 760px;
  margin-bottom: 18px;
}

.static-section h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 31px;
  color: #1e2b50;
  margin-bottom: 4px;
}

.static-section p {
  color: #5e6f91;
  font-size: 13px;
  line-height: 1.65;
}

.static-section ul {
  color: #5e6f91;
  font-size: 13px;
  line-height: 1.65;
  margin: 8px 0;
  padding-left: 24px;
}

.static-section li {
  color: #5e6f91;
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 4px;
}

.static-section a {
  color: #003087;
  text-decoration: none;
}

.static-section a:hover {
  text-decoration: underline;
}

.contact-info-grid {
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.contact-info-card {
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 10px 12px;
}

.contact-info-card h2 {
  font-size: 14px;
  color: #27365f;
  margin-bottom: 2px;
}

.contact-info-card p {
  font-size: 12px;
  color: #7b89a8;
}

.contact-form {
  max-width: 760px;
}

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

.contact-field {
  margin-bottom: 8px;
}

.contact-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #5d6d8e;
  font-weight: 600;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid #d9e0ec;
  border-radius: 2px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #2b3a62;
}

.contact-field textarea {
  resize: vertical;
  min-height: 92px;
}

.contact-submit {
  border: 0;
  border-radius: 2px;
  background: #0d2f88;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
}

.contact-submit:hover {
  background: #123a9f;
}

/* Calendrier page */
.cal-summary {
  max-width: 760px;
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.cal-summary-title {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #9aa4bc;
  margin-bottom: 8px;
}

.cal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
}

.cal-summary-grid a {
  font-size: 12px;
  text-decoration: none;
  color: #1f3f90;
  font-weight: 600;
}

.cal-summary-grid a:hover {
  text-decoration: underline;
}

.cal-section {
  max-width: 760px;
  margin-bottom: 20px;
}

.cal-section h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 31px;
  color: #1e2b50;
  margin-bottom: 8px;
}

.cal-timeline h3 {
  font-size: 11px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #9aa6bf;
  margin: 10px 0 6px;
}

.cal-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 9px 11px;
  margin-bottom: 6px;
}

.cal-event strong {
  color: #2a3a63;
  font-size: 13px;
}

.cal-event p {
  color: #8b97b2;
  font-size: 11px;
}

.cal-event a {
  color: #1f3f90;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.cal-event a:hover {
  text-decoration: underline;
}

.cal-event-highlight {
  border-color: #ef3340;
}

.cal-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.cal-kpis span {
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 7px 9px;
  color: #566686;
  font-size: 12px;
}

.cal-section > p {
  color: #607092;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.cal-box {
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.cal-box p {
  color: #475a84;
  font-size: 12px;
  margin-bottom: 4px;
}

.cal-box ul {
  margin: 0 0 0 18px;
}

.cal-box li {
  color: #5f6f90;
  font-size: 12px;
  margin-bottom: 2px;
}

.cal-section a {
  color: #1f3f90;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.cal-section a:hover {
  text-decoration: underline;
}

.cal-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e7f0;
}

.cal-table th,
.cal-table td {
  border-bottom: 1px solid #e9edf4;
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
  color: #5f6f90;
}

.cal-table th {
  color: #2d3d66;
  background: #f7f9fc;
}

.cal-faq-list {
  display: grid;
  gap: 8px;
}

.cal-faq-list article {
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 4px;
  padding: 10px 12px;
}

.cal-faq-list h3 {
  color: #26365f;
  font-size: 13px;
  margin-bottom: 3px;
}

.cal-faq-list p {
  color: #6d7d9f;
  font-size: 12px;
}

/* Footer Styles */
.site-footer {
  background: #f8f9fa;
  border-top: 1px solid #e5e5e5;
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #003087;
}

.footer-section h4 {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-section p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #003087;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
  text-align: center;
  color: #666;
  font-size: 0.85rem;
}

.footer-bottom a {
  color: #003087;
  text-decoration: none;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* Homepage */
.home-page {
  background: #f4f6fa;
}

.home-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.home-hero {
  background: linear-gradient(120deg, #061f70 0%, #0a2a8a 50%, #12339f 100%);
  color: #fff;
  padding: 70px 0 64px;
}

.home-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 14px;
}

.home-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  margin-bottom: 12px;
}

.home-title em {
  font-style: italic;
  font-weight: 500;
}

.home-subtitle {
  max-width: 590px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 20px;
}

.home-legacy-copy {
  max-width: 640px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 14px;
}

.home-chip {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.home-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 11px 16px;
  min-width: 124px;
}

.btn-primary {
  background: #ef3340;
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.home-legacy-link a {
  color: #fff;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-stats {
  background: #ffffff;
  border-top: 1px solid #e4e8f0;
  border-bottom: 1px solid #e4e8f0;
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.home-stat-card {
  padding: 18px 14px;
  border-right: 1px solid #edf0f5;
}

.home-stat-card:last-child {
  border-right: 0;
}

.home-stat-value {
  font-weight: 700;
  color: #1d2a53;
  font-size: 18px;
  line-height: 1.2;
}

.home-stat-label {
  color: #8390aa;
  font-size: 12px;
}

.home-section {
  padding: 56px 0;
}

.home-section-alt {
  border-top: 1px solid #e7eaf2;
}

.home-section .home-eyebrow,
.home-section-alt .home-eyebrow {
  color: #9aa4bb;
  margin-bottom: 10px;
}

.home-section-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.1;
  color: #1a2341;
  margin-bottom: 24px;
}

.home-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-election-card {
  background: #fff;
  border: 1px solid #e6eaf1;
  border-radius: 6px;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-election-card:hover {
  border-color: #b9c4dd;
  box-shadow: 0 8px 18px rgba(9, 26, 84, 0.08);
}

.home-election-card-sim {
  border-left: 3px solid #003087;
}

/* Simulator feature banner on home page */
.home-sim-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 14px;
  padding: 20px 24px;
  background: linear-gradient(120deg, #061f70 0%, #0a2a8a 60%, #12339f 100%);
  border-radius: 6px;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}

.home-sim-banner:hover {
  opacity: 0.92;
}

.home-sim-banner-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
}

.home-sim-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.home-sim-banner-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.78);
  max-width: 520px;
}

.home-sim-banner-cta {
  white-space: nowrap;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Simulator banner on /municipales */
.mun-sim-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 16px 0 20px;
  padding: 14px 18px;
  background: linear-gradient(120deg, #061f70 0%, #0a2a8a 100%);
  border-radius: 5px;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}

.mun-sim-banner:hover {
  opacity: 0.9;
}

.mun-sim-banner-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mun-sim-banner-text strong {
  font-size: 0.95rem;
}

.mun-sim-banner-text span {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
}

.mun-sim-banner-cta {
  white-space: nowrap;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .home-sim-banner { flex-direction: column; align-items: flex-start; }
  .mun-sim-banner { flex-direction: column; align-items: flex-start; }
}

/* Simulator CTA on individual commune pages (second-round only) */
.commune-sim-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 20px 0;
  padding: 18px 20px;
  background: linear-gradient(120deg, #061f70 0%, #0a2a8a 60%, #12339f 100%);
  border-radius: 6px;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s, transform 0.2s;
}

.commune-sim-cta:hover {
  opacity: 0.93;
  transform: translateY(-1px);
}

.commune-sim-cta-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.commune-sim-cta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

.commune-sim-cta-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.commune-sim-cta-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  margin: 0;
}

.commune-sim-cta-btn {
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .commune-sim-cta { flex-direction: column; align-items: flex-start; }
  .commune-sim-cta-btn { align-self: flex-start; }
}

.card-title {
  font-weight: 700;
  color: #162247;
  margin-bottom: 6px;
}

.card-date {
  color: #5770a8;
  font-size: 13px;
  margin-bottom: 6px;
}

.card-desc {
  color: #7d8aa5;
  font-size: 13px;
}

.pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e9edf6;
  color: #4f5a73;
  font-size: 11px;
  font-weight: 600;
}

.pill-live {
  background: #ef3340;
  color: #fff;
}

.pill-sim {
  background: #003087;
  color: #fff;
}

.home-timeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.timeline-card {
  background: #fff;
  border: 1px solid #e2e7f1;
  border-radius: 4px;
  min-height: 108px;
  padding: 12px;
  text-decoration: none;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.timeline-card-active {
  border-color: #ef3340;
}

.timeline-month {
  font-size: 11px;
  color: #5670aa;
  margin-bottom: 8px;
  font-weight: 600;
}

.timeline-title {
  color: #192246;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  margin-bottom: 4px;
}

.timeline-type {
  color: #8a97b3;
  font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .search-section {
    padding: 20px 16px;
  }

  .search-section h2 {
    font-size: 24px;
  }

  .communes-list {
    grid-template-columns: 1fr;
  }

  .header-container {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
  }

  .logo {
    min-width: 0;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: 0;
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .countdown-badge {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e5e9f2;
    box-shadow: 0 4px 12px rgba(15, 32, 74, 0.08);
    padding: 12px 1rem;
    flex-direction: column;
    gap: 4px;
    z-index: 999;
    text-align: left;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.25s ease;
  }

  .menu-open .main-nav {
    max-height: 300px;
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav a {
    padding: 8px 10px;
    border-radius: 6px;
  }

  .main-nav a:hover {
    background: #f3f6fd;
  }

  .countdown-badge {
    margin-left: 0;
    font-size: 0.82rem;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
  }
  
  .site-header {
    padding: 1rem;
  }
  
  .site-footer {
    padding: 2rem 1rem 1rem;
  }

  .inner-main {
    padding: 14px 0 24px;
  }

  .inner-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .inner-content h1 {
    font-size: 34px;
  }

  .inner-stats-grid,
  .inner-list-grid {
    grid-template-columns: 1fr;
  }

  .guide-main {
    padding: 14px 0 24px;
  }

  .guide-content {
    max-width: 100%;
  }

  .guide-kpi-grid {
    grid-template-columns: 1fr;
  }

  .guide-section h2 {
    font-size: 28px;
  }

  .commune-main {
    padding: 14px 0 24px;
  }

  .commune-layout {
    grid-template-columns: 1fr;
  }

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

  .commune-side {
    position: static;
  }

  .commune-section h2 {
    font-size: 26px;
  }

  .static-main {
    padding: 14px 0 24px;
  }

  .static-section,
  .contact-info-grid,
  .contact-form {
    max-width: 100%;
  }

  .contact-info-grid,
  .contact-form-row {
    grid-template-columns: 1fr;
  }

  .cal-summary,
  .cal-section {
    max-width: 100%;
  }

  .cal-summary-grid,
  .cal-kpis {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding: 48px 0;
  }

  .home-actions {
    flex-wrap: wrap;
  }

  .home-stats-grid,
  .home-cards-grid,
  .home-timeline-grid {
    grid-template-columns: 1fr;
  }

  .home-stat-card {
    border-right: 0;
    border-bottom: 1px solid #edf0f5;
  }

  .home-stat-card:last-child {
    border-bottom: 0;
  }
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 3px solid #003087;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  padding: 20px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-banner-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

.cookie-banner-text strong {
  font-size: 16px;
  color: #003087;
  display: block;
  margin-bottom: 4px;
}

.cookie-banner-text a {
  color: #003087;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.btn-cookie {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-cookie-primary {
  background: #003087;
  color: white;
}

.btn-cookie-primary:hover {
  background: #00245f;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 48, 135, 0.2);
}

.btn-cookie-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.btn-cookie-secondary:hover {
  background: #e5e5e5;
}

@media (max-width: 768px) {
  .cookie-banner {
    padding: 16px;
  }

  .cookie-banner-content {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .cookie-banner-actions {
    width: 100%;
    flex-direction: column;
  }

  .btn-cookie {
    width: 100%;
  }
}

/* ========================================
   Alliance Simulator Styles
   ======================================== */

/* Commune Search */
.commune-search {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.commune-search label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #333;
}

.search-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.search-wrapper input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  transition: border-color 0.2s;
}

.search-wrapper input:focus {
  outline: none;
  border-color: #003087;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-top: 0.25rem;
  max-height: 300px;
  max-height: min(300px, 40dvh);
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #f8f9fa;
}

.search-result-item .dept-code {
  color: #666;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: white;
  border: 2px solid #003087;
  color: #003087;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #003087;
  color: white;
}

/* Simulator Container */
.simulator-container {
  max-width: 1000px;
  margin: 2rem auto;
}

.simulator {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.simulator-header {
  background: linear-gradient(135deg, #003087 0%, #0047b3 100%);
  color: white;
  padding: 2rem;
}

.simulator-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

/* Simulator Controls */
.simulator-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e5e5;
}

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

.control-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

.control-group input[type="number"] {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.control-group input[type="range"] {
  width: 100%;
}

/* Lists Configuration */
.lists-config {
  padding: 2rem;
}

.lists-config h3 {
  margin-bottom: 1.5rem;
  color: #333;
}

.list-config {
  background: #f8f9fa;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.list-config:hover {
  border-color: #003087;
}

.list-not-qualified {
  background: #fff3cd;
  border-color: #ffc107;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.list-info {
  flex: 1;
}

.list-name {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: #003087;
  outline: none;
  cursor: text;
}

.list-name[contenteditable]:focus {
  background: rgba(0, 48, 135, 0.05);
  padding: 0.25rem;
  border-radius: 4px;
}

.list-meta {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

.badge-warning {
  display: inline-block;
  background: #ffc107;
  color: #000;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.badge-success {
  display: inline-block;
  background: #28a745;
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.list-t1-score {
  text-align: right;
  min-width: 120px;
}

.list-t1-score strong {
  display: block;
  font-size: 1.4rem;
  color: #003087;
  margin-bottom: 0.25rem;
}

.list-t1-score span {
  display: block;
  font-size: 0.85rem;
  color: #666;
}

.list-strategy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.list-strategy > label {
  font-weight: 600;
  padding-top: 0.5rem;
}

.strategy-select,
.target-list-select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
}

.strategy-options {
  margin-top: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 4px;
  display: grid;
  gap: 0.75rem;
}

.strategy-note {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.report-rate-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.report-rate-input {
  flex: 1;
}

.report-rate-value {
  min-width: 50px;
  font-weight: 600;
  color: #003087;
}

/* Simulator Results */
.simulator-results {
  padding: 2rem;
  background: #fafbfc;
}

.simulator-results h3 {
  margin-bottom: 1.5rem;
  color: #333;
}

.results-summary {
  margin-bottom: 2rem;
}

.results-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.kpi {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kpi-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #003087;
}

.results-table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.results-table th {
  background: #003087;
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

.results-table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e5e5;
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table tr.has-majority {
  background: #d4edda;
}

.results-table tr.first-place {
  background: #e7f3ff;
}

.results-table tr.has-majority.first-place {
  background: #d4edda;
}

.pct-bar {
  position: relative;
  background: #e5e5e5;
  border-radius: 4px;
  height: 24px;
  overflow: hidden;
  min-width: 100px;
}

.pct-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #003087 0%, #0047b3 100%);
  transition: width 0.3s ease;
}

.pct-value {
  position: relative;
  z-index: 1;
  display: block;
  line-height: 24px;
  padding: 0 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.evolution-positive {
  color: #28a745;
}

.evolution-negative {
  color: #dc3545;
}

.results-error {
  padding: 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  color: #856404;
}

/* Simulator Actions */
.simulator-actions {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e5e5e5;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: #003087;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #00245f;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 48, 135, 0.2);
}

.home-actions .btn-primary {
  background: #ef3340;
  color: #fff;
  border: none;
}

.home-actions .btn-primary:hover {
  background: #c7202d;
  box-shadow: 0 4px 8px rgba(239, 51, 64, 0.3);
}

/* Info Box */
.info-box {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  text-align: center;
}

.info-box p {
  margin: 0;
  color: #004085;
}

/* Simulator Intro */
.simulator-intro {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
  color: #666;
}

/* Responsive */
@media (max-width: 768px) {
  .simulator-controls {
    grid-template-columns: 1fr;
  }

  .list-header {
    flex-direction: column;
  }

  .list-t1-score {
    text-align: left;
  }

  .list-strategy {
    grid-template-columns: 1fr;
  }

  .results-kpi {
    grid-template-columns: 1fr;
  }

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

  .simulator-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

/* Alliance Simulator */
.simulator {
  margin: 2rem 0;
}

.sim-context {
  background: #f8f9fa;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.sim-field {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sim-field label {
  font-size: 0.95rem;
}

/* Unified list (1st round + projection + controls) */

.sim-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 0.3rem;
  text-align: center;
}

.sim-lists {
  margin-bottom: 1rem;
}

.sim-list {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

/* Top row: identity + 1st-round score */
.sim-list-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.sim-list-identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sim-list-identity strong {
  font-size: 1rem;
  color: #222;
}

.list-leader {
  font-size: 0.85rem;
  color: #666;
}

.sim-list-score {
  font-size: 0.9rem;
  color: #444;
  white-space: nowrap;
  text-align: right;
}

/* Dual progress bars */
.sim-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.sim-bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 48px;
  align-items: center;
  gap: 0.5rem;
}

.sim-bar-label {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.2;
}

.sim-bar-track {
  height: 10px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
}

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

.sim-bar-pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
  text-align: right;
}

.sim-bar-pct.sim-majority {
  color: #16a34a;
}

/* Vertical bar chart */
.sim-vchart {
  margin-bottom: 1.5rem;
  text-align: center;
}

.sim-vchart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: #555;
}

.sim-vchart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sim-vchart-legend-swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
}

.sim-vchart-scroll {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.sim-vchart-inner {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
}

.sim-vchart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 52px;
  transition: opacity 0.2s;
}

.sim-vcol-name {
  font-size: 0.62rem;
  color: #666;
  text-align: center;
  line-height: 1.25;
  max-width: 52px;
  width: 52px;
  height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 641px) {
  .sim-vchart-inner {
    gap: 2rem;
    padding: 1rem 1.5rem;
  }
  .sim-vchart-col {
    width: 80px;
  }
  .sim-vcol-name {
    width: 80px;
    max-width: 80px;
    font-size: 0.72rem;
  }
  .sim-vcol-pct {
    font-size: 0.75rem;
  }
}

.sim-vcol-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 100%;
}

.sim-vcol-sub {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sim-vcol-sub--r1 {
  opacity: 0.4;
}

.sim-vcol-pct {
  font-size: 0.62rem;
  font-weight: 600;
  color: #555;
  text-align: center;
  line-height: 1.1;
}

.sim-vcol-pct.sim-majority {
  color: #16a34a;
}

.sim-vcol-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  transition: height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.sim-list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}

.sim-list-controls select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
  flex: 1 1 160px;
  max-width: 260px;
}

.sim-report-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

.sim-report-row input[type="range"] {
  width: 110px;
}

.sim-report-row span {
  font-weight: 600;
  color: #0066cc;
  min-width: 38px;
}

/* Context bar — majority info */
.sim-majority-line {
  font-size: 0.9rem;
  color: #444;
  padding-top: 0.25rem;
  width: 100%;
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: center;
}

.sim-majority-line span {
  white-space: nowrap;
}

.sim-majority-line strong {
  color: #0066cc;
}

.sim-narrative {
  font-size: 0.88rem;
  color: #3a4560;
  line-height: 1.6;
  background: #f3f6fc;
  border-left: 3px solid #003087;
  border-radius: 0 6px 6px 0;
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0 0.5rem;
}

@media (max-width: 640px) {
  .sim-context {
    flex-direction: column;
    gap: 1rem;
  }

  .sim-list-top {
    flex-direction: column;
  }

  .sim-list-score {
    text-align: left;
  }

  .sim-bar-row {
    grid-template-columns: 64px 1fr 42px;
  }
}

/* ── Commune search ─────────────────────────────────────────────────────── */
.sim-search-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.sim-search-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.4rem;
}

.sim-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.sim-search-input:focus,
.sim-search-input--demo {
  outline: none;
  border-color: #003087;
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.18);
}

.sim-demo-dimmed {
  opacity: 0.25;
  pointer-events: none;
  user-select: none;
}

.sim-search-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}

.sim-search-clear:hover {
  color: #333;
}

.sim-badge-r2 {
  display: inline-block;
  background: #e7f3ff;
  color: #003087;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 3px;
  vertical-align: middle;
}

.sim-search-more {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: #888;
  font-style: italic;
  border-top: 1px solid #f0f0f0;
}

.sim-search-loading {
  font-size: 0.85rem;
  color: #888;
  margin: 0.4rem 0 0;
}

/* ── Demo notice ────────────────────────────────────────────────────────── */
.sim-demo-notice {
  font-size: 0.85rem;
  color: #888;
  background: #f9f9f9;
  border: 1px dashed #ddd;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
}

/* ── Elected state ──────────────────────────────────────────────────────── */
.sim-elected {
  margin-top: 0.5rem;
}

.sim-elected-notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #d1fae5;
  border: 1px solid #16a34a;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  color: #14532d;
  margin-bottom: 1.25rem;
}

.sim-nodata-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  color: #78350f;
  margin-bottom: 1.25rem;
}

/* Share button */
.sim-share-row {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.sim-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  background: #003087;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.sim-share-btn:hover {
  background: #00206b;
}

.sim-share-btn--copied {
  background: #16a34a;
}

.sim-elected-icon {
  font-size: 1.2rem;
}

.sim-elected-winner {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.sim-elected-winner-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 0.2rem;
}

.sim-elected-winner-leader {
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.sim-elected-winner-score {
  font-size: 0.95rem;
  color: #444;
}

.sim-elected-winner-score strong {
  color: #003087;
}

.sim-elected-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.sim-elected-rank {
  font-size: 0.85rem;
  font-weight: 700;
  color: #888;
  min-width: 1.2rem;
  text-align: center;
}

.sim-elected-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.88rem;
}

.sim-elected-row-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}
