/* claude.korchia.fr : palette de référence dataviz (slots catégoriels fixes, clair + sombre). */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --track: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --status-warning: #fab219;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface-1: #1a1a19;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --track: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page); color: var(--text-primary);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.page {
  max-width: 640px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.top { display: flex; justify-content: space-between; align-items: baseline; }
.muted { color: var(--text-secondary); }
.small { font-size: .85rem; }
code { font-size: .9em; }

.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin: 0 0 16px;
}
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 8px; text-decoration: none;
  background: var(--text-primary); color: var(--surface-1); font-weight: 600;
}

.home { color: inherit; text-decoration: none; }
.sections { display: flex; gap: 16px; margin: 0 0 16px; border-bottom: 1px solid var(--border);
            overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.btn.petit { padding: 6px 12px; font-size: .9rem; margin: 6px 6px 4px 0; }
.badge { display: inline-block; font-size: .75rem; padding: 1px 6px; border-radius: 6px; background: var(--track);
         color: var(--text-secondary); margin-left: 4px; }
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tuile { display: flex; flex-direction: column; gap: 2px; }
summary h2.inline { display: inline; }
section > details > summary { cursor: pointer; list-style: none; }
section > details > summary::-webkit-details-marker { display: none; }
.sections a {
  padding: 6px 0 8px; text-decoration: none; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.sections a[aria-current] { color: var(--text-primary); border-bottom-color: var(--text-primary); font-weight: 600; }
a.card.lien { display: block; color: inherit; text-decoration: none; }
a.card.lien:hover, a.card.lien:focus-visible { border-color: var(--text-secondary); }
.resume { margin: 4px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Sélecteur de période : une seule rangée au-dessus des graphiques */
.periodes { display: flex; gap: 4px; margin: 0 0 8px; background: var(--track); border-radius: 10px; padding: 3px; }
.periodes a {
  flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; text-decoration: none;
  color: var(--text-secondary); font-size: .95rem;
}
.periodes a[aria-current] { background: var(--surface-1); color: var(--text-primary); font-weight: 600; }

.fraicheur { font-size: .85rem; color: var(--text-secondary); margin: 0 0 12px; }
.status-warning { color: var(--status-warning); }
.status-critical { color: var(--status-critical); }
:root { --status-critical: #d03b3b; }

/* Jauge de quota : piste = 100 %, remplissage = utilisé (couleur du compte, statut au-delà de 80 / 95 %) */
.jauge { height: 12px; background: var(--track); border-radius: 6px; overflow: hidden; margin: 0 0 10px; }
.jauge-val { display: block; height: 100%; background: var(--serie); border-radius: 0 4px 4px 0; }
.jauge-val.alerte { background: var(--status-warning); }
.jauge-val.critique { background: var(--status-critical); }
.sous-titre { margin: 12px 0 4px; }
:root { --status-good: #0ca30c; --grid: #e1e0d9; --axis: #898781; }
@media (prefers-color-scheme: dark) { :root { --grid: #2c2c2a; } }
.status-good { color: var(--status-good); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h3 { font-size: .95rem; margin: 14px 0 4px; }
.liste { margin: 4px 0; padding-left: 0; list-style: none; }
.liste li { padding: 4px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.liste li:last-child { border-bottom: 0; }
ol.liste { list-style: decimal inside; }
.detail p { margin: 4px 0; }
.detail code, .liste code { overflow-wrap: anywhere; }

/* Graphique de progression : ligne 2px, marques 8px, grille discrète, cible de survol plus grande que la marque */
.graph { width: 100%; height: auto; display: block; margin: 8px 0; }
.graph .grille { stroke: var(--grid); stroke-width: 1; }
.graph .axe { fill: var(--axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.graph .ligne { fill: none; stroke: var(--serie); stroke-width: 2; stroke-linejoin: round; }
.graph .marque { fill: var(--serie); stroke: var(--surface-1); stroke-width: 2; }
.graph .cible { fill: transparent; }
.graph .point:hover .marque { r: 6; }
.alerte { font-size: .9rem; margin: 0 0 8px; }

.pastille { width: 10px; height: 10px; border-radius: 3px; background: var(--serie); flex: none; }
.hero { margin: 0 0 12px; }
.hero-val { font-size: 1.8rem; font-weight: 650; margin-right: 6px; }

/* Barres : marque fine, extrémité arrondie 4px, piste discrète, texte en encre (jamais la couleur de série) */
.barres { list-style: none; margin: 0; padding: 0; }
.barres li + li { margin-top: 2px; }
.barres summary {
  list-style: none; cursor: pointer; padding: 6px 4px; border-radius: 6px;
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 4px;
}
.barres summary::-webkit-details-marker { display: none; }
.barres summary:hover, .barres summary:focus-visible { background: var(--track); outline: none; }
.nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.val { font-variant-numeric: tabular-nums; font-size: .95rem; color: var(--text-secondary); }
.piste { grid-column: 1 / -1; height: 10px; }
.barre { display: block; height: 10px; min-width: 2px; background: var(--serie); border-radius: 0 4px 4px 0; }
.barre.autres { background: var(--text-muted); }
.detail { margin: 2px 4px 8px; font-size: .85rem; color: var(--text-secondary); }
.note { margin-top: 8px; }

@media (forced-colors: active) {
  .barre { background: CanvasText; }
}
