/* Système de graphes : feuille unique. Charte v0.3 « tableau de bord animé », docs/design/CHARTE.md.
   Deux styles, un seul système : « Onyx » (par défaut) et « Verre », choisis par l'attribut data-style
   posé sur la racine. Aucune couleur en dur hors de ces blocs de variables.
   Thème clair : NON CONÇU (charte, §2). Les deux styles sont sombres quel que soit le réglage du système. */

:root {
  color-scheme: dark;
  --sans: Inter, "Helvetica Neue", Arial, sans-serif;

  /* Onyx : plaques noires opaques, grands rayons, pleins clairs, accent ambre. */
  --fond: #0A0A0B; --fond-image: none;
  --carte: #141416; --carte2: #1C1C1F; --filet: #2A2A2E; --piste: #34343A;
  --texte: #F2F2F0; --texte2: #B0B0AC; --discret: #8E8E8A;
  --accent: #F2A03A; --accent2: #F7C376; --sur-accent: #1A1206;
  --pastille: #F2F2F0; --sur-pastille: #111113;
  /* Point ouvert de la charte tranché ici [PROPOSITION] : en Onyx la route prend la teinte de l'accent,
     deux tons chauds voisins ne se distinguant pas. La recharge garde son bleu. */
  --route: #F2A03A; --recharge: #4696D6;
  /* Recharge rapide (courant continu) : magenta, séparé du bleu de la recharge normale et de la route (mesuré, charte §2). */
  --rapide: #E0559A;
  --route-voile: rgba(242, 160, 58, .16); --recharge-voile: rgba(70, 150, 214, .18);
  --rapide-voile: rgba(224, 85, 154, .16);
  --avant: #4CC38A;     /* charge déjà présente au début d'une recharge (barre de début et de fin) */
  --neutre-voile: rgba(242, 242, 240, .08);
  --flou: none; --ombre: 0 24px 48px -32px rgba(0, 0, 0, .9);
  --rayon: 20px; --rayon2: 14px;
}
:root[data-style="verre"] {
  /* Verre : plaques translucides sur un fond flou et coloré, bords lumineux, accent vert. La clarté du
     fond est bornée (charte, §2, limite mesurée) : aucun halo ne dépasse la teinte #1C3A2C. */
  --fond: #08110D;
  --fond-image: radial-gradient(60vw 50vh at 12% -5%, #1C3A2C 0%, transparent 70%),
                radial-gradient(50vw 60vh at 95% 20%, #14302A 0%, transparent 70%),
                radial-gradient(70vw 50vh at 50% 110%, #173226 0%, transparent 70%);
  --carte: rgba(255, 255, 255, .06); --carte2: rgba(255, 255, 255, .10);
  --filet: rgba(255, 255, 255, .12); --piste: rgba(255, 255, 255, .14);
  --texte: #EAF2ED; --texte2: #A7B8AE; --discret: #84978C;
  --accent: #5FE0A0; --accent2: #A5F0C8; --sur-accent: #06140D;
  --pastille: #5FE0A0; --sur-pastille: #06140D;
  --route: #C8743C; --recharge: #4696D6; --rapide: #E0559A;
  --route-voile: rgba(200, 116, 60, .2); --recharge-voile: rgba(70, 150, 214, .2);
  --rapide-voile: rgba(224, 85, 154, .18);
  --avant: #4CC38A;
  --neutre-voile: rgba(234, 242, 237, .08);
  --flou: blur(22px) saturate(1.2); --ombre: 0 24px 48px -32px rgba(0, 0, 0, .7);
  --rayon: 14px; --rayon2: 10px;
}

/* Socle commun */
.g { margin: 0; min-width: 0; font-family: var(--sans); color: var(--texte); font-variant-numeric: tabular-nums; }
.g-label { font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--discret); }
.g-note { margin: 0; font-size: 12px; color: var(--discret); }
.g-vide { padding: 24px; border: 1px dashed var(--filet); border-radius: var(--rayon2); }
.g-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
        clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Fond de page et carte : la surface qui porte un graphe. */
.g-page { background: var(--fond-image), var(--fond); background-attachment: fixed; }
.g-plate { box-sizing: border-box; min-width: 0; padding: 24px; border: 1px solid var(--filet);
           border-radius: var(--rayon); background: var(--carte); box-shadow: var(--ombre);
           -webkit-backdrop-filter: var(--flou); backdrop-filter: var(--flou); }
/* Carte vedette : un plein d'accent, une par écran au plus. Le texte y prend l'encre « sur accent ». */
.g-vedette { border-color: transparent; color: var(--sur-accent);
             background: linear-gradient(135deg, var(--accent2), var(--accent) 60%); }
.g-vedette h2, .g-vedette .g, .g-vedette .g-label, .g-vedette .g-note, .g-vedette .g-unit { color: var(--sur-accent); }
.g-vedette .g-label, .g-vedette .g-note, .g-vedette h2 { opacity: .78; }

/* Couleurs des marques : trait (s), remplissage (m), fond (b), aire (a). La couleur suit la nature de la donnée. */
.g-s-route { stroke: var(--route); }       .g-m-route { fill: var(--route); }       .g-b-route { background: var(--route); }
.g-s-recharge { stroke: var(--recharge); } .g-m-recharge { fill: var(--recharge); } .g-b-recharge { background: var(--recharge); }
.g-s-rapide { stroke: var(--rapide); }     .g-m-rapide { fill: var(--rapide); }     .g-b-rapide { background: var(--rapide); }
.g-s-repos { stroke: var(--piste); }       .g-m-repos { fill: var(--piste); }       .g-b-repos { background: var(--piste); }
.g-s-accent { stroke: var(--accent); }
.g-s-neutre { stroke: var(--texte); }
.g-s-filet { stroke: var(--filet); }
.g-s-discret { stroke: var(--discret); }
.g-s-fort { stroke: var(--texte2); }
.g-s-texte { stroke: var(--texte); }
.g-a-route { fill: var(--route-voile); }
.g-a-recharge { fill: var(--recharge-voile); }
.g-a-neutre { fill: var(--neutre-voile); }

/* Légende */
.g-legend { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0; padding: 0; list-style: none;
            font-size: 13px; color: var(--texte2); }
.g-legend li { display: flex; align-items: center; gap: 8px; }
.g-key { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; }

/* Chiffre clé */
.g-stat { display: flex; flex-direction: column; gap: 6px; }
.g-stat-value { line-height: 1.1; letter-spacing: -0.02em; }
.g-num { font-weight: 500; }
.g-unit { font-size: 15px; color: var(--texte2); }
.g-unit-avant { margin-right: 2px; }        /* monnaie devant le nombre (« £12.50 ») */
.g-stat-m .g-num { font-size: 28px; }
.g-stat-l .g-num { font-size: 40px; }
.g-stat-xl .g-num { font-size: clamp(48px, 6vw, 64px); font-weight: 600; }
.g-stat-l .g-unit, .g-stat-xl .g-unit { font-size: 20px; }
@media (min-width: 620px) { .rang > .g-stat-xl { grid-column: span 2; } }   /* un grand chiffre et son unité ne chevauchent pas le suivant */

/* Tableau */
.g-table { overflow-x: auto; }
.g-table table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 15px; }
.g-table th, .g-table td { padding: 12px 16px; text-align: left; font-weight: 400; white-space: nowrap;
                           background: var(--carte2); }
.g-table tbody th { color: var(--texte); }
.g-table tr > :first-child { border-radius: var(--rayon2) 0 0 var(--rayon2); }
.g-table tr > :last-child { border-radius: 0 var(--rayon2) var(--rayon2) 0; }
.g-table thead th { padding-block: 4px; background: none; font-size: 12px; font-weight: 500; letter-spacing: 0.14em;
                    text-transform: uppercase; color: var(--discret); }
.g-table td { color: var(--texte2); }
.g-table tbody tr > * { transition: background-color .2s ease-out; }
/* Teinte de ligne selon la nature (recharge normale ou rapide) : voile posé sur le fond de la cellule, filet à gauche. */
.g-table tbody tr.g-ton-recharge > * { background: linear-gradient(var(--recharge-voile), var(--recharge-voile)), var(--carte2); }
.g-table tbody tr.g-ton-rapide > * { background: linear-gradient(var(--rapide-voile), var(--rapide-voile)), var(--carte2); }
.g-table tbody tr.g-ton-recharge > :first-child { box-shadow: inset 3px 0 0 var(--recharge); }
.g-table tbody tr.g-ton-rapide > :first-child { box-shadow: inset 3px 0 0 var(--rapide); }
.g-table tbody tr:hover > *, .g-table tbody tr[class]:hover > * { background: var(--piste); }
/* Barre de début et de fin d'une recharge, dans sa cellule : échelle 0 à 100 %, repères et nombres dedans. */
.g-span { display: inline-block; vertical-align: middle; border-radius: 999px; overflow: hidden; }
.g-span-piste { fill: var(--fond); }
.g-span-avant { fill: var(--avant); }       /* plus sombre que la ligne, teintée ou survolée */
.g-span-repere { stroke: var(--texte); stroke-width: 2; }
.g-span-num { font-size: 11px; font-weight: 600; fill: var(--texte); font-variant-numeric: tabular-nums; }
.g-span-dedans { fill: var(--fond); }
.g-table .g-n { text-align: right; }
.g-table tbody .g-n { color: var(--texte); }

/* Barres par période : échelle graduée à gauche (et à droite pour une seconde grandeur), grille, repères, valeur écrite
   au-dessus de chaque barre quand elles sont peu nombreuses. Le survol d'une période ouvre sa bulle (charts.js). */
.g-bars { display: flex; flex-direction: column; gap: 14px; container-type: inline-size; }
.g-bars-corps { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 6px; --haut: 10px; }
.g-bars-droite { grid-template-columns: auto minmax(0, 1fr) auto; }
.g-bars-ecrites { --haut: 22px; }
.g-echelle { grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box; margin: 0;
             padding: var(--haut) 0 2px; list-style: none; font-size: 11px; color: var(--discret); white-space: nowrap; }
.g-echelle li { display: flex; align-items: center; justify-content: flex-end; height: 0; }
.g-echelle-g { grid-column: 1; }
.g-echelle-d { grid-column: 3; }
.g-echelle-d li { justify-content: flex-start; }
.g-bars-plot { grid-column: 2; grid-row: 1; display: block; box-sizing: content-box; width: 100%; height: 210px;
               padding: var(--haut) 0 2px; overflow: visible; }
.g-grille { stroke: var(--piste); stroke-width: 1; stroke-dasharray: 2 5; }
.g-grille-base { stroke: var(--discret); stroke-dasharray: none; stroke-opacity: .6; }
.g-grille-an { stroke: var(--discret); stroke-width: 1; stroke-opacity: .35; }
.g-bar-valeur { fill: var(--texte); font: 600 12px var(--sans); font-variant-numeric: tabular-nums; pointer-events: none; }
.g-vise { fill: var(--texte); fill-opacity: 0; }
.g-vise:hover, .g-vise.g-vu { fill-opacity: .07; }
.g-sur-ligne { stroke: var(--texte); stroke-width: 2; stroke-linecap: round; }
.g-sur-point { fill: var(--texte); }
.g-bars-ticks { grid-column: 2; display: flex; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--texte2); }
.g-bars-ticks li { position: relative; flex: 1 1 0; min-width: 0; display: flex; justify-content: center; white-space: nowrap; }
.g-bars-corps .g-bars-ticks li > span { display: none; }
.g-bars-ans { min-height: 36px; }
.g-bars-ans em { position: absolute; left: 2px; top: 19px; font: 600 12px/1.3 var(--sans); color: var(--texte); }
/* Écran large, moyen, étroit : le serveur a choisi ce qui tient à chaque largeur. */
@container (min-width: 700px) { .g-bars-corps .g-bars-ticks .g-v-l > span { display: block; } }
@container (min-width: 460px) and (max-width: 699.98px) { .g-bars-corps .g-bars-ticks .g-v-m > span { display: block; } }
@container (max-width: 459.98px) {
  .g-bars-corps .g-bars-ticks .g-v-s > span { display: block; }
  .g-bars-ans .g-siecle, .g-bars-ans .g-an-bref { display: none; }
  .g-bars-corps { column-gap: 6px; }
  .g-echelle, .g-bar-valeur { font-size: 10px; }
}
.g-bars .g-bar-maigre { opacity: .45; }
.g-key-maigre { opacity: .35; }

