/* Consultations au jugement majoritaire — feuille unique. Couleurs en variables, thème sombre automatique. */
:root {
  --bg: #f6f4ef; --card: #fff; --text: #1d2420; --muted: #5f6b64; --line: #e2ded4; --soft: #eef2ee;
  --accent: #2f6f5e; --accent-ink: #fff; --accent-soft: #e3efe9; --err: #b3412e; --err-soft: #fbe9e5; --info-soft: #e9eef6;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05); --r: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141816; --card: #1c221f; --text: #e8ece9; --muted: #9aa69f; --line: #2c3430; --soft: #222926;
    --accent: #6cc3a8; --accent-ink: #141816; --accent-soft: #23332d; --err: #ef8a74; --err-soft: #3a2420; --info-soft: #222a36; --shadow: none; }
  .seg, .legende i, .badge, .choix-mentions span { --c: var(--cd); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17.5px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
h1 { font-size: clamp(30px, 4.5vw, 40px); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 12px; }
h2 { font-size: 23px; margin: 30px 0 12px; }
h3 { font-size: 19px; margin: 0 0 6px; }
small { color: var(--muted); font-weight: 400; }
code { font: 13.5px ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
pre { background: var(--soft); padding: 14px; border-radius: 10px; overflow: auto; font-size: 13.5px; line-height: 1.5; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 14.5px; }
td.majo, th.majo { background: var(--accent-soft); font-weight: 700; }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
.etroit { max-width: 760px; margin-left: auto; margin-right: auto; }
.large { max-width: 1080px; }
.centre { text-align: center; }
.prose p, .prose li { max-width: 70ch; }
.prose h2 { margin-top: 34px; }
.aide { color: var(--muted); font-size: 15.5px; }
.surtitre { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.meta { color: var(--muted); font-size: 14px; }
.exemple { background: var(--soft); padding: 10px 14px; border-radius: 10px; }

/* En-tête et pied */
header.site { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); flex-wrap: wrap; }
.marque { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); position: relative; display: inline-block; }
.logo::before { content: ""; position: absolute; left: 7px; right: 7px; top: 8px; height: 4px; border-radius: 2px; background: var(--accent-ink);
  box-shadow: 0 6px 0 -1px var(--accent-ink), 0 12px 0 -2px var(--accent-ink); }
header.site nav { margin-left: auto; display: flex; gap: 6px 16px; align-items: center; flex-wrap: wrap; }
header.site nav a { color: var(--muted); text-decoration: none; font-size: 16.5px; }
header.site nav a:hover { color: var(--text); }
footer.site { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }

/* Boutons, cartes, messages */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 16.5px; font-weight: 600; padding: 11px 20px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primaire { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.grand { font-size: 19px; padding: 14px 26px; }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn:disabled { opacity: .5; cursor: default; }
button.ico { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; }
button.ico:hover { color: var(--text); border-color: var(--accent); }
.carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); margin: 16px 0; }
.carte > h2:first-child, .carte > h1:first-child { margin-top: 0; }
.carte.important { border-color: var(--accent); border-width: 2px; }
.flash { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; background: var(--accent-soft); border: 1px solid var(--line); }
.flash.err { background: var(--err-soft); color: var(--err); }
.flash.info { background: var(--info-soft); color: var(--text); }
.flash ul { margin: 0; padding-left: 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.statut { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--soft); }
.statut.ouverte { background: var(--accent-soft); color: var(--accent); }
.statut.cloturee { background: var(--info-soft); }
.statut.brouillon, .statut.archive { color: var(--muted); }

/* Accueil */
.hero { text-align: center; padding: 36px 0 20px; }
.hero h1 { font-size: clamp(38px, 7vw, 60px); }
.hero .sous { font-size: 21px; max-width: 680px; margin: 0 auto 24px; color: var(--muted); }
.hero .actions { justify-content: center; }
.usages { color: var(--muted); font-size: 14px; margin-top: 22px; }
.trois { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.trois .carte { margin: 0; }
.demo-grille { display: grid; gap: 14px; }
.demo-ligne { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.demo-nom { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }

/* Choix de mention (boutons radio habillés) : commun à la démo et au bulletin */
.choix-mentions { display: flex; flex-wrap: wrap; gap: 6px; }
.choix-mentions label { position: relative; }
.choix-mentions input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.choix-mentions span { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 15.5px; cursor: pointer; }
.choix-mentions span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.choix-mentions .na span::before { background: transparent; border: 2px solid var(--muted); width: 8px; height: 8px; }
.choix-mentions input:checked + span { border-color: var(--text); background: var(--soft); font-weight: 700; box-shadow: inset 0 0 0 1px var(--text); }
.choix-mentions input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Barre de distribution + repère 50 % */
.barre { position: relative; margin: 10px 0 6px; }
.segments { display: flex; height: 44px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--soft); }
.seg { background: var(--c); flex-basis: 0; min-width: 2px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; font-size: 13.5px; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.seg span { white-space: nowrap; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
.seg.majo { outline: 2px solid var(--text); outline-offset: -2px; }
.mediane { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--text); }
.mediane span { position: absolute; top: -18px; left: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.legende { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14.5px; color: var(--muted); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 5px; }
.legende .majo { color: var(--text); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--soft); font-weight: 700; font-size: 15.5px; }
.badge::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--muted)); }
.badge.neutre::before { display: none; }

