/* Pages PUBLIQUES (server/pages.mjs) : une page par déco, Fiabilité, Données
   et licences, Mentions légales, Soutenir. Des pages À LIRE, rendues par le
   serveur et indexables, pas l'application : elles n'en chargent pas le code.
   Mêmes couleurs que `src/app.css` (les jetons en sont recopiés, les deux
   thèmes compris), mais une mise en page de document : une colonne, du
   texte, des tableaux.

   Thème : celui choisi dans l'application s'il y en a un (`avant-rendu.js`
   pose `data-theme`), sinon celui du système. */
:root {
  --bg: #edf1f6;
  --surface: #f8fafc;
  --surface-raised: #ffffff;
  --ink: #172030;
  --muted: #616b7d;
  --accent: #176fc1;
  --positive: #137a5b;
  --warning: #946210;
  --danger: #b8463f;
  --border: #d7dee8;
  --selection: rgba(23, 111, 193, 0.09);
  --on-accent: #ffffff;
  --fs-echelle: 1;
  --fs-xs: calc(12px * var(--fs-echelle));
  --fs-sm: calc(13.5px * var(--fs-echelle));
  --fs-base: calc(16px * var(--fs-echelle));
  --fs-lg: calc(18px * var(--fs-echelle));
  --fs-xl: calc(22px * var(--fs-echelle));
  --fs-titre: calc(clamp(26px, 4vw, 34px) * var(--fs-echelle));
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141b;
    --surface: #171c25;
    --surface-raised: #1e2531;
    --ink: #f0f4fb;
    --muted: #929cab;
    --accent: #62a8ff;
    --positive: #67d2a3;
    --warning: #e9b85d;
    --danger: #e36f68;
    --border: #2b3442;
    --selection: rgba(98, 168, 255, 0.12);
    --on-accent: #07141b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10141b;
  --surface: #171c25;
  --surface-raised: #1e2531;
  --ink: #f0f4fb;
  --muted: #929cab;
  --accent: #62a8ff;
  --positive: #67d2a3;
  --warning: #e9b85d;
  --danger: #e36f68;
  --border: #2b3442;
  --selection: rgba(98, 168, 255, 0.12);
  --on-accent: #07141b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: 1.6;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* --- en-tête ------------------------------------------------------------ */
.entete {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.entete-in {
  max-width: 880px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}
.marque {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  margin-right: auto;
}
.marque img { width: 28px; height: 28px; border-radius: var(--r-sm); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

/* --- corps -------------------------------------------------------------- */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.fil { font-size: var(--fs-xs); color: var(--muted); margin: 0 0 8px; }
.fil a { color: var(--muted); }
h1 { font-size: var(--fs-titre); line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-xl); line-height: 1.3; margin: 32px 0 10px; }
h3 { font-size: var(--fs-lg); margin: 22px 0 8px; }
.chapeau { font-size: var(--fs-lg); color: var(--muted); margin: 0 0 18px; }
p, ul, ol { margin: 0 0 12px; }
small, .discret { color: var(--muted); font-size: var(--fs-sm); }

.encart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin: 16px 0;
}
.avertissement {
  border-left: 3px solid var(--warning);
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 16px 0;
  font-size: var(--fs-sm);
}
.experimental {
  display: inline-block;
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  border-radius: var(--r-pill);
  padding: 1px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* Chiffres clés : une grille de cartes. */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.chiffre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; }
.chiffre b { display: block; font-size: var(--fs-xl); line-height: 1.2; font-variant-numeric: tabular-nums; }
.chiffre > span { color: var(--muted); font-size: var(--fs-xs); }

/* Boutons-liens. */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.bouton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.bouton.second { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.bouton:hover { filter: brightness(1.08); }
.bouton svg { width: 18px; height: 18px; flex: none; }

/* Tableaux : défilement horizontal DANS leur cadre, jamais la page. */
.tableau { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); margin: 12px 0; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }
td.nom { white-space: normal; min-width: 180px; }
tr:last-child td { border-bottom: 0; }
td.n { text-align: right; }
th.n { text-align: right; }

/* Pastilles de taux : couleur ET chiffre (jamais la couleur seule). */
.taux { font-weight: 600; white-space: nowrap; }
td .taux { display: inline-block; min-width: 3.2em; text-align: right; }
.taux.bon { color: var(--positive); }
.taux.moyen { color: var(--warning); }
.taux.faible { color: var(--danger); }

/* Fiche d'un déco. */
.fiche { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.fiche dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.fiche dt { color: var(--muted); font-size: var(--fs-sm); }
.fiche dd { margin: 0; }
.rose { width: 150px; height: 150px; }
.rose text { font-size: 11px; fill: var(--muted); }
@media (max-width: 560px) {
  .fiche { grid-template-columns: 1fr; }
  .rose { justify-self: center; }
}

/* Index alphabétique des décos. */
.lettres { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 4px; }
.lettres a { min-width: 32px; text-align: center; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--r-sm); text-decoration: none; }
.colonnes { columns: 3 220px; column-gap: 24px; padding: 0; list-style: none; font-size: var(--fs-sm); }
.colonnes li { break-inside: avoid; padding: 2px 0; }
.recherche { width: 100%; max-width: 420px; font: inherit; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-raised); color: var(--ink); }

/* Pied de page. */
.pied {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.pied-in { max-width: 880px; margin: 0 auto; padding: 16px 16px 28px; display: grid; gap: 6px; }
.pied a { color: var(--muted); }
.pied nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
