/* =====================================================================
   GCNE+ – feuille de style principale
   Chargée après Bootstrap 5.3 : elle redéfinit ses variables plutôt que
   de forcer chaque composant à coups de !important.

   Principes
   - La navigation est un éventail d'arcs fins dans le coin, comme les
     gradins d'un hémicycle ; la page est blanche, sans photo.
   - Arrondis hiérarchiques : plus l'élément est grand, plus il est doux
     (panneaux 20 px, champs 14 px, puces et boutons en pilule).
   - Une seule famille, Montserrat ; ce qui a été dit au Grand Conseil
     se distingue par sa bulle de parole, pas par une autre police.
   - Pas de capitales, pas de dégradés décoratifs, ombres réservées à ce
     qui flotte (navigation).
   ===================================================================== */

:root {
    /* Palette */
    --sapin: #2F6045;          /* vert neuchâtelois, couleur principale */
    --sapin-fonce: #1F4330;
    --sapin-pale: #E2ECE5;
    --encre: #1C2B23;          /* texte */
    --encre-douce: #56645C;    /* texte secondaire (contraste 6:1 sur blanc) */
    --brume: #EDF1EE;          /* fond des surfaces (bulles, panneaux), gris-vert du lac */
    --papier: #FFFFFF;
    --trait: #D8E0DB;
    --pierre: #D9A93A;         /* pierre jaune d'Hauterive, accent rare */
    --pierre-pale: #F7EBCB;
    --pierre-texte: #6E5210;
    --rouge: #B3332B;          /* rouge du drapeau : Non, Conseil d'État */
    --rouge-pale: #F6E1DF;
    --oui: #2E8A57;
    --abst: #A9B4AD;

    /* Formes */
    --r-xl: 28px;
    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 10px;
    --r-pill: 999px;
    --ombre-flottante: 0 1px 2px rgba(28, 43, 35, .06), 0 14px 34px -12px rgba(28, 43, 35, .28);

    /* Typographie */
    --police-ui: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
    --police-lecture: var(--police-ui);

    /* Variables Bootstrap */
    --bs-body-font-family: var(--police-ui);
    --bs-body-font-size: 1rem;
    --bs-body-line-height: 1.6;
    --bs-body-color: var(--encre);
    --bs-body-color-rgb: 28, 43, 35;
    --bs-body-bg: var(--papier);
    --bs-emphasis-color: var(--encre);
    --bs-secondary-color: var(--encre-douce);
    --bs-primary: var(--sapin);
    --bs-primary-rgb: 47, 96, 69;
    --bs-success-rgb: 46, 138, 87;
    --bs-danger-rgb: 179, 51, 43;
    --bs-secondary-rgb: 108, 122, 114;
    --bs-warning-rgb: 217, 169, 58;
    --bs-light-rgb: 237, 241, 238;
    --bs-dark-rgb: 28, 43, 35;
    --bs-link-color: var(--sapin);
    --bs-link-color-rgb: 47, 96, 69;
    --bs-link-hover-color: var(--sapin-fonce);
    --bs-link-hover-color-rgb: 31, 67, 48;
    --bs-border-color: var(--trait);
    --bs-border-radius: var(--r-md);
    --bs-border-radius-sm: var(--r-sm);
    --bs-border-radius-lg: var(--r-lg);
    --bs-border-radius-xl: var(--r-xl);
    --bs-border-radius-pill: var(--r-pill);
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */

/* Bootstrap rend le défilement de la page doux. Or un menu déroulant qui prend le
   focus en bord d'écran fait défiler la page pour s'afficher en entier : animé, ce
   défilement survient après l'ouverture de la liste, que Chrome referme aussitôt. */
:root { scroll-behavior: auto; }

body {
    background: var(--papier);
    color: var(--encre);
    font-family: var(--police-ui);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--police-ui);
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--encre);
    text-wrap: balance;
}

a { text-underline-offset: .18em; }

:focus-visible {
    outline: 3px solid var(--sapin-fonce);
    outline-offset: 2px;
}