/* Bulle de survol, commune à toutes les formes dessinées en SVG. Une par page, posée par charts.js. */
.g-bulle { position: fixed; z-index: 60; left: 0; top: 0; max-width: min(320px, 90vw); box-sizing: border-box; padding: 10px 14px;
           border: 1px solid var(--piste); border-radius: 10px; background: color-mix(in srgb, var(--fond) 86%, var(--texte));
           color: var(--texte); font: 400 13px/1.5 var(--sans); font-variant-numeric: tabular-nums; pointer-events: none;
           box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .8); }
.g-bulle[hidden] { display: none; }
.g-bulle strong, .g-bulle span { display: block; }
.g-bulle strong { font-weight: 500; color: var(--texte2); }
.g-bulle span { color: var(--texte2); }
.g-bulle span:first-of-type { color: var(--texte); font-weight: 600; font-size: 15px; }

/* Périodes nommées, en filigrane, et liens par-dessus un trou (décisions de l'admin du 2026-12-01). */
.g-bande { fill: var(--texte); fill-opacity: .05; }
.g-filigrane { overflow: visible; pointer-events: none; }
.g-filigrane text { fill: var(--texte); fill-opacity: .3; font: 600 15px var(--sans); }
.g-b-periode { background: var(--texte); opacity: .3; border-radius: 2px; }
.g-bar-pont { stroke: var(--texte2); stroke-width: 1.5; stroke-dasharray: 7 5; stroke-opacity: .7; }
.g-trait.g-trait-pont { border-top: 2px dashed var(--texte2); border-radius: 0; }

