/* Composants réutilisables. */

/* Boutons : pilules en capitales, noir plein ou contour */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-size: var(--fs-s); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  text-decoration: none; line-height: 1.1; white-space: nowrap;
  transition: background var(--duree), color var(--duree), border-color var(--duree);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--primaire { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn--primaire:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--action-ink); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--fantome { border-color: transparent; color: var(--ink-2); }
.btn--fantome:hover { background: var(--surface-2); color: var(--ink); }
.btn--petit { min-height: 34px; padding: 6px 14px; font-size: var(--fs-xs); }
.btn--icone { width: 44px; padding: 0; }
.btn--icone.btn--petit { width: 34px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.groupe-btn { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.lien-fleche { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-transform: uppercase; font-size: var(--fs-s); letter-spacing: 0.04em; text-decoration: none; color: var(--ink); }
.lien-fleche:hover { color: var(--accent); }

/* Cartes et grilles */
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-5); }
.carte--lien { display: block; color: inherit; text-decoration: none; transition: border-color var(--duree); }
.carte--lien:hover { color: inherit; border-color: var(--ink); }
.carte--inactive { opacity: 0.55; }
.carte__titre { font-weight: 800; font-size: var(--fs-l); text-transform: uppercase; letter-spacing: 0.01em; }
.carte__meta { color: var(--ink-3); font-size: var(--fs-s); }
.grille { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grille--etroite { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--sp-4); }
.grille--large { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.pile { display: grid; gap: var(--sp-3); }
.ligne { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.entre { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); align-items: center; }

/* Étiquettes : rectangles discrets */
.pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 3px 8px; border-radius: 3px; font-size: var(--fs-xs); font-weight: 700; line-height: 1.4;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent; letter-spacing: 0.01em;
}
.pill--bon { background: var(--good-soft); color: var(--good); }
.pill--attention { background: var(--warn-soft); color: var(--warn); }
.pill--mauvais { background: var(--bad-soft); color: var(--bad); }
.pill--info { background: var(--info-soft); color: var(--info); }
.pill--accent { background: var(--ink); color: var(--paper); }
.pill--contour { background: transparent; border-color: var(--line-strong); }
.pill--s1 { background: var(--s1); color: #fff; }
.pill--s2 { background: var(--s2); color: #fff; }
.pastille-permis {
  display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px;
  border: 1.5px solid var(--ink); border-radius: 3px; font-size: 11px; font-weight: 800; letter-spacing: 0.02em; color: var(--ink);
}
.pastille-permis--bridee { border-style: dashed; }

/* Statut d'une donnée */
.statut { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); white-space: nowrap; }
.statut::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.statut--verifie { color: var(--st-verifie); }
.statut--source_unique { color: var(--st-unique); }
.statut--estime { color: var(--st-estime); }
.statut--introuvable { color: var(--st-introuvable); }
.statut--sans_objet { color: var(--ink-3); }
.statut--calcule { color: var(--ink-2); }
.statut--calcule::before { border-radius: 1px; }

/* Valeur + sources */
.valeur { display: grid; gap: 2px; min-width: 0; }
.valeur__texte { font-weight: 600; overflow-wrap: anywhere; }
.valeur--introuvable .valeur__texte { color: var(--ink-3); font-style: italic; font-weight: 400; }
.valeur--sans_objet .valeur__texte { color: var(--ink-3); font-weight: 400; }
.valeur details { font-size: var(--fs-xs); }
.valeur summary { list-style: none; display: inline-flex; gap: 6px; align-items: center; border-radius: 3px; }
.valeur summary::-webkit-details-marker { display: none; }
.valeur summary:hover .statut { text-decoration: underline; }
.valeur__detail { margin-top: 6px; padding: var(--sp-2) var(--sp-3); border-left: 2px solid var(--ink); background: var(--surface-2); color: var(--ink-2); display: grid; gap: 4px; }
.valeur__detail ul { padding-left: 1em; }
.valeur__detail li { overflow-wrap: anywhere; }

/* Tableau de caractéristiques */
.specs { width: 100%; }
.specs tr { border-top: 1px solid var(--line); }
.specs tr:first-child { border-top: 0; }
.specs th, .specs td { text-align: left; vertical-align: top; padding: 12px 0; }
.specs th { width: 42%; padding-right: var(--sp-3); font-weight: 500; color: var(--ink-2); font-size: var(--fs-s); }
@media (min-width: 720px) { .specs th { width: 36%; } }
.bloc-specs { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); align-items: start; }
.bloc-specs .carte h3 { margin-bottom: var(--sp-3); font-size: var(--fs-l); font-weight: 800; text-transform: uppercase; font-stretch: var(--large); padding-bottom: var(--sp-3); border-bottom: 2px solid var(--ink); }

