:root {
  --fond: #f6f5f2; --texte: #1d1d1b; --doux: #6b6b66; --accent: #c2410c; --carte: #fff;
  --rayon: 10px; --ombre: 0 1px 3px rgb(0 0 0 / .12);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); }
a { color: var(--accent); }

.barre {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  justify-content: space-between; padding: .6rem 1rem; background: #1d1d1b; color: #fff;
}
.barre .logo { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.barre nav a { color: #ddd; text-decoration: none; margin-left: 1rem; }
.barre nav a[aria-current] { color: #fff; border-bottom: 2px solid var(--accent); }

.pastille {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .3em;
  border-radius: 999px; color: #fff; font-weight: 700; font-size: .85em;
}

/* Carte */
.page-carte main { position: relative; height: calc(100dvh - 44px); }
#carte { position: absolute; inset: 0; }
.filtres {
  position: absolute; z-index: 5; top: .6rem; left: .6rem; width: min(320px, calc(100% - 4rem));
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: .6rem .8rem;
}
.filtres summary { cursor: pointer; font-weight: 600; }
.filtres label { display: block; margin-top: .6rem; font-size: .9rem; }
.filtres input[type=range] { width: 100%; }
.filtres fieldset { border: 0; padding: 0; margin: .6rem 0 0; }
.filtres legend { font-size: .9rem; }
.cats label { display: inline-flex; align-items: center; gap: .15rem; margin: .2rem .5rem 0 0; }

/* Liste */
.liste { padding: 1rem; max-width: 960px; margin: auto; }
#recherche { width: 100%; padding: .6rem; font-size: 1rem; border: 1px solid #ccc; border-radius: var(--rayon); }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; background: var(--carte);
  border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); font-size: .95rem; }
th, td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid #eee; white-space: nowrap; }
td:first-child { white-space: normal; }
th { cursor: pointer; user-select: none; background: #eeece7; font-weight: 600; }
th[aria-sort=ascending]::after { content: " ▲"; }
th[aria-sort=descending]::after { content: " ▼"; }
@media (max-width: 600px) { th:nth-child(6), td:nth-child(6) { display: none; } }

/* Fiche */
.fiche { max-width: 900px; margin: auto; padding: 1rem; }
.fiche h1 { font-size: 1.4rem; display: flex; gap: .5rem; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin: 0; }
.stats div { background: var(--carte); border-radius: var(--rayon); padding: .6rem .8rem; box-shadow: var(--ombre); }
.stats dt { font-size: .8rem; color: var(--doux); }
.stats dd { margin: .15rem 0 0; font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
figure { margin: 1rem 0; background: var(--carte); border-radius: var(--rayon); padding: .5rem; box-shadow: var(--ombre); }
.profil { width: 100%; height: auto; display: block; }
.profil .pct { font-size: 11px; font-weight: 700; text-anchor: middle; fill: #333; }
.profil .graduation { font-size: 11px; text-anchor: middle; fill: var(--doux); }
.profil .altitude { font-size: 11px; text-anchor: end; fill: var(--doux); }
.profil .axe { stroke: #999; }
.legende { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .8rem; color: var(--doux); padding: .3rem; }
.legende span { display: inline-block; width: .9em; height: .9em; border-radius: 2px; margin-right: .25rem; vertical-align: -.1em; }
#minicarte { height: 320px; border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.bouton { background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: var(--rayon); text-decoration: none; font-weight: 600; }
.bouton.secondaire { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.meta { color: var(--doux); font-size: .85rem; }
.filtres-liste { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; margin-top: .6rem; font-size: .9rem; }
.filtres-liste label { display: inline-flex; align-items: center; gap: .25rem; }
#compte-liste { font-weight: 600; margin-right: .3rem; }
