/* Palette : instance de référence du skill dataviz (bleu séquentiel, statuts fixes). */
:root {
  color-scheme: light;
  --surface-0: #f4f3f0;
  --surface-1: #fcfcfb;
  --border: #e4e2dc;
  --grid: #ecebe7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #77756f;
  --serie: #2a78d6;          /* bleu 450 */
  --serie-faible: #86b6ef;   /* bleu 250 : journée incomplète */
  --cible: #52514e;
  --point: #77756f;
  --bon: #0ca30c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #111110;
    --surface-1: #1a1a19;
    --border: #2e2e2b;
    --grid: #262624;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #94938b;
    --serie: #3987e5;        /* bleu 400 */
    --serie-faible: #184f95; /* bleu 600 */
    --cible: #c3c2b7;
    --point: #94938b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #111110;
  --surface-1: #1a1a19;
  --border: #2e2e2b;
  --grid: #262624;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #94938b;
  --serie: #3987e5;
  --serie-faible: #184f95;
  --cible: #c3c2b7;
  --point: #94938b;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface-0); color: var(--text-primary); }
body { font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 6px; font-weight: 600; }
.muted { color: var(--text-muted); }
header p { margin: 2px 0 14px; font-size: 13px; }

.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tuile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-width: 0; }
.tuile .libelle { font-size: 12px; color: var(--text-secondary); }
.tuile .valeur { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tuile .valeur small { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.tuile .detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.jauge { height: 6px; border-radius: 3px; background: var(--grid); margin-top: 8px; overflow: hidden; }
.jauge > span { display: block; height: 100%; border-radius: 3px; background: var(--serie); }

.carte { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.pastille { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.pastille.complet { background: var(--serie); }
.pastille.incomplet { background: var(--serie-faible); }
.tiret { width: 16px; border-top: 2px dashed var(--cible); display: inline-block; }
.trait { width: 16px; border-top: 2px solid var(--serie); display: inline-block; }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--point); display: inline-block; }

.graphe { position: relative; width: 100%; }
.graphe svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.graphe .vide { font-size: 13px; color: var(--text-muted); padding: 24px 0; text-align: center; }
.axe text { font-size: 11px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.axe line { stroke: var(--grid); stroke-width: 1; }
.etiquette { font-size: 11px; fill: var(--text-secondary); }

.infobulle {
  position: fixed; z-index: 10; pointer-events: none; max-width: 220px;
  background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 9px; font-size: 12px; box-shadow: 0 4px 14px rgb(0 0 0 / .15);
  font-variant-numeric: tabular-nums;
}
.infobulle b { display: block; font-weight: 600; margin-bottom: 2px; }

summary { cursor: pointer; font-weight: 600; font-size: 15px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 4px 3px; border-bottom: 1px solid var(--grid); }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text-secondary); font-weight: 600; }
.source { font-size: 11px; text-align: center; margin-top: 16px; }

@media (forced-colors: active) {
  .pastille, .jauge > span, .point { forced-color-adjust: none; }
}