/* Onglets de la fiche */
.onglets {
  display: flex; gap: var(--sp-5); overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line); margin: var(--sp-6) 0 var(--sp-6);
  position: sticky; top: var(--entete-h); z-index: 20; background: var(--paper);
}
.onglets::-webkit-scrollbar { display: none; }
.onglet {
  flex-shrink: 0; padding: 16px 0 14px; color: var(--ink-3); text-decoration: none;
  font-weight: 700; font-size: var(--fs-s); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.onglet:hover { color: var(--ink); }
.onglet[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Navigation collante du comparateur */
.nav-collante { position: sticky; top: var(--entete-h); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); margin: 0 calc(-1 * var(--sp-4)); padding: 0 var(--sp-4); }
.nav-collante ul { list-style: none; padding: 0; margin: 0; display: flex; gap: var(--sp-5); overflow-x: auto; scrollbar-width: none; }
.nav-collante ul::-webkit-scrollbar { display: none; }
.nav-collante button {
  background: none; border: 0; padding: 16px 0 14px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); border-bottom: 3px solid transparent; white-space: nowrap;
}
.nav-collante button:hover { color: var(--ink); }
.nav-collante button[aria-current="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Barres comparatives A / B */
.barres { display: grid; gap: var(--sp-5); }
.barre-ligne { display: grid; gap: 6px; }
.barre-ligne__titre { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-s); }
.barre-ligne__titre strong { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: var(--fs-xs); }
.barre-ligne__serie { display: grid; grid-template-columns: 1fr minmax(96px, auto); gap: var(--sp-3); align-items: center; }
.barre { height: 8px; background: var(--surface-3); overflow: hidden; }
.barre__rempli { display: block; height: 100%; width: var(--p, 0%); transition: width 400ms ease-out; }
.barre__rempli--a { background: var(--s1); }
.barre__rempli--b { background: var(--s2); }
.barre__rempli--seule { background: var(--ink); }
.barre__valeur { font-weight: 700; font-size: var(--fs-s); text-align: right; white-space: nowrap; }
.barre__valeur--manque { color: var(--ink-3); font-weight: 400; font-style: italic; font-size: var(--fs-xs); }
.verdict-phrase { font-size: var(--fs-s); color: var(--ink-2); padding-left: var(--sp-3); border-left: 3px solid var(--line-strong); }
.verdict-phrase--a { border-left-color: var(--s1); }
.verdict-phrase--b { border-left-color: var(--s2); }
.aide-btn { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3); font: 700 10px/1 var(--font); padding: 0; }
.aide-btn:hover { color: var(--ink); border-color: var(--ink); }
.bulle-aide { font-size: var(--fs-xs); color: var(--ink-2); background: var(--surface-2); padding: 8px 10px; }

/* Tableau comparatif */
.tableau-comp { font-size: var(--fs-s); }
.tableau-comp caption { text-align: left; padding-bottom: var(--sp-2); font-weight: 700; }
.tableau-comp th, .tableau-comp td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tableau-comp thead th { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); border-bottom: 2px solid var(--ink); }
.tableau-comp thead th.col-a { color: var(--s1); }
.tableau-comp thead th.col-b { color: var(--s2); }
.tableau-comp tbody th { font-weight: 500; color: var(--ink-2); width: 34%; }
.tableau-comp td.meilleur { background: var(--good-soft); }
.tableau-comp td.pire { background: var(--bad-soft); }
.defilement-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Dialogue */
.dialogue { width: min(760px, calc(100vw - 24px)); max-height: min(88vh, 920px); padding: 0; border: 0; border-radius: var(--radius-l); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); }
.dialogue::backdrop { background: rgb(0 0 0 / 0.55); }
.dialogue[open] { animation: apparition 180ms ease-out; }
.dialogue__entete { display: flex; align-items: start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-6) var(--sp-6) var(--sp-4); position: sticky; top: 0; background: var(--surface); z-index: 1; border-bottom: 1px solid var(--line); }
.dialogue__entete h2 { font-size: var(--fs-2xl); }
.dialogue__corps { padding: var(--sp-5) var(--sp-6) var(--sp-6); overflow-y: auto; }