/* Résultats */
.entete-consultation { margin-bottom: 20px; }
.entete-consultation .question { font-size: 19px; margin: 0 0 8px; }
.entete-consultation .description { color: var(--muted); }
.illustration { max-width: 100%; max-height: 320px; border-radius: 12px; display: block; margin-bottom: 14px; }
.infos { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 14px; }
.infos li::before { content: "•"; margin-right: 6px; opacity: .5; }
.resultat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow); }
.resultat.premier { border-color: var(--accent); }
.resultat .entete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.resultat .entete h2, .resultat .entete h3 { margin: 0; font-size: 19px; flex: 1; min-width: 160px; }
.resultat .nom { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.resultat .nom img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.resultat .nom small { display: block; width: 100%; }
.rang { display: inline-grid; place-items: center; min-width: 36px; height: 36px; border-radius: 10px; background: var(--soft); font-weight: 800; font-size: 18px; padding: 0 6px; }
.rang small { font-size: 10px; margin-left: 4px; }
.pourquoi summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14.5px; }
.pourquoi p { margin: 8px 0 0; font-size: 15px; }
.calcul { overflow: auto; display: block; }
.etapes li { margin-bottom: 10px; }

/* Formulaires */
.formulaire label, .identification label { display: block; margin: 14px 0; font-weight: 600; }
.formulaire label small, .identification label small { display: inline; font-weight: 400; }
.formulaire input:not([type=checkbox], [type=radio], [type=file]), .formulaire textarea, .formulaire select, .identification input, .identification textarea {
  display: block; width: 100%; margin-top: 6px; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.formulaire input:focus, .formulaire textarea:focus, .identification input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.formulaire input[readonly] { background: var(--soft); color: var(--muted); }
.formulaire .deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.formulaire fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 4px; margin: 16px 0; }
.formulaire legend { font-weight: 600; padding: 0 6px; }
.formulaire h2 { margin-top: 30px; }
.radios { display: grid; gap: 8px; }
.radio { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin: 0 !important; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio input { margin-top: 4px; }
.radio span small { display: block; }
.radio.desactive { opacity: .55; cursor: default; }
.cases label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 10px 0; }
.cases input { margin-top: 4px; }
label.fichier { font-weight: 600; }
label.fichier input { margin-top: 5px; display: block; }
label.inline { display: flex !important; gap: 8px; font-weight: 400 !important; align-items: center; }
.basculer { margin: 20px 0; }
.choix-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.choix-item:last-of-type { border-bottom: 0; }
.choix-item .champs { flex: 1; }
.choix-item .champs input { margin: 0 0 6px; }
.choix-item .poignee { color: var(--muted); cursor: grab; padding: 10px 2px; user-select: none; }
.choix-item .outils { display: flex; gap: 4px; }
.choix-plus { display: grid; gap: 6px; }
.copie { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copie code { flex: 1; min-width: 200px; padding: 8px 10px; }
.copie input { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); }