/* Barres groupées : un panneau par saison : quatre de front, puis deux, puis un (les valeurs écrites ne se touchent pas). */
.g-groups .g-bar { stroke-width: var(--bar); stroke-linecap: round; }
.g-groups { display: flex; flex-direction: column; gap: 16px; container-type: inline-size; --bar: 14px; }
.g-groups-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px; }
.g-groups-panneau { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.g-groups-titre { margin: 0; font-size: 13px; color: var(--texte2); }
.g-groups .g-groups-plot { height: 130px; padding-block: 28px 8px; }
.g-groups-valeur { fill: var(--texte); font: 500 12px var(--sans); font-variant-numeric: tabular-nums; }
.g-groups .g-bar-maigre { stroke-dasharray: 3 3; stroke-linecap: butt; stroke-opacity: .6; }
.g-key-hachure { flex: 0 0 auto; width: 14px; height: 10px;
                 background: repeating-linear-gradient(0deg, var(--recharge) 0 2px, transparent 2px 5px); }
@container (max-width: 820px) { .g-groups-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 420px) { .g-groups-grille { grid-template-columns: minmax(0, 1fr); } }

/* Anneau */
.g-ring { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.g-ring-scene { position: relative; width: var(--ring, 200px); max-width: 100%; aspect-ratio: 1; }
.g-ring-s { --ring: 72px; } .g-ring-m { --ring: 200px; } .g-ring-l { --ring: 264px; }
.g-ring-scene svg { display: block; width: 100%; height: 100%; }
.g-ring-piste { stroke: var(--carte2); stroke-width: 11; }
.g-ring-arc { stroke-width: 11; stroke-linecap: round; }
.g-ring-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
                 justify-content: center; gap: 4px; text-align: center; }
.g-ring-value { line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.g-ring-m .g-num { font-size: 40px; font-weight: 600; }
.g-ring-l .g-num { font-size: 64px; font-weight: 600; }
.g-ring-decimal { font-size: 28px; font-weight: 500; color: var(--texte2); }
.g-ring-m .g-unit, .g-ring-l .g-unit { font-size: 20px; }
.g-ring-s .g-label { display: none; }
.g-ring-s .g-num { font-size: 15px; font-weight: 600; }
.g-ring-s .g-unit { font-size: 12px; }
.g-ring-s .g-ring-piste, .g-ring-s .g-ring-arc { stroke-width: 14; }

/* Pendule : cadran de 24 heures à plat. La piste entière est la journée ; la part écoulée est plus claire ;
   route et recharge s'y posent en arcs. Aiguille des heures (un tour par jour), grande aiguille, trotteuse.
   Les trois calques de l'ancien volume (lunette, face, reflet) ne sont plus dessinés. */
.g-dial { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.g-dial-stage { position: relative; width: min(400px, 100%); aspect-ratio: 1; }
.g-dial-stage > span { display: none; }
.g-dial-plot { display: block; width: 100%; height: 100%; overflow: visible; }
.g-dial-plot circle { stroke-linecap: butt; }
.g-dial-plot .g-s-filet { stroke: var(--carte2); stroke-width: 14px; }
.g-dial-plot .g-s-repos { stroke: var(--piste); }
.g-dial-plot .g-s-discret { stroke: var(--piste); }
.g-dial-plot .g-s-fort { stroke: var(--texte2); }
.g-dial-hand { stroke: var(--texte); stroke-width: 4px; stroke-linecap: round; }
.g-dial-minute { stroke: var(--texte2); stroke-width: 2.5px; stroke-linecap: round; }
/* La trotteuse saute d'une seconde à l'autre, sans glissement : elle reste visible en mouvement réduit. */
.g-dial-second { stroke: var(--accent); stroke-width: 1.5px; stroke-linecap: round; }
.g-dial-hour, .g-dial-label, .g-dial-note, .g-dial-value { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.g-dial-hour { fill: var(--discret); font-size: 13px; }
.g-dial-label { fill: var(--discret); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; }
.g-dial-value { fill: var(--texte); font-size: 72px; font-weight: 600; letter-spacing: -0.02em; }
.g-dial-decimal { fill: var(--texte2); font-size: 34px; font-weight: 500; }
.g-dial-unit { fill: var(--texte2); font-size: 26px; font-weight: 400; }
.g-dial-note { fill: var(--texte2); font-size: 13px; }
.g-dial-time { fill: var(--texte); font-size: 15px; font-weight: 500; }

/* ===== Formes de rang 2 et 3 ===== */

/* Teintes complémentaires des marques */
.g-m-neutre { fill: var(--texte); }        .g-b-neutre { background: var(--texte); }
.g-m-creux { fill: var(--carte2); }
/* Sans relevé : un vide cerné, jamais une matière. Ni zéro, ni repos. */
.g-m-absent { fill: var(--filet); }
.g-m-inconnu { fill: none; stroke: var(--discret); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.g-b-inconnu { background: none; box-shadow: inset 0 0 0 1px var(--discret); }
.g-bar-absent { stroke: var(--discret); stroke-width: 1px; stroke-dasharray: 1 5; stroke-linecap: round; }
.g-bar-extra { opacity: .34; }

/* Paliers d'une même teinte : du plein au pâle, selon le rang déclaré de la part. */
.g-o-1 { opacity: 1; fill-opacity: 1; }
.g-o-2 { opacity: .62; fill-opacity: .62; }
.g-o-3 { opacity: .38; fill-opacity: .38; }
.g-o-4 { opacity: .2; fill-opacity: .2; }
svg .g-o-1, svg .g-o-2, svg .g-o-3, svg .g-o-4 { opacity: 1; }

/* Zones de tracé allongées : toutes en pilule */
.g-timeline-plot, .g-level-plot, .g-ranked-plot, .g-share-plot {
  display: block; width: 100%; border-radius: 999px; overflow: hidden; background: var(--carte2); }

/* Axes partagés */
.g-axis-x, .g-axis-y { display: flex; justify-content: space-between; margin: 0; padding: 0; list-style: none;
                       font-size: 12px; color: var(--discret); white-space: nowrap; }
.g-axis-y { flex-direction: column; text-align: right; padding-block: 12px; }
.g-axis-y li:first-child { margin-top: -0.75em; }
.g-axis-y li:last-child { margin-bottom: -0.75em; }
.g-plot2 { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; position: relative; }
.g-plot2.g-vide { display: block; }
.g-plot2 > .g-axis-y, .g-plot2 > .g-heat-y { grid-column: 1; grid-row: 1; }
.g-plot2 > svg, .g-plot2 > .g-axis-x, .g-plot2 > .g-heat-x, .g-plot2 > .g-note { grid-column: 2; }

/* Frise d'états */
.g-timeline { display: flex; flex-direction: column; gap: 12px; }
.g-timeline-plot { height: 36px; }
.g-timeline .g-legend { margin-top: 8px; }

/* Barre de niveau */
.g-level { display: flex; flex-direction: column; gap: 8px; }
.g-level-value { line-height: 1.1; letter-spacing: -0.02em; }
.g-level-value .g-num { font-size: 28px; }
.g-level-plot { height: 10px; }
.g-level-target { stroke-width: 2; }

/* Batterie dessinée : niveau, et repère de la limite de charge. */
/* Texte dans le dessin : plafond de largeur, comme le cadran, sinon il double de taille quand la plaque s'élargit. */
.g-battery, .g-drain, .g-plate > .g-dial ~ .g-stat, .g-drain-rien { box-sizing: border-box; width: 100%; max-width: 480px; margin-inline: auto; }
.g-battery { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; }
.g-battery-plot { display: block; width: 100%; height: auto; overflow: visible; }
.g-battery-corps { fill: none; stroke: var(--texte2); stroke-width: 2; }
.g-battery-borne { fill: var(--texte2); }
.g-battery-creux { fill: var(--carte2); }
.g-battery-hachure { stroke: var(--discret); stroke-width: 2; stroke-opacity: .55; }
.g-battery-trop { opacity: .5; }
.g-battery-repere { stroke: var(--texte); stroke-width: 3; stroke-linecap: round; }
.g-battery-puce { fill: var(--pastille); }
.g-battery-mot { fill: var(--sur-pastille); font: 600 15px var(--sans); font-variant-numeric: tabular-nums; }
/* Niveau écrit dans le plein bleu (admin, 2026-12-02). Texte sombre : #111113 sur #4696D6 mesure 5,9:1 (le clair n'y
   ferait que 2,8:1). Hors du plein (niveau bas), il reprend la couleur du texte sur le creux. */
.g-battery-niveau { fill: var(--sur-pastille); font: 700 34px var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.g-battery-dehors { fill: var(--texte); }
.g-battery-unite { font-size: 20px; font-weight: 600; }

/* Perte à l'arrêt : la courbe du niveau, la perte hachurée sous son point de départ. */
.g-plate > .g-battery + .g-stat, .g-plate > .g-dial + .g-stat, .g-drain-rien { margin-top: 28px; }
.g-drain { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.g-drain-plot { display: block; width: 100%; height: auto; overflow: visible; }
.g-drain-axe { fill: var(--discret); font: 400 15px var(--sans); font-variant-numeric: tabular-nums; }
.g-drain-chiffre { fill: var(--texte); font: 600 20px var(--sans); font-variant-numeric: tabular-nums; }
.g-drain-trait { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.g-drain-repos { stroke: var(--texte); }
.g-drain-recharge { stroke: var(--recharge); }
.g-drain-route { stroke: var(--route); }
.g-drain-inconnu { stroke: var(--texte2); stroke-width: 1.5; stroke-dasharray: 6 5; }
.g-drain-depart { fill: none; stroke: var(--texte2); stroke-width: 1; stroke-dasharray: 2 4; }
.g-drain-raie { stroke: var(--texte); stroke-width: 2.5; stroke-opacity: .55; }
.g-drain-cle { background: repeating-linear-gradient(-45deg, var(--texte) 0 1.5px, transparent 1.5px 4px); }

/* Barres classées */
.g-ranked ol { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.g-ranked li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: baseline; }
.g-ranked > .g-legend { margin-top: 20px; }
.g-ranked-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte2); }
.g-ranked-value { text-align: right; font-weight: 500; }
.g-ranked-plot { grid-column: 1 / -1; height: 10px; }

/* Deux colonnes, lues de haut en bas ; une seule quand la place manque. */
.g-ranked-2 { container-type: inline-size; }
@container (min-width: 620px) {
  .g-ranked-2 ol { display: block; columns: 2; column-gap: 48px; }
  .g-ranked-2 li { break-inside: avoid; margin-bottom: 16px; }
}

/* Barre de parts */
.g-share { display: flex; flex-direction: column; gap: 16px; }
.g-share-plot { height: 28px; }
.g-share-pct { color: var(--discret); }

/* Nuage de points */
.g-scatter-plot { display: block; box-sizing: border-box; width: 100%; height: 260px; padding: 12px;
                  overflow: visible; border-radius: var(--rayon2); background: var(--carte2); }
.g-scatter-plot * { vector-effect: non-scaling-stroke; }
.g-scatter-plot .g-s-filet { stroke: var(--filet); stroke-dasharray: 2 6; }
.g-dot { stroke-width: 7; stroke-linecap: round; stroke-opacity: .7; }
.g-scatter .g-axis-x { padding-inline: 12px; }

/* Grille de chaleur */
.g-heat-plot { display: block; box-sizing: border-box; width: 100%; height: 190px; }
.g-heat-y, .g-heat-x { display: flex; margin: 0; padding: 0; list-style: none; font-size: 12px;
                       color: var(--discret); white-space: nowrap; }
.g-heat-y { flex-direction: column; }
.g-heat-y li { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; }
.g-heat-x li { flex: 1 1 0; min-width: 0; }
.g-plot2 > .g-heat-legende { grid-column: 2; }
.g-heat-legende { display: flex; flex-direction: column; gap: 6px; }
.g-heat-echelle { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--texte2); }
.g-heat-echelle li { display: flex; align-items: center; gap: 6px; }
.g-heat-cle { display: block; width: 16px; height: 12px; }
.g-heat-plot rect.g-vu { stroke: var(--texte); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* ===== Mouvement (charte, §5) =====
   Entrée de toutes les formes hors courbes. charts.js pose g-attend (état de départ, en pause) puis g-joue quand
   la forme est à l'écran, et retire tout ensuite ; jamais à la relecture périodique. Sans script, tout est en
   place d'emblée : la valeur est dans la page dès le premier octet, aucun chiffre écrit n'est masqué.
   Même durée et même courbe de vitesse que le tracé des courbes (chartfx.js).
   Mouvement réduit : 750 ms, révélation seule (ni montée, ni extension, ni rotation). */
:root { --g-duree: 1333ms; --g-allure: cubic-bezier(.37, 0, .63, 1); }
:where(.g-anime, .g-attend, .g-joue) :where(.g-bar, .g-plein, .g-ring-arc, .g-dial-plot circle, .g-timeline-plot,
  .g-share-plot, .g-scatter-plot, .g-heat-plot, .g-bars-plot, .g-ranked-plot, .g-level-plot, .g-drain-plot) {
  animation-duration: var(--g-duree); animation-timing-function: var(--g-allure); animation-fill-mode: both; }
:is(.g-anime, .g-attend, .g-joue) :is(.g-timeline-plot, .g-share-plot, .g-scatter-plot, .g-heat-plot, .g-drain-plot) {
  animation-name: g-trace; }
@media (prefers-reduced-motion: no-preference) {
  .g-table { scroll-behavior: smooth; }
  :is(.g-anime, .g-attend, .g-joue) .g-bar { transform-box: fill-box; transform-origin: 50% 100%;
    animation-name: g-monte; animation-duration: calc(var(--g-duree) * .6); }
  /* La vague traverse le graphe : la dernière barre arrive en même temps que la fin d'une courbe. */
  :is(.g-anime, .g-attend, .g-joue) .g-r1 { animation-delay: 76ms; }
  :is(.g-anime, .g-attend, .g-joue) .g-r2 { animation-delay: 152ms; }
  :is(.g-anime, .g-attend, .g-joue) .g-r3 { animation-delay: 228ms; }
  :is(.g-anime, .g-attend, .g-joue) .g-r4 { animation-delay: 304ms; }
  :is(.g-anime, .g-attend, .g-joue) .g-r5 { animation-delay: 380ms; }
  :is(.g-anime, .g-attend, .g-joue) .g-r6 { animation-delay: 456ms; }
  :is(.g-anime, .g-attend, .g-joue) .g-r7 { animation-delay: 532ms; }
  :is(.g-anime, .g-attend, .g-joue) .g-plein { transform-box: fill-box; transform-origin: 0 50%;
    animation-name: g-etend; }
  :is(.g-anime, .g-attend, .g-joue) .g-ring-arc { animation-name: g-anneau; }
  :is(.g-anime, .g-attend, .g-joue) .g-dial-plot circle[stroke-dasharray] { animation-name: g-cadran; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --g-duree: 750ms; }
  :is(.g-anime, .g-attend, .g-joue) :is(.g-bars-plot, .g-ranked-plot, .g-level-plot) { animation-name: g-trace; }
  :is(.g-anime, .g-attend, .g-joue) :is(.g-ring-arc, .g-dial-plot circle) { animation-name: g-parait; }
}
/* Après toutes les autres : l'état d'attente est la première image, figée. */
:is(.g-anime, .g-attend) :is(.g-bar, .g-plein, .g-ring-arc, .g-dial-plot circle, .g-timeline-plot, .g-share-plot,
  .g-scatter-plot, .g-heat-plot, .g-bars-plot, .g-ranked-plot, .g-level-plot, .g-drain-plot) { animation-play-state: paused; }
@media print {
  .g * { animation: none !important; }
}
@keyframes g-monte { from { transform: scaleY(0); } }
@keyframes g-etend { from { transform: scaleX(0); } }
@keyframes g-trace { from { clip-path: inset(-12px 100% -12px 0); } to { clip-path: inset(-12px 0 -12px 0); } }
@keyframes g-anneau { from { stroke-dasharray: 0 100; } }
@keyframes g-cadran { from { stroke-dasharray: 0 1440; } }
@keyframes g-parait { from { opacity: 0; } }

/* ===== Graphes en courbe (ChartFx) =====
   Le dessin est fait par chartfx.js dans le canvas ; cette règle ne fixe que sa boîte. */
.g-fx { position: relative; }
.g-fx .g-legend { margin-bottom: 8px; }
/* Clé d'une courbe : un trait, plein ou tireté comme sur le graphe. */
.g-trait { flex: 0 0 auto; width: 22px; height: 0; border-top: 3px solid var(--texte); border-radius: 2px; }
.g-t-accent { border-color: var(--accent); } .g-t-route { border-color: var(--route); }
.g-t-recharge { border-color: var(--recharge); } .g-t-neutre { border-color: var(--texte); }
.g-trait-tirets { border-top-style: dotted; border-radius: 0; }
.g-trait-ref { border-top: 1px dashed var(--texte2); border-radius: 0; }
.g-bars-ref { stroke: var(--texte2); stroke-width: 1; stroke-dasharray: 6 4; }
.g-fx-plot { display: block; width: 100%; height: 240px; touch-action: pan-y; }
/* Graphe réduit, à côté de chiffres dans une même plaque. */
.g-compact .g-fx-plot { height: 150px; }
.g-compact h3 { margin: 0 0 8px; font: 500 13px/1.4 var(--sans); color: var(--texte2); }
/* Sans script : le résumé du lecteur d'écran devient le contenu visible, la boîte vide disparaît. */
html:not(.js) .g-fx .g-sr { position: static; width: auto; height: auto; margin: 0; overflow: visible;
                            clip-path: none; white-space: normal; color: var(--texte2); }
html:not(.js) .g-fx-plot { display: none; }

/* Barres à cible (pression des pneus, admin 2026-12-02) : relevé en dégradé bleu, manque hachuré et cerné de magenta,
   dépassement en bleu voilé, repère de la cible en travers de CHAQUE piste. Texte plafonné en largeur comme la batterie.
   Le blanc d'origine est refusé par l'admin (« AFFREUSE », 2026-12-02). Bleu et magenta : écarts mesurés, charte §2. */
.g-target { box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 480px; margin-inline: auto;
            container-type: inline-size; }
.g-target-plot { display: block; width: 100%; height: auto; overflow: visible; }
.g-target-grille { stroke: var(--filet); stroke-width: 1; }
.g-target-axe { fill: var(--discret); font: 400 12px var(--sans); font-variant-numeric: tabular-nums; }
.g-target-nom { fill: var(--texte2); font: 500 13px var(--sans); }
.g-target-valeur { fill: var(--texte); font: 600 22px var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.g-target-ecart { fill: var(--texte2); font: 500 13px var(--sans); font-variant-numeric: tabular-nums; }
.g-target-ecart-manque { fill: var(--texte); font-weight: 600; }
.g-target-stop-haut { stop-color: var(--recharge); }
.g-target-stop-bas { stop-color: var(--recharge); stop-opacity: .5; }
.g-target-dessus { fill: var(--recharge); fill-opacity: .55; }
.g-target-hachure { stroke: var(--rapide); stroke-width: 2.5; }
.g-target-bord { fill: none; stroke: var(--rapide); stroke-width: 1.5; stroke-dasharray: 3 3; }
.g-target-repere { stroke: var(--texte); stroke-width: 3; stroke-linecap: round; }
.g-target-cle-plein { background: linear-gradient(var(--recharge), var(--recharge-voile)); width: 10px; height: 14px; border-radius: 3px; }
.g-target-cle-dessus { background: var(--recharge-voile); box-shadow: inset 0 0 0 1px var(--recharge); width: 10px; height: 14px; border-radius: 3px; }
.g-target-cle-manque { width: 10px; height: 14px; border-radius: 3px; background: repeating-linear-gradient(45deg, var(--rapide) 0 2px, transparent 2px 5px);
                       box-shadow: inset 0 0 0 1px var(--rapide); }
.g-target-cle-repere { width: 14px; height: 3px; border-radius: 2px; background: var(--texte); }
/* Dessin étroit (téléphone) : il est réduit d'un quart, le texte grossit d'autant pour rester lisible (11 px et plus). */
@container (max-width: 360px) {
  .g-target-axe { font-size: 15px; }
  .g-target-nom { font-size: 16px; }
  .g-target-valeur { font-size: 28px; }
  .g-target-ecart { font-size: 17px; }
}

/* Menu des langues (web/languages.py) : replié sur la langue en cours, un drapeau devant chaque langue. Les couleurs des
   drapeaux sont celles des pays, seule exception à la palette ; un filet les détache du fond sombre. */
.drapeau { flex: 0 0 auto; display: block; width: 21px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px var(--filet); }
.langue-menu { width: max-content; max-width: 100%; margin-top: 12px; }
.langue-menu summary { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px 0 14px; border: 1px solid var(--filet);
  border-radius: 999px; background: var(--carte2); color: var(--texte); font: 500 14px/1 var(--sans); cursor: pointer; list-style: none;
  transition: border-color .2s ease-out; }
.langue-menu summary::-webkit-details-marker { display: none; }
.langue-menu summary::after { content: ""; width: 6px; height: 6px; margin: -4px 0 0 4px; border: solid var(--texte2); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); transition: transform .2s ease-out; }
.langue-menu[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.langue-menu summary:hover { border-color: var(--texte2); }
.langue-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.langue-liste { display: grid; min-width: 220px; gap: 2px; margin-top: 8px; padding: 6px; border: 1px solid var(--filet); border-radius: var(--rayon2);
  background: var(--carte2); }
.langue-choix { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: none;
  color: var(--texte2); font: 400 15px/1 var(--sans); text-align: left; cursor: pointer; transition: background-color .2s ease-out, color .2s ease-out; }
.langue-choix:hover { background: var(--carte); color: var(--texte); }
.langue-choix[aria-current="true"] { color: var(--texte); font-weight: 600; }
.langue-choix[aria-current="true"]::after { content: ""; width: 10px; height: 5px; margin-left: auto; border: solid var(--accent); border-width: 0 0 2px 2px;
  transform: translateY(-2px) rotate(-45deg); }
.langue-choix:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .langue-menu summary, .langue-menu summary::after, .langue-choix { transition: none; } }