.lien-evitement {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    background: var(--sapin);
    color: #fff;
    padding: 10px 20px;
    border-radius: 0 0 var(--r-sm) var(--r-sm);
    font-weight: 700;
    text-decoration: none;
}
.lien-evitement:focus { top: 0; color: #fff; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------------------------------------------------------------------
   En-tête : la navigation en éventail d'arcs fins dans le coin, le nom
   du site et la recherche à droite, puis l'en-tête propre à la page
   --------------------------------------------------------------------- */

.entete {
    position: relative;
    min-height: 330px;
    padding: 28px 40px 0 360px;
}

.eventail {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    width: 330px;
    height: 330px;
}
.eventail svg { display: block; overflow: visible; }
.arc,
.arc .libelle { cursor: pointer; outline: none; text-decoration: none; }
.arc .zone { fill: transparent; }
.arc .ligne { fill: none; stroke: #B7C4BC; stroke-width: 1.5px; transition: stroke .15s, stroke-width .15s; }
.arc .libelle { fill: var(--encre); font-family: var(--police-ui); font-size: 15px; font-weight: 600; transition: fill .15s; }
.arc:hover .ligne { stroke: var(--sapin); stroke-width: 2px; }
.arc:hover .libelle { fill: var(--sapin); }
.arc:focus-visible .zone { stroke: var(--sapin-fonce); stroke-width: 2px; stroke-dasharray: 4 4; }
.arc--actif .ligne,
.arc--actif:hover .ligne { stroke: var(--sapin); stroke-width: 5px; }
.arc--actif .libelle { fill: var(--sapin); font-weight: 750; }

.logo-coin {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 21;
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    color: var(--sapin);
}
.logo-coin svg,
.bouton-eventail .icone-ouvrir,
.bouton-eventail .icone-ouvrir svg { display: block; width: 100%; height: 100%; }
.bouton-eventail .icone-fermer { width: 30px; height: 30px; margin: 6px 0 0 6px; }
.bouton-eventail { display: none; }

.entete-colonne { display: flex; flex-direction: column; gap: 22px; max-width: 1040px; }
.entete-haut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.nom-site { display: block; color: var(--encre); text-decoration: none; }
.nom-site:hover { color: var(--encre); }
.nom-site-nom { display: block; font-size: 1.75rem; font-weight: 800; letter-spacing: -.01em; line-height: 1; }
.nom-site-baseline { display: block; margin-top: 5px; font-size: .875rem; color: var(--encre-douce); }

.recherche-entete {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 360px;
    max-width: 100%;
    padding: 8px 2px;
    border-bottom: 2px solid var(--trait);
    transition: border-color .15s;
}
.recherche-entete:focus-within { border-color: var(--sapin); }
.recherche-entete .bi { color: var(--encre-douce); }
.recherche-entete input { flex: 1; min-width: 0; padding: 4px 0; border: 0; background: transparent; color: var(--encre); font-size: .95rem; }
.recherche-entete input:focus { outline: none; }
.recherche-entete button { flex: none; padding: 6px 4px; border: 0; background: none; color: var(--sapin); font-size: .95rem; font-weight: 700; }
.recherche-entete button:hover { text-decoration: underline; }

/* Ce que chaque page place dans l'en-tête : titre, onglets, filtres */
.entete-page { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
.entete-page .titre-page,
.entete-page .filtres,
.entete-page .profil,
.entete-page .recherche-objets { margin-bottom: 0; }
.entete-page .titre-page h1 { font-size: clamp(1.7rem, 2.6vw, 2.15rem); letter-spacing: -.02em; line-height: 1.15; }

/* Accueil : accroche et grande recherche dans l'en-tête */
.accroche { display: flex; flex-direction: column; gap: 20px; max-width: 820px; }
.accroche h1 {
    margin: 0;
    font-size: clamp(2rem, 3.6vw, 2.9rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.03em;
}
.recherche-rapide {
    display: flex;
    align-items: center;
    max-width: 600px;
    padding: 6px;
    background: var(--papier);
    border: 1px solid var(--trait);
    border-radius: var(--r-pill);
    transition: border-color .15s, box-shadow .15s;
}
.recherche-rapide:focus-within { border-color: var(--sapin); box-shadow: 0 0 0 4px rgba(47, 96, 69, .16); }
.recherche-rapide .bi { color: var(--encre-douce); margin-left: 16px; font-size: 1.1rem; }
.recherche-rapide input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    font-size: 1.05rem;
    color: var(--encre);
}
.recherche-rapide input:focus { outline: none; }
.recherche-rapide input::placeholder { color: #7B8780; }
.recherche-rapide button {
    border: 0;
    border-radius: var(--r-pill);
    background: var(--sapin);
    color: #fff;
    font-weight: 700;
    padding: 11px 24px;
    transition: background-color .15s;
}
.recherche-rapide button:hover { background: var(--sapin-fonce); }
.recherche-rapide button .bi { display: none; }
.accroche-aide { margin: -6px 0 0 8px; font-size: .95rem; color: var(--encre-douce); }
.accroche-aide a { font-weight: 700; }

/* Téléphone et tablette : l'éventail s'ouvre depuis le coin. Jusqu'a 1100 px : au-dela de l'en-tete, l'eventail
   deploye prendrait plus d'un tiers de l'ecran, et la colonne du contenu (a droite de l'eventail) moins de 700 px. */
@keyframes deplier { from { opacity: 0; transform: scale(.35); } }

@media (max-width: 1100px) {
    .entete { min-height: 0; padding: 18px 16px 0; }
    .entete-haut { min-height: 56px; padding-left: 76px; }
    .recherche-entete { width: calc(100% + 76px); margin-left: -76px; }
    .logo-coin { display: none; }
    .bouton-eventail {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 30;
        display: block;
        width: 72px;
        height: 72px;
        padding: 6px 18px 18px 6px;
        border: 0;
        border-bottom-right-radius: 72px;
        background: var(--sapin-pale);
        color: var(--sapin);
    }
    .bouton-eventail .icone-fermer { display: none; }
    .entete.est-ouvert .bouton-eventail .icone-ouvrir { display: none; }
    .entete.est-ouvert .bouton-eventail .icone-fermer { display: block; }
    html:not(.js) .eventail { position: relative; margin: -18px 0 8px -16px; }
    .js .eventail { display: none; }
    .js .entete.est-ouvert .eventail {
        display: block;
        position: fixed;
        inset: 0;
        width: auto;
        height: auto;
        background: rgba(255, 255, 255, .96);
        transform-origin: 0 0;
        animation: deplier .28s cubic-bezier(.2, .8, .2, 1) both;
    }
}

/* ---------------------------------------------------------------------
   Contenu et pied de page
   --------------------------------------------------------------------- */

/* Une seule colonne, celle de l'en-tete : a droite de l'eventail (360 px), 40 px de marge a droite, 1040 px au
   plus (.entete, .entete-colonne). Contenu centre, son bord ne tombait jamais sur celui de l'en-tete. */
.contenu {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0;
    padding: 28px 40px 72px 360px;
}
.contenu > .container { padding-left: 0; padding-right: 0; margin-top: 0 !important; }
.contenu:focus { outline: none; }
.contenu > :first-child { margin-top: 0; }

.pied {
    width: 100%;
    max-width: 1440px;
    margin: 0;
    padding: 22px 40px 32px 360px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    color: var(--encre-douce);
    font-size: .92rem;
    border-top: 1px solid var(--trait);
}

/* ---------------------------------------------------------------------
   Éléments communs
   --------------------------------------------------------------------- */

.panneau {
    background: var(--brume);
    border-radius: var(--r-lg);
    padding: 28px;
}

.titre-page {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin-bottom: 22px;
}
.titre-page h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.titre-page p { margin: 0; color: var(--encre-douce); }

.titre-section { font-size: 1.25rem; margin: 0 0 18px; }

/* Puces de filtre */
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: .45rem .95rem;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--encre-douce);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s;
}
.puce:hover { color: var(--sapin); background: var(--brume); }
.puce[aria-current="true"] { background: var(--sapin-pale); color: var(--sapin-fonce); font-weight: 700; }
.puce-compte { font-weight: 500; opacity: .75; }
.puce--ce[aria-current="true"] { background: var(--rouge-pale); color: var(--rouge); }

/* Onglets soulignés */
.onglets {
    display: inline-flex;
    gap: 26px;
    max-width: 100%;
    border-bottom: 1px solid var(--trait);
    overflow-x: auto;
    scrollbar-width: none;
}
.onglets a {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: -1px;
    padding: 10px 0 12px;
    border-bottom: 3px solid transparent;
    color: var(--encre-douce);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
}
.onglets a:hover { color: var(--encre); border-bottom-color: var(--trait); }
.onglets a[aria-current="page"] { color: var(--encre); font-weight: 700; border-bottom-color: var(--sapin); }
.onglets .compte {
    padding: .05rem .55rem;
    border-radius: var(--r-pill);
    background: var(--brume);
    color: var(--encre-douce);
    font-size: .82em;
    font-weight: 650;
}
.onglets a[aria-current="page"] .compte { background: var(--sapin-pale); color: var(--sapin-fonce); }

/* Étiquette de groupe politique ou de département */
.etiquette {
    display: inline-block;
    padding: .18rem .65rem;
    border-radius: var(--r-pill);
    background: var(--brume);
    color: var(--encre-douce);
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.4;
    text-decoration: none;
}
.etiquette--ce { background: var(--rouge-pale); color: var(--rouge); }
.etiquette--objet { background: var(--sapin-pale); color: var(--sapin-fonce); }
a.etiquette--lien { text-decoration: none; }
a.etiquette--lien:hover { background: var(--sapin-pale); color: var(--sapin-fonce); }
a.etiquette--objet:hover { background: var(--sapin); color: #fff; }

/* Avatars : photo ronde, initiales sinon */
.avatar {
    --taille: 76px;
    width: var(--taille);
    height: var(--taille);
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--sapin-pale);
    color: var(--sapin);
    font-size: calc(var(--taille) * .34);
    font-weight: 750;
    letter-spacing: .02em;
    user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--ce { background: var(--rouge-pale); color: var(--rouge); }
.avatar--presidence { background: var(--pierre-pale); color: var(--pierre-texte); }

/* Rien à afficher */
.vide {
    padding: 48px 24px;
    border-radius: var(--r-lg);
    background: var(--brume);
    color: var(--encre-douce);
    text-align: center;
}
.vide .bi { display: block; font-size: 2rem; color: var(--sapin); margin-bottom: 8px; }

/* Surlignage des résultats de recherche */
mark.surligne {
    padding: 0 .15em;
    border-radius: 4px;
    background: var(--pierre-pale);
    box-shadow: inset 0 -2px 0 var(--pierre);
    color: inherit;
    font-weight: 600;
}

/* ---------------------------------------------------------------------
   Accueil : le fil du Grand Conseil (derniers scrutins, dernière séance,
   personnes les plus entendues)
   --------------------------------------------------------------------- */

.accueil-grille {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}
.accueil-titre {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.accueil-titre h2 { margin: 0; font-size: 1.375rem; }
.accueil-titre a { font-weight: 700; font-size: .95rem; }

.cartes-votes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.carte-vote {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--brume);
    color: var(--encre);
    text-decoration: none;
    transition: box-shadow .15s;
}
.carte-vote:hover { color: var(--encre); box-shadow: 0 0 0 2px var(--sapin); }
.carte-vote-haut { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.carte-vote-haut .etiquette { white-space: nowrap; }
.carte-vote-code { color: var(--encre-douce); font-size: .875rem; font-weight: 600; }
.carte-vote-verdict { margin-left: auto; font-size: .875rem; font-weight: 750; }
.carte-vote-verdict--accepte { color: #1F6B41; }
.carte-vote-verdict--refuse { color: #962A23; }
.carte-vote-milieu { display: flex; align-items: flex-end; gap: 18px; }
.hemicycle--mini { display: block; flex: none; width: 168px; }
.hemicycle--mini .hemicycle-score,
.hemicycle--mini .hemicycle-sous-titre { display: none; }
.carte-vote-score {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1px;
    text-align: center;
    font-size: .875rem;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1;
}
.carte-vote-chiffres { display: flex; flex-direction: column; gap: 3px; color: var(--encre-douce); font-size: .8125rem; }
.carte-vote-chiffres strong { color: var(--encre); }
.carte-vote-titre { font-size: .9375rem; font-weight: 600; line-height: 1.45; }
.carte-vote-date { margin-top: auto; color: var(--encre-douce); font-size: .8125rem; font-weight: 500; }

.accueil-aside { display: flex; flex-direction: column; gap: 16px; padding-top: 44px; }
.carte-seance {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 24px;
    border-radius: var(--r-lg);
    background: var(--sapin);
    color: #fff;
}
.carte-seance h2 { margin: 0; font-size: .9375rem; font-weight: 600; color: rgba(255, 255, 255, .85); }
.carte-seance-date { margin: 0; font-size: 1.5rem; font-weight: 750; line-height: 1.2; }
.carte-seance-detail { margin: 0; font-size: .9375rem; color: rgba(255, 255, 255, .85); }
.carte-seance .btn {
    align-self: flex-start;
    margin-top: 6px;
    --bs-btn-bg: #fff;
    --bs-btn-color: var(--sapin-fonce);
    --bs-btn-border-color: #fff;
    --bs-btn-hover-bg: var(--sapin-pale);
    --bs-btn-hover-color: var(--sapin-fonce);
    --bs-btn-hover-border-color: var(--sapin-pale);
}
.carte-seance .btn:focus-visible { outline-color: #fff; }

.orateurs { padding: 22px 24px; border-radius: var(--r-lg); background: var(--brume); }
.orateurs h2 { margin: 0 0 14px; font-size: 1.0625rem; }
.orateurs ol { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.orateur { display: flex; align-items: center; gap: 12px; }
.orateur .avatar { --taille: 40px; }
.orateur-texte { flex: 1; min-width: 0; }
.orateur-nom { display: block; color: var(--encre); font-size: .9375rem; font-weight: 700; text-decoration: none; }
.orateur-nom:hover { color: var(--sapin); text-decoration: underline; }
.orateur-groupe { color: var(--encre-douce); font-size: .8125rem; }
.orateur-nb { color: var(--encre-douce); font-size: .875rem; white-space: nowrap; }
.orateur-nb strong { color: var(--encre); }

@media (max-width: 960px) {
    .accueil-grille { grid-template-columns: minmax(0, 1fr); }
    .accueil-aside { padding-top: 0; }
}
@media (max-width: 640px) {
    .cartes-votes { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------------
   Listes de personnes
   --------------------------------------------------------------------- */

.filtres { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 24px; }

.presidence {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding: 20px 0;
    border-top: 1px solid var(--trait);
    border-bottom: 1px solid var(--trait);
}
.presidence .avatar { --taille: 84px; background: var(--pierre-pale); color: var(--pierre-texte); }
.presidence-role { margin: 0 0 2px; color: var(--pierre-texte); font-weight: 650; font-size: .95rem; }
.presidence-nom { margin: 0; font-size: 1.45rem; }
.presidence-nom a { color: var(--encre); text-decoration: none; }
.presidence-nom a:hover { text-decoration: underline; }
.presidence-groupe { margin: 2px 0 0; color: var(--encre-douce); }

.trombi {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.trombi-personne {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 10px 18px;
    border-radius: var(--r-md);
    text-align: center;
    transition: background-color .15s;
}
.trombi-personne:hover { background: var(--brume); }
.trombi-nom { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.25; }
.trombi-nom a { color: var(--encre); text-decoration: none; }
.trombi-nom a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); }
.trombi-nom a:focus-visible { outline: none; }
.trombi-nom a:focus-visible::after { outline: 3px solid var(--sapin-fonce); outline-offset: -3px; }

/* ---------------------------------------------------------------------
   Fiches (député-e, conseiller-ère, objet)
   --------------------------------------------------------------------- */

.profil {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 24px;
    margin-bottom: 26px;
}
.profil .avatar { --taille: 112px; }
.profil h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 8px; }
.profil-etiquettes { display: flex; flex-wrap: wrap; gap: 6px; }

.objet-type { margin-bottom: 10px; }
.objet-code {
    font-size: clamp(2.6rem, 6vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
    margin: 0 0 14px;
}
.objet-titre {
    max-width: 62ch;
    margin: 0 0 24px;
    font-family: var(--police-lecture);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.55;
    color: #26332B;
}

.fiche-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}
.fiche-meta > div {
    padding: 16px 20px;
    border-radius: var(--r-md);
    background: var(--brume);
}
.fiche-meta dt { margin-bottom: 4px; color: var(--encre-douce); font-size: .92rem; font-weight: 600; }
.fiche-meta dd { margin: 0; font-size: 1.08rem; font-weight: 700; }
.fiche-meta dd a { text-decoration: none; }
.fiche-meta dd a:hover { text-decoration: underline; }
.fiche-meta .non-renseigne { color: var(--encre-douce); font-weight: 400; font-style: italic; }

/* Parcours d'un-e député-e : législature d'entrée, groupe par législature */
.parcours-note { display: block; margin-top: 4px; color: var(--encre-douce); font-size: .85rem; font-weight: 500; }
.parcours-groupes { list-style: none; margin: 0; padding: 0; }
.parcours-groupes li { display: grid; grid-template-columns: 6.2em minmax(0, 1fr); gap: 10px; align-items: baseline; }
.parcours-groupes li + li { margin-top: 4px; }
.parcours-legislature { color: var(--encre-douce); font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.parcours-groupe { white-space: nowrap; }
.parcours-annees,
.parcours-liaison { color: var(--encre-douce); font-size: .92rem; font-weight: 500; }
.parcours-en-cours {
    display: inline-block;
    margin-left: 6px;
    padding: .05rem .55rem;
    border-radius: var(--r-pill);
    background: var(--sapin-pale);
    color: var(--sapin-fonce);
    font-size: .75rem;
    font-weight: 650;
    vertical-align: .1em;
}
@media (max-width: 1100px) {
    .contenu, .pied { padding-left: 16px; padding-right: 16px; }   /* comme .entete */
}

/* Sous le nom : le bandeau des votes, puis le parcours, sur une meme grille de trois colonnes */
.fiche-cartes { display: flex; flex-direction: column; gap: 12px; }
.portrait-cartes,
.fiche-meta--parcours { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.fiche-meta--parcours > div + div { grid-column: span 2; }

/* Bandeau « Sa façon de voter » : memes cartes que le parcours (libelle, valeur), en lien */
/* Sous-grille : libelles, valeurs et details sur les memes lignes d'une carte a l'autre, meme quand un libelle
   passe a la ligne dans une carte etroite */
.portrait-cartes { grid-template-rows: repeat(3, auto); }
.portrait-cartes > li { display: grid; grid-row: span 3; grid-template-rows: subgrid; min-width: 0; }
.portrait-carte {
    position: relative;
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    align-content: start;
    row-gap: 0;
    min-width: 0;
    padding: 16px 44px 16px 20px;
    border-radius: var(--r-md);
    background: var(--brume);
    color: var(--encre);
    text-decoration: none;
    transition: background-color .15s;
}
a.portrait-carte:hover { background: var(--sapin-pale); color: var(--encre); }
a.portrait-carte:focus-visible { outline: 3px solid var(--sapin-fonce); outline-offset: 2px; }
.portrait-libelle { align-self: end; margin-bottom: 4px; color: var(--encre-douce); font-size: .92rem; font-weight: 600; }
.portrait-valeur { font-size: 1.35rem; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.portrait-detail { margin-top: 2px; color: var(--encre-douce); font-size: .85rem; font-weight: 500; }
.portrait-carte > .bi { position: absolute; top: 50%; right: 18px; color: var(--sapin); transform: translateY(-50%); }

.portrait-calcul { font-size: .9rem; }
.portrait-calcul > summary { width: fit-content; color: var(--sapin); font-weight: 650; cursor: pointer; }
.portrait-calcul > summary:hover { text-decoration: underline; }
.portrait-calcul ul { max-width: 72ch; margin: 10px 0 0; padding-left: 1.2em; color: var(--encre-douce); line-height: 1.55; }
.portrait-calcul li + li { margin-top: 6px; }
.portrait-calcul li::marker { color: var(--sapin); }
.note-votes { margin: 0 0 16px; color: var(--encre-douce); }
/* Interventions : la largeur de deux colonnes de la grille (une ligne de lecture confortable), bord droit sur
   celui de la deuxieme carte */
.contenu > .discours-liste { max-width: calc((100% - 24px) / 3 * 2 + 12px); }

@media (max-width: 640px) {
    .portrait-cartes,
    .fiche-meta--parcours { grid-template-columns: minmax(0, 1fr); }
    .portrait-cartes { grid-template-rows: none; }
    .contenu > .discours-liste { max-width: none; }
    .fiche-meta--parcours > div + div { grid-column: auto; }
}

/* Tableau des votes : position du groupe, ligne discrètement marquée quand la décision en diffère.
   Largeurs fixes : la colonne « Scrutin » prend le reste. En largeur automatique, un titre sans espace (nom de
   fichier) l'empechait de retrecir et le tableau debordait de la colonne. */
.tableau-votes { table-layout: fixed; }
.tableau-votes .vote-objet,
.tableau-votes .vote-scrutin { overflow-wrap: anywhere; }
.tableau-votes .col-objet,
.tableau-votes .col-decision,
.tableau-votes .col-resultat { width: 7rem; }
.tableau-votes .col-groupe { width: 8.5rem; }
/* Cellule « Scrutin » : date, titre de l'objet, puis titre du scrutin en plus petit */
.cellule-scrutin { min-width: 12rem; }
.vote-date { display: block; color: var(--encre-douce); font-size: .8rem; }
.vote-objet { display: block; font-weight: 600; line-height: 1.4; }
.vote-objet--scrutin { font-weight: 500; }
.vote-scrutin { display: block; margin-top: 2px; color: var(--encre-douce); font-size: .85rem; line-height: 1.35; }
.position { display: inline-flex; align-items: center; gap: 6px; color: var(--encre-douce); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.position::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--pastille); }
.position--oui { --pastille: var(--oui); }
.position--non { --pastille: var(--rouge); }
.position--abst { --pastille: var(--abst); }
.position--sans { font-weight: 500; }
.position--sans::before { display: none; }
/* Comme le surlignage des recherches : fond pierre très pâle et filet pierre, sans rouge. Bootstrap colore
   les cellules au survol par une ombre intérieure : on la garde sous le filet. */
.tableau-votes .vote-ecart { --bs-table-bg: #FBF5E6; }
.vote-ecart > td:first-child {
    box-shadow: inset 3px 0 0 var(--pierre), inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
}
.vote-ecart .position { color: var(--pierre-texte); }
.libelle-mobile { display: none; }

/* A droite de l'eventail, la colonne ne laisse au tableau que 690 a 790 px entre 1101 et 1200 px de large : la
   colonne des titres y serait ecrasee. En dessous de 1200 px, le tableau passe en blocs. */
@media (max-width: 1200px) {
    /* Telephone : chaque vote devient un bloc. Numero, decision et position du groupe sur une ligne, puis
       les titres sur toute la largeur ; le resultat du scrutin reste sur la fiche de l'objet. Dans un tableau,
       la colonne des titres etait ecrasee par les autres et les mots coupes au milieu. */
    .tableau-votes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .tableau-votes, .tableau-votes tbody { display: block; }
    .tableau-votes tr {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr);
        align-items: center;
        gap: 8px 10px;
        padding: 12px 8px;
        border-bottom: 1px solid var(--trait);
    }
    .tableau-votes tbody tr:last-child { border-bottom: 0; }
    .tableau-votes > :not(caption) > * > * { display: block; padding: 0; border: 0; background: none; box-shadow: none; }
    .tableau-votes .col-resultat { display: none; }
    .tableau-votes .cellule-scrutin { grid-column: 1 / -1; grid-row: 2; }
    .tableau-votes .cellule-groupe { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }
    .libelle-mobile { display: inline; color: var(--encre-douce); font-size: .85rem; white-space: nowrap; }
    .vote-objet, .vote-scrutin { overflow-wrap: break-word; }   /* titres de signets sans espace */
    .tableau-votes .vote-ecart { background: #FBF5E6; box-shadow: inset 3px 0 0 var(--pierre); }
    .tableau-votes .vote-ecart > td:first-child { box-shadow: none; }
}

/* ---------------------------------------------------------------------
   Page Groupes : jauges, matrice des accords, scrutins serres
   --------------------------------------------------------------------- */
.groupes-perimetre { margin: 0 0 28px; color: var(--encre-douce); }
.groupes-section { margin-bottom: 44px; }
.section-aide { max-width: 72ch; margin: -8px 0 16px; color: var(--encre-douce); }
.groupes-calcul { margin-top: -12px; }

/* Legende du temps de parole : la barre (part des debats) et le repere (part des sieges) */
.legende-parole { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -6px 0 12px; color: var(--encre-douce); font-size: .85rem; }
.legende-parole > span { display: inline-flex; align-items: center; gap: 7px; }
.legende-barre { width: 18px; height: 8px; border-radius: 0 4px 4px 0; background: var(--sapin); }
.legende-repere { width: 3px; height: 14px; border-radius: 2px; background: var(--encre); }

.tableau-groupes { table-layout: fixed; margin: 0; }
.tableau-groupes .col-groupe-nom { width: 8rem; }
.tableau-groupes .col-sieges { width: 5.5rem; }
.groupe-nom { font-weight: 700; }
.groupe-nom a { color: var(--encre); text-decoration: none; }
.groupe-nom a:hover { color: var(--sapin); text-decoration: underline; }
.groupe-sieges { font-weight: 650; font-variant-numeric: tabular-nums; }
.tableau-groupes .non-renseigne { color: var(--encre-douce); font-size: .88rem; font-style: italic; }

/* Jauge : piste plus claire que le panneau, barre de 8 px qui part de la gauche, bout arrondi a 4 px */
.mesure { display: flex; align-items: center; gap: 10px; }
.mesure-piste { position: relative; flex: 1; min-width: 56px; height: 8px; border-radius: 0 4px 4px 0; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait); }
.mesure-barre { position: absolute; top: 0; bottom: 0; left: 0; max-width: 100%; border-radius: 0 4px 4px 0; background: var(--sapin); }
.mesure-repere { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--encre); box-shadow: 0 0 0 2px var(--brume); }
.mesure-chiffre { flex: none; min-width: 3.4em; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.25; }
.mesure-detail { display: block; color: var(--encre-douce); font-size: .78rem; font-weight: 500; white-space: nowrap; }

/* Matrice des accords : rampe d'une seule teinte, du plus clair (moins de 50 %) au plus fonce (90 % et plus) ;
   texte fonce sur les quatre premiers pas, blanc sur les deux derniers (contraste 5:1 au moins) */
.matrice-cadre { overflow-x: auto; overflow-y: hidden; padding: 2px; }
.matrice-accords { border-collapse: separate; border-spacing: 2px; font-variant-numeric: tabular-nums; }
.matrice-accords th { padding: 6px 10px; color: var(--encre-douce); font-size: .9rem; font-weight: 650; white-space: nowrap; }
.matrice-accords thead th { text-align: center; }
.matrice-accords tbody th { text-align: right; }
.accord { width: 4.6rem; height: 3rem; border-radius: 4px; font-weight: 650; text-align: center; }
.accord[title] { cursor: default; }
.accord[title]:hover { outline: 2px solid var(--encre); outline-offset: -2px; }
.accord--soi { background: none; }
.accord--vide { background: var(--brume); color: var(--encre-douce); }
.accord--1 { background: #EEF3EF; color: var(--encre); }
.accord--2 { background: #D5E5DA; color: var(--encre); }
.accord--3 { background: #B3D0BD; color: var(--encre); }
.accord--4 { background: #86B497; color: var(--encre); }
.accord--5 { background: #44785A; color: #FFFFFF; }
.accord--6 { background: #2F6045; color: #FFFFFF; }
.legende-rampe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; color: var(--encre-douce); font-size: .85rem; }
.legende-rampe-pas { display: flex; gap: 2px; }
.legende-rampe-pas > span { width: 28px; height: 12px; border-radius: 3px; }

/* Scrutins serres : cartes en deux colonnes */
.serres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.serres > li { display: flex; min-width: 0; }
.serre {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--r-md);
    background: var(--brume);
    color: var(--encre);
    text-decoration: none;
    transition: background-color .15s;
}
.serre:hover { background: var(--sapin-pale); color: var(--encre); }
.serre:focus-visible { outline: 3px solid var(--sapin-fonce); outline-offset: 2px; }
.serre-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.serre-date { color: var(--encre-douce); font-size: .85rem; }
.serre .verdict { margin-left: auto; font-size: .85rem; font-weight: 650; }
.serre .verdict--accepte { color: var(--oui); }
.serre .verdict--refuse { color: var(--rouge); }
.serre .vote-objet { overflow-wrap: anywhere; }
.serre-camps { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: auto; padding-top: 8px; font-size: .88rem; }
.serre-camp { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 720px) {
    /* Telephone : un bloc par groupe, nom et sieges sur une ligne, puis chaque jauge avec son libelle */
    .tableau-groupes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .tableau-groupes, .tableau-groupes tbody { display: block; }
    .tableau-groupes tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px 4px; border-bottom: 1px solid var(--trait); }
    .tableau-groupes tbody tr:last-child { border-bottom: 0; }
    .tableau-groupes > :not(caption) > * > * { display: block; padding: 0; border: 0; background: none; box-shadow: none; }
    .tableau-groupes td[data-libelle]:not(.groupe-sieges) { grid-column: 1 / -1; }
    .tableau-groupes td[data-libelle]::before { content: attr(data-libelle); display: block; margin-bottom: 4px; color: var(--encre-douce); font-size: .82rem; font-weight: 600; }
    .tableau-groupes td.groupe-sieges::before { display: inline; margin: 0 6px 0 0; }
    .serres { grid-template-columns: minmax(0, 1fr); }
    .accord { width: 3.1rem; height: 2.5rem; font-size: .82rem; }
    .matrice-accords th { padding: 4px 6px; font-size: .8rem; }
}

/* Page d'un groupe */
.lien-retour { margin: 0 0 -8px; font-size: .9rem; }   /* colle au titre malgre l'ecart de .entete-page */
.lien-retour a { color: var(--sapin); font-weight: 650; text-decoration: none; }
.lien-retour a:hover { text-decoration: underline; }
.classements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.classement-titre { margin: 0 0 8px; color: var(--encre-douce); font-size: .95rem; font-weight: 650; letter-spacing: 0; }
.classement { margin: 0; padding: 0; list-style: none; }
.classement-ligne {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 7.5rem;
    align-items: baseline;
    gap: 4px 12px;
    padding: 9px 0;
    border-top: 1px solid var(--trait);
}
.classement-ligne:last-child { border-bottom: 1px solid var(--trait); }
.classement-nom { min-width: 0; font-weight: 650; }
.classement-nom a { color: var(--encre); text-decoration: none; }
.classement-nom a:hover { color: var(--sapin); text-decoration: underline; }
a.classement-nom { color: var(--encre); text-decoration: none; }
a.classement-nom:hover { color: var(--sapin); text-decoration: underline; }
.classement-taux { font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.classement-detail { color: var(--encre-douce); font-size: .85rem; font-variant-numeric: tabular-nums; text-align: right; }
.classement--mesures .classement-ligne { grid-template-columns: minmax(0, 14rem) minmax(80px, 1fr) 7.5rem; align-items: center; }
.mesure-piste--clair { background: var(--sapin-pale); box-shadow: none; }

/* Barre segmentee fine : 8 px, une part par decision, 2 px de blanc entre les parts, sans texte (les chiffres
   sont en dessous) */
.repartition { display: flex; gap: 2px; height: 8px; margin-top: 10px; }
/* Dans une carte : la barre et ses chiffres en bas, a la meme hauteur d'une carte a l'autre */
.serre .repartition { margin-top: auto; }
.serre .repartition + .serre-camps { margin-top: 0; }
.repartition-part { flex: 0 1 0; min-width: 4px; border-radius: 4px; }
.repartition-part--oui { background: var(--oui); }
.repartition-part--non { background: var(--rouge); }
.repartition-part--abst { background: var(--abst); }

@media (max-width: 720px) {
    .classements { grid-template-columns: minmax(0, 1fr); }
    .classement--mesures .classement-ligne { grid-template-columns: minmax(0, 1fr) auto; }
    .classement--mesures .classement-nom { grid-column: 1 / -1; }
}

/* Fiche d'un objet : ses autres documents (rapports, reponses ecrites, amendements) */
.objet-pieces { margin: 0 0 18px; padding: 14px 20px; border-radius: var(--r-md); background: var(--brume); }
.objet-pieces-titre { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--encre-douce); font-size: .92rem; font-weight: 600; }
.compte-pieces { padding: 0 .5rem; border: 1px solid var(--trait); border-radius: var(--r-pill); font-size: .8rem; font-variant-numeric: tabular-nums; }
.liste-pieces { list-style: none; margin: 0; padding: 0; }
.piece { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 7px 0; }
.piece + .piece { border-top: 1px solid var(--trait); }
.piece-lien { font-weight: 700; text-decoration: none; }
a.piece-lien:hover { text-decoration: underline; }
.piece-lien .bi { margin-right: 2px; color: var(--encre-douce); }
.piece-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--encre-douce); font-size: .88rem; }
.piece-meta > span + span::before { content: "·"; content: "·" / ""; margin-right: 10px; }
.piece-vote { font-size: .88rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.piece-vote:hover { text-decoration: underline; }
.piece-vote.verdict--accepte, .piece-vote.verdict--accepte .bi { color: var(--oui); }
.piece-vote.verdict--refuse, .piece-vote.verdict--refuse .bi { color: var(--rouge); }

.objets-lies { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.objets-lies span { color: var(--encre-douce); font-weight: 600; margin-right: 4px; }

.barre-vue {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 30px 0 24px;
}

.interrupteur { display: flex; align-items: center; gap: 10px; margin: 0; }
.interrupteur.form-switch { padding-left: 0; }
.interrupteur .form-check-input { width: 2.6em; height: 1.4em; margin: 0; cursor: pointer; }
.interrupteur label { cursor: pointer; color: var(--encre-douce); font-size: .95rem; line-height: 1.3; }
.interrupteur label small { display: block; font-size: .82rem; }

/* ---------------------------------------------------------------------
   Discours : une intervention = une bulle de parole en serif
   --------------------------------------------------------------------- */

.discours-liste { max-width: 740px; }
.discours {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 0 14px;
}
.discours + .discours { margin-top: 30px; }
.discours .avatar { --taille: 46px; }
.discours--sans-avatar { grid-template-columns: minmax(0, 1fr); }
.discours-entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    min-height: 46px;
    margin-bottom: 6px;
}
.discours-orateur { color: var(--encre); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.discours-orateur:hover { color: var(--sapin); text-decoration: underline; }
/* Date et lien vers le PV : ensemble a droite, et ensemble a la ligne quand l'en-tete deborde */
.discours-quand { margin-left: auto; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 2px 10px; }
.discours-date { color: var(--encre-douce); font-size: .92rem; }
.discours--sans-avatar .discours-entete { min-height: 0; }
.discours--sans-avatar .discours-quand { margin-left: 0; justify-content: flex-start; }
.discours--sans-avatar .discours-date { font-weight: 650; color: var(--encre); }
.discours--sans-avatar .discours-objets { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
/* Lien vers le PV de la séance sur ne.ch, après la date */
.discours-source { color: var(--sapin); font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.discours-source:hover { text-decoration: underline; }
.discours-source .bi { margin-right: 2px; }
.discours-bulle {
    grid-column: 2;
    padding: 18px 22px;
    border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg);
    background: var(--brume);
    font-family: var(--police-lecture);
    font-size: .98rem;
    line-height: 1.75;
    color: #26332B;
    overflow-wrap: break-word;
}
.discours--sans-avatar .discours-bulle { grid-column: 1; border-radius: var(--r-lg); }
.discours--presidence .discours-bulle { background: var(--pierre-pale); }
.discours-pied { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.discours--sans-avatar .discours-pied { grid-column: 1; }

.discours-texte { margin: 0; white-space: pre-line; }
[data-extrait]:focus { outline: none; }

.lire-suite {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--sapin);
    font-family: var(--police-ui);
    font-weight: 700;
    font-size: .95rem;
}
.lire-suite:hover { text-decoration: underline; }
.lire-suite--reduire { display: block; margin-top: 10px; color: var(--encre-douce); font-weight: 600; }

@media (max-width: 576px) {
    .discours { grid-template-columns: minmax(0, 1fr); }
    .discours .avatar { display: none; }
    .discours-bulle, .discours-pied { grid-column: 1; border-radius: var(--r-lg); }
    .discours-entete { min-height: 0; }
}

/* ---------------------------------------------------------------------
   Scrutins : l'hémicycle de 100 sièges
   --------------------------------------------------------------------- */

.scrutin {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    align-items: center;
    gap: 20px 36px;
    padding: 26px 28px;
    border-radius: var(--r-lg);
    background: var(--brume);
}
.scrutin + .scrutin { margin-top: 16px; }
.scrutin-date { margin: 0 0 4px; color: var(--encre-douce); font-size: .875rem; font-weight: 600; }
.scrutin-titre { margin: 0 0 6px; font-size: 1.08rem; font-weight: 700; overflow-wrap: anywhere; }
.scrutin-verdict { margin: 0; font-weight: 750; font-size: 1.05rem; }
.scrutin-verdict--accepte { color: var(--oui); }
.scrutin-verdict--refuse { color: var(--rouge); }
.scrutin-verdict--inconnu { color: var(--encre-douce); }

.scrutin-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 14px 0 18px;
    padding: 0;
    list-style: none;
    font-size: .98rem;
}
.scrutin-legende li { display: flex; align-items: center; gap: 8px; }
.scrutin-legende li::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pastille);
    box-shadow: inset 0 0 0 1.5px var(--pastille-trait, transparent);
}
.scrutin-legende strong { font-weight: 750; }
.legende-oui { --pastille: var(--oui); }
.legende-non { --pastille: var(--rouge); }
.legende-abst { --pastille: var(--abst); }
.legende-absents { --pastille: transparent; --pastille-trait: #9AA69F; color: var(--encre-douce); }

.hemicycle { position: relative; }
.hemicycle svg { display: block; width: 100%; height: auto; overflow: visible; }
.siege { fill: transparent; stroke: #B9C3BD; stroke-width: 1.3; }
.siege--oui { fill: var(--oui); stroke: none; }
.siege--non { fill: var(--rouge); stroke: none; }
.siege--abst { fill: var(--abst); stroke: none; }
.hemicycle-score { font-family: var(--police-ui); font-weight: 750; font-size: 15px; letter-spacing: -.02em; fill: var(--encre); }
.hemicycle-sous-titre { font-family: var(--police-ui); font-size: 8px; font-weight: 600; fill: var(--encre-douce); }

@media (prefers-reduced-motion: no-preference) {
    .hemicycle.attend .siege { opacity: 0; }
    .hemicycle.anime .siege {
        transform-box: fill-box;
        transform-origin: center;
        animation: siege-arrive .38s cubic-bezier(.2, .8, .2, 1) both;
        animation-delay: calc(var(--i) * 7ms);
    }
}
@keyframes siege-arrive { from { opacity: 0; transform: scale(.3); } }

.scrutin-detail { grid-column: 1 / -1; }
.scrutin-detail .table-wrap { max-height: 420px; overflow-y: auto; border-radius: var(--r-md); background: var(--papier); padding: 6px 14px; }

@media (max-width: 720px) {
    .scrutin { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; }
    .scrutin .hemicycle { max-width: 320px; margin: 0 auto; width: 100%; }
}

/* ---------------------------------------------------------------------
   Recherche et liste des objets
   --------------------------------------------------------------------- */

.mise-en-page-filtres {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 32px;
}
.panneau-filtres { position: sticky; top: 20px; }
.panneau-filtres h2 { font-size: 1.15rem; margin: 0 0 18px; display: flex; align-items: center; gap: 8px; }
.panneau-filtres .form-label,
.panneau-filtres legend { font-size: .92rem; font-weight: 650; color: var(--encre); margin-bottom: 6px; }
.panneau-filtres legend { float: none; }
.panneau-filtres .champ { margin-bottom: 18px; }
.panneau-filtres .options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.panneau-filtres .periode { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 10px; }
.panneau-filtres .periode label { color: var(--encre-douce); font-size: .92rem; }
.raccourci { color: var(--encre-douce); font-size: .85rem; margin: 14px 0 0; }
.aide-syntaxe { margin-top: 10px; font-size: .88rem; }
.aide-syntaxe summary { color: var(--sapin); font-weight: 650; cursor: pointer; }
.aide-syntaxe dl { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 8px 12px; margin: 10px 0 0; }
.aide-syntaxe dt { font-weight: 400; }
.aide-syntaxe dd { margin: 0; color: var(--encre-douce); }
.aide-syntaxe p { margin: 10px 0 0; color: var(--encre-douce); font-size: .82rem; line-height: 1.5; }
.resume-recherche { max-width: 740px; margin: 0 0 22px; color: var(--encre-douce); font-size: .95rem; }
.barre-tri { align-items: center; max-width: 740px; margin-bottom: 26px; }
.barre-tri-titre { display: inline-flex; align-items: center; gap: 6px; margin-right: 2px; color: var(--encre-douce); font-size: .92rem; font-weight: 650; }
kbd {
    padding: .1rem .4rem;
    border-radius: 6px;
    background: var(--brume);
    color: var(--encre);
    border: 1px solid var(--trait);
    font-family: var(--police-ui);
    font-size: .85em;
}

@media (max-width: 860px) {
    .mise-en-page-filtres { grid-template-columns: minmax(0, 1fr); }
    .panneau-filtres { position: static; }
}

.recherche-objets {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 640px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--papier);
    border: 1px solid var(--trait);
    border-radius: var(--r-pill);
}
.recherche-objets:focus-within { border-color: var(--sapin); box-shadow: 0 0 0 4px rgba(47, 96, 69, .16); }
.recherche-objets .bi { margin-left: 14px; color: var(--encre-douce); }
.recherche-objets input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 10px; color: var(--encre); }
.recherche-objets input:focus { outline: none; }

/* Liste des objets : la recherche dans l'en-tête, les filtres dans le panneau */
.recherche-objets-bloc { display: flex; flex-direction: column; gap: 10px; }
.aide-recherche { margin: 0 0 0 18px; color: var(--encre-douce); font-size: .85rem; }
.chercher-dans { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 4px; margin: 0 0 0 18px; font-size: .92rem; }
.chercher-dans legend { float: none; width: auto; margin: 0 10px 0 0; padding: 0; font-size: inherit; font-weight: 650; color: var(--encre-douce); }
.chercher-dans .form-check-inline { margin-right: 14px; }

.filtres-repliables > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; }
.filtres-repliables > summary::-webkit-details-marker { display: none; }
.filtres-repliables > summary h2 { margin: 0; }
.filtres-repliables[open] > summary { margin-bottom: 18px; }
.replier-icone { color: var(--encre-douce); transition: transform .15s; }
.filtres-repliables[open] .replier-icone { transform: rotate(180deg); }
.compte-filtres {
    padding: .05rem .55rem;
    border-radius: var(--r-pill);
    background: var(--sapin);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}
@media (min-width: 861px) {
    /* Grand écran : le panneau reste ouvert, et défile s'il est plus haut que la fenêtre
       (sinon, collé en haut, son bouton resterait hors d'atteinte) */
    .filtres-repliables > summary { pointer-events: none; }
    .replier-icone { display: none; }
    .panneau-filtres { max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
@media (max-width: 860px) {
    .filtres-repliables > summary { cursor: pointer; }
    .panneau-filtres { padding: 18px 22px; }
}

.options--comptes .form-check-label { display: flex; justify-content: space-between; gap: 10px; }
.compte-choix { color: var(--encre-douce); font-size: .85rem; font-variant-numeric: tabular-nums; }
.form-check--vide .form-check-label { opacity: .5; }
.aide-champ { margin: 6px 0 0; color: var(--encre-douce); font-size: .82rem; line-height: 1.45; }

.filtres-actifs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 18px; padding: 0; }
.puce--active { background: var(--sapin-pale); color: var(--sapin-fonce); }
.puce--active:hover { background: var(--sapin); color: #fff; }
.puce--active .bi { font-size: .75em; }

.barre-resultats { margin-bottom: 18px; }
.barre-resultats .barre-tri { margin-bottom: 0; }
.lien-export { margin-left: 14px; font-size: .92rem; white-space: nowrap; }

.liste-objets { list-style: none; margin: 0; padding: 0; }
.liste-objets li + li { border-top: 1px solid var(--trait); }
.ligne-objet {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px 20px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    color: var(--encre);
    text-decoration: none;
    transition: background-color .15s;
}
.ligne-objet:hover { background: var(--brume); color: var(--encre); }
.ligne-objet-code { font-weight: 800; color: var(--sapin); font-variant-numeric: tabular-nums; }
/* Une information par ligne : type et date, titre, auteur-e, suite au Grand Conseil, extrait */
.ligne-objet-corps { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ligne-objet-surtitre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45em; font-size: .85rem; color: var(--encre-douce); }
.ligne-objet-type { font-weight: 700; color: var(--sapin); }
.ligne-objet-date { white-space: nowrap; }
.ligne-objet-date::before { content: "·"; content: "·" / ""; margin-right: .45em; }
.ligne-objet-titre { font-weight: 550; line-height: 1.4; }
.ligne-objet-titre em { font-weight: 400; color: var(--encre-douce); }
.ligne-objet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; color: var(--encre-douce); font-size: .85rem; }
.ligne-objet-meta .bi { margin-right: 2px; }
.ligne-objet-auteur { gap: 2px 8px; }
.ligne-objet-meta .etiquette { padding: .05rem .5rem; font-size: .78rem; white-space: nowrap; }
.ligne-objet-suivi > span { white-space: nowrap; }
.ligne-objet-extrait-source { display: block; color: var(--encre); font-size: .85rem; font-weight: 650; }
.ligne-objet-extrait { margin-top: 2px; padding-left: 10px; border-left: 2px solid var(--trait); color: var(--encre-douce); font-size: .9rem; line-height: 1.5; }
.ligne-objet > .bi-chevron-right { align-self: center; }
.ligne-objet .bi { color: var(--encre-douce); }
.ligne-objet .verdict { font-weight: 650; }
.ligne-objet .verdict--accepte,
.ligne-objet .verdict--accepte .bi { color: var(--oui); }
.ligne-objet .verdict--refuse,
.ligne-objet .verdict--refuse .bi { color: var(--rouge); }
@media (max-width: 576px) {
    .ligne-objet { grid-template-columns: minmax(0, 1fr) auto; }
    .ligne-objet-corps { grid-column: 1 / -1; grid-row: 2; }
    .ligne-objet > .bi-chevron-right { align-self: start; }
    .chercher-dans { margin-left: 8px; }
}

.tri {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--encre-douce);
    font-weight: 600;
    text-decoration: none;
    font-size: .95rem;
}
.tri:hover { color: var(--sapin); }

/* ---------------------------------------------------------------------
   Présentation du projet : un texte court, la genèse en frise verticale
   --------------------------------------------------------------------- */

.presentation-entete { max-width: 720px; }
.presentation-entete h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 2.6vw, 2.15rem); letter-spacing: -.02em; line-height: 1.15; }
.presentation-chapo { max-width: 62ch; margin: 0; font-size: 1.125rem; line-height: 1.55; color: var(--encre-douce); }

.presentation { max-width: 720px; }
.presentation > section + section,
.presentation > section + .presentation-suite { margin-top: 44px; }
.presentation h2 { margin: 0 0 14px; font-size: 1.375rem; }
.presentation p { max-width: 62ch; }
.presentation .panneau p:last-child { margin-bottom: 0; }
.presentation-liste { margin: 0; padding-left: 1.2em; }
.presentation-liste li + li { margin-top: 4px; }
.presentation-liste li::marker { color: var(--sapin); }

/* Chaque étape : une pastille sur un fil, la dernière reste ouverte */
.genese { margin: 22px 0 0; padding: 0; list-style: none; }
.genese li { position: relative; padding: 0 0 28px 36px; }
.genese li::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 22px;
    bottom: 0;
    width: 2px;
    background: var(--sapin-pale);
}
.genese li::after {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--sapin);
}
.genese li:last-child { padding-bottom: 0; }
.genese li:last-child::before { display: none; }
.genese .genese-suite::after { background: var(--papier); box-shadow: inset 0 0 0 2px var(--sapin); }
.genese-date { display: block; color: var(--sapin); font-size: .875rem; font-weight: 700; }
.genese h3 { margin: 2px 0 6px; font-size: 1.0625rem; }
.genese p { margin: 0; }
.genese-suite .genese-date { margin-bottom: 4px; }

.presentation-suite { display: flex; flex-wrap: wrap; gap: 10px; }

/* Mentions legales : memes styles que la presentation, la date de mise a jour en pied de texte */
.presentation > section + .mentions-maj { margin: 44px 0 0; color: var(--encre-douce); font-size: .92rem; }

/* ---------------------------------------------------------------------
   Composants Bootstrap, redessinés par leurs variables
   --------------------------------------------------------------------- */

.card {
    --bs-card-border-radius: var(--r-lg);
    --bs-card-inner-border-radius: calc(var(--r-lg) - 1px);
    --bs-card-border-color: transparent;
    --bs-card-cap-bg: transparent;
    --bs-card-bg: var(--brume);
}
.shadow-sm { box-shadow: none !important; }

.btn {
    --bs-btn-border-radius: var(--r-pill);
    --bs-btn-font-weight: 650;
    --bs-btn-padding-x: 1.15rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-focus-box-shadow: 0 0 0 4px rgba(47, 96, 69, .25);
}
.btn-sm { --bs-btn-padding-x: .85rem; --bs-btn-padding-y: .3rem; --bs-btn-border-radius: var(--r-pill); }
.btn-lg { --bs-btn-border-radius: var(--r-pill); }

.btn-primary,
.btn-secondary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--sapin);
    --bs-btn-border-color: var(--sapin);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--sapin-fonce);
    --bs-btn-hover-border-color: var(--sapin-fonce);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--sapin-fonce);
    --bs-btn-active-border-color: var(--sapin-fonce);
}
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-dark {
    --bs-btn-color: var(--sapin);
    --bs-btn-bg: var(--papier);
    --bs-btn-border-color: var(--trait);
    --bs-btn-hover-color: var(--sapin-fonce);
    --bs-btn-hover-bg: var(--sapin-pale);
    --bs-btn-hover-border-color: var(--sapin-pale);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--sapin);
    --bs-btn-active-border-color: var(--sapin);
}
.btn-outline-success {
    --bs-btn-color: var(--oui);
    --bs-btn-border-color: var(--oui);
    --bs-btn-hover-bg: var(--oui);
    --bs-btn-hover-border-color: var(--oui);
    --bs-btn-active-bg: var(--oui);
    --bs-btn-active-border-color: var(--oui);
}
.btn-outline-danger {
    --bs-btn-color: var(--rouge);
    --bs-btn-border-color: var(--rouge);
    --bs-btn-hover-bg: var(--rouge);
    --bs-btn-hover-border-color: var(--rouge);
    --bs-btn-active-bg: var(--rouge);
    --bs-btn-active-border-color: var(--rouge);
}

