/* Page « Systèmes électoraux comparés » (pipeline/systemes.py, commun/systemes.js) */
.contenu.large { max-width: 1480px; }
.filtres { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin: 8px 0 14px; }
.filtres label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.filtres label.case { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 7px; }
.filtres input[type=search], .filtres select { font: inherit; font-size: 14px; color: var(--text-primary); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; min-width: 150px; }
.filtres .segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.filtres .segmented button { font: inherit; font-size: 13px; padding: 7px 11px; border: 0; background: var(--surface-2); color: var(--text-secondary); cursor: pointer; }
.filtres .segmented button + button { border-left: 1px solid var(--border); }
.filtres .segmented button[aria-pressed=true] { background: var(--accent); color: #fff; }
.filtres .compte, .filtres .zone-choisie { margin: 0; font-size: 13px; color: var(--text-muted); flex-basis: 100%; }
.zone-choisie button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.tableau-defile { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); max-height: 78vh; }
.systemes-tableau { border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.4; min-width: 100%; }
.systemes-tableau th, .systemes-tableau td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.systemes-tableau thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); white-space: nowrap; }
.systemes-tableau thead th button { font: inherit; font-weight: 600; color: var(--text-primary); background: none; border: 0; padding: 0; cursor: pointer; }
.systemes-tableau thead th[aria-sort=ascending] button::after { content: " ▲"; font-size: 10px; }
.systemes-tableau thead th[aria-sort=descending] button::after { content: " ▼"; font-size: 10px; }
.systemes-tableau tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface-1); font-weight: 600; white-space: nowrap; }
.systemes-tableau thead th:first-child { left: 0; z-index: 3; }
.systemes-tableau td.num, .systemes-tableau th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.systemes-tableau td { min-width: 90px; max-width: 280px; }
.systemes-tableau small { display: block; color: var(--text-muted); font-size: 12px; }
.systemes-tableau tr.choisie > * { background: color-mix(in srgb, var(--accent) 14%, var(--surface-1)); }
.systemes-tableau .note-ligne { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); }
.systemes-tableau .carte-poids { font-size: 12px; margin-left: 4px; }
/* Un groupe de colonnes à la fois (pays et scrutin toujours) */
.systemes-tableau:not([data-groupe=regles]) [data-g=regles],
.systemes-tableau:not([data-groupe=droit]) [data-g=droit],
.systemes-tableau:not([data-groupe=chiffres]) [data-g=chiffres],
.systemes-tableau:not([data-groupe=effets]) [data-g=effets] { display: none; }

.formule { display: inline-block; padding: 1px 7px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.f-majoritaire { background: color-mix(in srgb, #e34948 18%, transparent); }
.f-proportionnelle { background: color-mix(in srgb, #2a78d6 18%, transparent); }
.f-mixte { background: color-mix(in srgb, #8a5cd1 20%, transparent); }
.f-indirecte { background: color-mix(in srgb, var(--text-muted) 18%, transparent); }

.definitions dl { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 8px 16px; margin: 0 0 12px; }
.definitions dt { font-weight: 600; }
.definitions dd { margin: 0; color: var(--text-secondary); }
.liste-sources { padding-left: 18px; font-size: 13px; columns: 2 420px; }
.liste-sources li { break-inside: avoid; margin-bottom: 4px; }
@media (max-width: 700px) {
  .systemes .topbar .marque span { display: none; }
  .definitions dl { grid-template-columns: 1fr; }
  .filtres input[type=search], .filtres select { min-width: 0; width: 100%; }
  .filtres label { flex: 1 1 140px; }
}
.systemes .heros { display: block; }
.systemes .heros .chapeau { max-width: 80ch; }
.systemes-tableau tbody th { min-width: 110px; }
.systemes-tableau td[data-g=chiffres]:nth-last-child(11) { min-width: 240px; }