/* Contrôles de formulaire */
.champ { display: grid; gap: 6px; }
.champ > span, .champ > label, legend.label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); }
.saisie, select.saisie { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
select.saisie { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.saisie:focus-visible { border-color: var(--ink); }
.reglages { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
input[type="range"] { width: 100%; accent-color: var(--ink); }
input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ink); }

.segmente { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.segmente label { position: relative; }
.segmente input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmente span { display: block; padding: 8px 16px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }
.segmente input:checked + span { background: var(--ink); color: var(--paper); }
.segmente input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--info); }

.puces { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.puce { padding: 8px 16px; border-radius: 999px; border: 1px solid transparent; background: transparent; font-size: var(--fs-s); font-weight: 600; color: var(--ink-2); text-decoration: none; }
.puce:hover { color: var(--ink); background: var(--surface-2); }
.puce[aria-pressed="true"], .puce[aria-current="true"] { background: var(--surface-3); color: var(--ink); font-weight: 700; }

/* Curseurs de pondération */
.curseurs { display: grid; gap: var(--sp-3); }
.curseur { display: grid; grid-template-columns: minmax(96px, 130px) 1fr 24px; gap: var(--sp-3); align-items: center; font-size: var(--fs-s); }
.curseur output { font-weight: 700; text-align: right; }

/* Alertes */
.alerte { display: flex; gap: var(--sp-3); align-items: start; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-s); background: var(--surface-2); color: var(--ink); border-left: 3px solid var(--info); }
.alerte .icone { flex-shrink: 0; margin-top: 2px; color: var(--info); }
.alerte--attention { border-left-color: var(--warn); }
.alerte--attention .icone { color: var(--warn); }
.alerte--mauvais { border-left-color: var(--bad); }
.alerte--mauvais .icone { color: var(--bad); }
.alerte--bon { border-left-color: var(--good); }
.alerte--bon .icone { color: var(--good); }

/* Notes /10 */
.notes { display: grid; gap: var(--sp-3); }
.note { display: grid; grid-template-columns: 96px 1fr 44px; gap: var(--sp-3); align-items: center; font-size: var(--fs-s); }
.note > span:first-child { font-weight: 700; text-transform: uppercase; font-size: var(--fs-xs); letter-spacing: 0.04em; }
.note__valeur { text-align: right; font-weight: 800; }
.note__justif { grid-column: 1 / -1; color: var(--ink-3); font-size: var(--fs-xs); margin-top: -6px; }
@media (min-width: 720px) { .note__justif { grid-column: 2 / -1; } }

/* Jauge */
.jauge { --v: 0; position: relative; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--jauge-couleur, var(--ink)) calc(var(--v) * 36deg), var(--surface-3) 0); }
.jauge::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.jauge__texte { position: relative; font-weight: 900; font-size: 1.6rem; font-stretch: var(--large); line-height: 1; }
.jauge__texte small { font-size: 0.75rem; color: var(--ink-3); font-weight: 600; }