.badge {
    --bs-badge-border-radius: var(--r-pill);
    --bs-badge-font-weight: 650;
    --bs-badge-padding-x: .75em;
    --bs-badge-padding-y: .42em;
}

.form-control,
.form-select {
    padding: .6rem .9rem;
    border-color: var(--trait);
    background-color: var(--papier);
    color: var(--encre);
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--sapin);
    box-shadow: 0 0 0 4px rgba(47, 96, 69, .16);
}
.form-check-input { background-color: var(--papier); border-color: #A3B0A8; }
.form-check-input:checked { background-color: var(--sapin); border-color: var(--sapin); }

.list-group {
    --bs-list-group-active-bg: var(--sapin);
    --bs-list-group-active-border-color: var(--sapin);
    --bs-list-group-action-hover-color: var(--sapin-fonce);
    --bs-list-group-action-hover-bg: var(--brume);
    --bs-list-group-border-color: var(--brume);
    --bs-list-group-border-radius: var(--r-lg);
}

.pagination {
    --bs-pagination-color: var(--sapin);
    --bs-pagination-hover-color: var(--sapin-fonce);
    --bs-pagination-hover-bg: var(--sapin-pale);
    --bs-pagination-active-bg: var(--sapin);
    --bs-pagination-active-border-color: var(--sapin);
    --bs-pagination-border-color: var(--trait);
    --bs-pagination-focus-box-shadow: 0 0 0 4px rgba(47, 96, 69, .2);
    gap: 6px;
}
.pagination .page-link { border-radius: var(--r-pill) !important; margin-left: 0 !important; padding: .5rem 1rem; font-weight: 600; }

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--brume);
    --bs-table-border-color: var(--brume);
    margin-bottom: 0;
}
.table > thead th {
    color: var(--encre-douce);
    font-size: .9rem;
    font-weight: 650;
    border-bottom: 1px solid var(--trait);
    background: transparent;
}
.table-light { --bs-table-bg: transparent; }

.alert {
    --bs-alert-border-radius: var(--r-lg);
    --bs-alert-border-color: transparent;
}
.alert-info,
.alert-light {
    --bs-alert-bg: var(--brume);
    --bs-alert-color: var(--encre-douce);
}
.alert-warning {
    --bs-alert-bg: var(--pierre-pale);
    --bs-alert-color: var(--pierre-texte);
}

/* Décision de vote individuelle */
.decision { display: inline-block; min-width: 3.4em; padding: .2rem .7rem; border-radius: var(--r-pill); font-size: .85rem; font-weight: 700; text-align: center; }
.decision--oui { background: #DDEFE4; color: #1F6B41; }
.decision--non { background: var(--rouge-pale); color: #962A23; }
.decision--autre { background: #DFE5E1; color: #4A5750; }

/* ---------------------------------------------------------------------
   Petits écrans
   --------------------------------------------------------------------- */

@media (max-width: 576px) {
    .contenu { padding: 40px 16px 56px; }
    .pied { padding: 20px 16px 28px; }
    .panneau { padding: 20px; }
    .trombi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .presidence { padding: 16px 0; gap: 14px; }
    .presidence .avatar { --taille: 64px; }
    .profil .avatar { --taille: 84px; }
}