/* Bulletin de vote */
.consigne { font-size: 19px; background: var(--accent-soft); padding: 12px 16px; border-radius: 10px; }
.progression { margin: 14px 0; }
.progression .jauge { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.progression .jauge span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.progression .texte { font-size: 13.5px; color: var(--muted); }
.tableau-vote .ligne.entete { display: none; }
.tableau-vote fieldset.choix { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--card); }
.tableau-vote legend.nom { font-weight: 400; padding: 0 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tableau-vote legend strong { font-size: 17px; }
.tableau-vote legend img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.tableau-vote legend small { display: block; width: 100%; }
.tableau-vote .choix-mentions { margin-top: 6px; }
.pas-a-pas { display: none; }
.recap ul { padding-left: 18px; }
.recap li b { font-weight: 600; }
.recap .manque { color: var(--err); }
.coche { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 34px; margin: 0 auto 14px; }

/* Mobile : une proposition à la fois, mentions empilées en grands boutons */
@media (max-width: 720px) {
  .bulletin .tableau-vote fieldset.choix { display: none; }
  .bulletin .tableau-vote fieldset.choix.courant { display: block; }
  .bulletin .choix-mentions { flex-direction: column; }
  .bulletin .choix-mentions span { width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 10px; }
  .pas-a-pas { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0; }
  .pas-a-pas .position { color: var(--muted); font-size: 14px; }
  .bulletin.fini .pas-a-pas { display: none; }
  .seg span b { display: none; }
}
/* Ordinateur : tableau propositions × mentions, les cercles seulement, libellés en tête de colonne */
@media (min-width: 721px) {
  .tableau-vote { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(var(--k, 7), minmax(0, 1fr)); gap: 2px; align-items: stretch; }
  .tableau-vote .ligne { display: contents; }
  .tableau-vote .ligne.entete { display: contents; }
  .tableau-vote .ligne.entete span { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: center; padding: 6px 2px; align-self: end; line-height: 1.2; }
  .tableau-vote .ligne.entete span:first-child { text-align: left; }
  .tableau-vote fieldset.choix { display: contents; border: 0; padding: 0; margin: 0; }
  .tableau-vote legend.nom { display: flex; padding: 10px 10px; background: var(--card); border-radius: 10px 0 0 10px; }
  .tableau-vote .choix-mentions { display: contents; }
  .tableau-vote .choix-mentions label { display: grid; place-items: center; background: var(--card); min-height: 56px; }
  .tableau-vote .choix-mentions label:last-child { border-radius: 0 10px 10px 0; }
  .tableau-vote .choix-mentions span { padding: 0; border: 0; background: none; font-size: 0; gap: 0; }
  .tableau-vote .choix-mentions span::before { width: 22px; height: 22px; border: 2px solid var(--c, var(--muted)); background: transparent; }
  .tableau-vote .choix-mentions .na span::before { border-color: var(--muted); width: 16px; height: 16px; }
  .tableau-vote .choix-mentions input:checked + span { box-shadow: none; background: none; }
  .tableau-vote .choix-mentions input:checked + span::before { background: var(--c, var(--muted)); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--text); }
  .tableau-vote .choix-mentions label:hover { background: var(--soft); }
}

/* Tableau de bord */
.grille-infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.grille-infos div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.grille-infos small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.grille-infos strong { font-size: 22px; }
.partage-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.qr { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: 12px; width: fit-content; }
details.danger { margin-top: 18px; }
details.danger summary { color: var(--err); cursor: pointer; font-weight: 600; }
.commentaires { list-style: none; padding: 0; }
.commentaires li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.commentaires small { display: block; }
table.codes code.petit { font-size: 11.5px; }
.cartes { list-style: none; padding: 0; }
.cartes .titre { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text); }
.cartes p { margin: 6px 0; }
#mes .carte { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#mes .carte strong { flex: 1 1 200px; }
a.petit { font-size: 12px; }

/* Page pédagogique */
.chapo { font-size: 20px; color: var(--muted); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 15px; white-space: nowrap; }
.puce::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.puce.milieu { outline: 3px solid var(--text); outline-offset: 2px; font-weight: 700; }
table.exemple-bulletin td, table.departage td { vertical-align: middle; }
table.departage th:first-child { width: 36%; }
.video { border-color: var(--accent); }
.cle-bloc { background: var(--accent-soft); border-radius: 12px; padding: 14px 18px; margin: 18px 0; }
.cle-bloc > p { margin: 4px 0; }
.cle { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.cle code { font-size: 28px; letter-spacing: .12em; padding: 8px 16px; }