/* Barre empilée */
.empile { display: flex; height: 14px; overflow: hidden; background: var(--surface-3); }
.empile > span { height: 100%; min-width: 2px; }
.legende { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); color: var(--ink-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; display: inline-block; }
.c1 { background: #111111; } .c2 { background: #E30613; } .c3 { background: #1A4FB5; } .c4 { background: #9AA0A6; } .c5 { background: #F29900; } .c6 { background: #5F6368; }
:root[data-theme="dark"] .c1 { background: #F2F2F2; }

/* Chiffres clés */
.kpis { display: grid; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(min(50%, 150px), 1fr)); }
.kpi { padding: var(--sp-4) var(--sp-4) var(--sp-4) 0; display: grid; gap: 4px; }
.kpi .label { color: var(--ink-3); }
.kpi__valeur { font-weight: 900; font-size: var(--fs-xl); font-stretch: var(--large); line-height: 1.05; }
.kpi__valeur small { font-size: var(--fs-s); font-weight: 600; color: var(--ink-3); font-stretch: 100%; }

/* Plateau du comparateur */
.plateau {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 45;
  width: min(680px, calc(100vw - 24px)); display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap;
  padding: 10px 12px 10px 18px; background: #111111; color: #fff; border-radius: 999px; box-shadow: var(--shadow-3);
}
.plateau__motos { display: flex; gap: var(--sp-2); flex: 1; min-width: 0; flex-wrap: wrap; }
.plateau__moto { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: rgb(255 255 255 / 0.14); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; max-width: 100%; }
.plateau__moto span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plateau__moto button { background: none; border: 0; color: inherit; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.plateau__moto button:hover { background: rgb(255 255 255 / 0.22); }
.plateau .btn--primaire { background: #fff; color: #111; border-color: #fff; }
.plateau .btn { color: #fff; border-color: #fff; }
.plateau .btn:hover { background: #fff; color: #111; }
body.a-plateau main { padding-bottom: 130px; }

/* Bouton flottant */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 44; box-shadow: var(--shadow-2); }
body.a-plateau .fab { bottom: 92px; }

/* Nuanciers */
.nuancier { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pastille { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); padding: 0; }
.pastille[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.livree-btn { display: grid; gap: 6px; justify-items: center; padding: var(--sp-3) var(--sp-2); border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-xs); font-weight: 600; width: 100%; border-radius: var(--radius-s); }
.livree-btn[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.livree-btn__couleurs { display: flex; }
.livree-btn__couleurs i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); margin-left: -4px; }
.livree-btn__couleurs i:first-child { margin-left: 0; }

/* Toast */
.toasts { position: fixed; top: calc(var(--entete-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: var(--sp-2); width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { background: #111; color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow-2); font-size: var(--fs-s); font-weight: 600; animation: apparition var(--duree) ease-out; }

/* États vides et chargement */
.vide { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--ink-2); display: grid; gap: var(--sp-3); justify-items: center; }
.vide h2 { font-size: var(--fs-xl); }
.squelette { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: miroiter 1.2s infinite linear; min-height: 140px; }
@keyframes miroiter { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Méthodologie */
.methodo { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.methodo > summary { padding: var(--sp-4) 0; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.methodo__corps { padding: 0 0 var(--sp-5); display: grid; gap: var(--sp-3); font-size: var(--fs-s); color: var(--ink-2); }
.methodo__corps h3 { font-size: var(--fs-m); color: var(--ink); margin-top: var(--sp-2); text-transform: uppercase; }

/* Opinion */
.opinions { list-style: none; padding: 0; display: grid; gap: var(--sp-3); }
.opinions li { display: grid; gap: 4px; padding-left: var(--sp-4); border-left: 3px solid var(--line-strong); }
.opinions--plus li { border-left-color: var(--good); }
.opinions--moins li { border-left-color: var(--bad); }
.sources-liens { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--fs-xs); }
.sources-liens a { color: var(--ink-3); }

/* Recherche */
.recherche { position: relative; flex: 1; min-width: 0; max-width: 420px; }
.recherche input { width: 100%; height: 42px; padding: 0 12px 0 40px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); }
.recherche input:focus-visible { background: var(--surface); border-color: var(--ink); }
.recherche .icone { position: absolute; left: 14px; top: 12px; color: var(--ink-2); pointer-events: none; }
.suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); max-height: 60vh; overflow-y: auto; }
.suggestions li { padding: 10px 12px; border-radius: var(--radius-s); cursor: pointer; display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; font-size: var(--fs-s); font-weight: 600; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--surface-2); }
.suggestions li small { color: var(--ink-3); font-weight: 400; }
@media (max-width: 480px) { .suggestions { position: fixed; left: 12px; right: 12px; top: calc(var(--entete-h) + 4px); } }

/* Données saisies par le visiteur */
.statut--saisi { color: var(--accent, var(--info)); font-weight: 600; }
.saisie-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.saisie-form .saisie { width: auto; min-width: 140px; max-width: 220px; }
.saisie-form p { flex-basis: 100%; margin: 0; }
