/* =========================================================================
   Cyclo Lexy — design system (moderne, clair, aéré)
   Marque jaune/rouge/noir utilisée en ACCENTS sur un canevas neutre.
   Typo Outfit (titres) / Inter (texte).
   ========================================================================= */

/* L'attribut HTML `hidden` doit toujours masquer (sinon des règles .btn/.onboard
   avec `display:…` l'écrasent → éléments visibles à tort + JS de visibilité KO). */
[hidden] { display: none !important; }

:root {
  /* Marque */
  --yellow-soft: #FFFBF0;
  --yellow-tint: #FFF6DD;
  --yellow-100:  #FFEFB8;
  --yellow:      #FFD21E;
  --yellow-dark: #E8B500;
  --yellow-deep: #8a6d00;

  --red-tint: #FDEEEC;
  --red:      #E63027;
  --red-dark: #C41E1E;

  --green-600: #15a06b;
  --green-tint:#E7F7F0;
  --amber-600: #c4860a;
  --amber-tint:#FCF2DD;

  /* Neutres */
  --bg:      #f6f6f3;
  --surface: #ffffff;
  --ink:     #17181c;
  --ink-soft:#3b3f46;
  --muted:   #6c7079;
  --line:    #eceef0;
  --line-2:  #e3e5e8;

  /* Effets */
  --radius:    18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(20,22,28,.05);
  --shadow-sm: 0 1px 2px rgba(20,22,28,.04), 0 2px 6px rgba(20,22,28,.05);
  --shadow:    0 6px 20px rgba(20,22,28,.07);
  --shadow-lg: 0 16px 40px rgba(20,22,28,.10);

  --grad-hero: linear-gradient(135deg, #FFE48A 0%, #FFD21E 55%, #FBC417 100%);
  --grad-strip: linear-gradient(90deg, var(--yellow) 0%, #FFB300 60%, var(--red) 100%);
  --grad-dark: linear-gradient(135deg, #23262d 0%, #15171c 100%);
  --grad-red: linear-gradient(135deg, #F0584F 0%, var(--red-dark) 100%);

  --font-head: "Saira", system-ui, sans-serif;
  --font-num: "Saira Condensed", "Saira", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg);
  line-height: 1.6; font-size: 15.5px; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
a { color: var(--red-dark); text-decoration: none; transition: color .15s; }
a:hover { color: var(--red); }
img { max-width: 100%; display: block; }
small { font-size: .82rem; }

.container { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 22px; }
main.container { padding-top: 30px; padding-bottom: 48px; flex: 1; }

/* ----------------------------- Header ----------------------------------- */
/* z-index élevé : doit passer AU-DESSUS des cartes Leaflet (contrôles ~1000). */
.site-header { position: sticky; top: 0; z-index: 1100; background: var(--grad-hero); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad-strip); opacity: .9; }
.nav { display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 8px 0; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-logo { height: 40px; width: 40px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(20,22,28,.18)); }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav-links .muted { color: var(--ink); font-weight: 600; font-size: .82rem; background: rgba(255,255,255,.6); padding: 6px 13px; border-radius: var(--radius-pill); }

/* Onglets de navigation */
.nav-tabs-bar { background: rgba(255,255,255,.7); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.nav-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 9px 0; }
.nav-tabs a { white-space: nowrap; padding: 7px 13px; border-radius: var(--radius-pill); font-weight: 500; font-size: .88rem; color: var(--ink-soft); background: transparent; border: 1px solid transparent; text-decoration: none; transition: all .15s; }
.nav-tabs a:hover { background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); }
.nav-tabs a.active { background: var(--ink); color: #fff; }

/* Sous-navigation (back-office / supervision) */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; }
.subnav a { padding: 7px 14px; border-radius: var(--radius-pill); font-weight: 500; font-size: .88rem; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line-2); text-decoration: none; transition: all .15s; }
.subnav a:hover { border-color: var(--ink); color: var(--ink); }
.subnav a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
/* Mobile : la barre d'onglets reste sur UNE ligne et défile horizontalement,
   au lieu de s'empiler sur plusieurs rangées (encombrant). */
@media (max-width: 640px) {
  .subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 16px; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex: 0 0 auto; white-space: nowrap; }
  .section-head { flex-wrap: wrap; }
  /* Tableaux de gestion : défilement horizontal au lieu de colonnes tronquées. */
  .card:has(.stats-table) { overflow-x: auto !important; }
  .stats-table th, .stats-table td { white-space: nowrap; }
  /* Grilles 2 colonnes (recettes/dépenses, etc.) : empilées sur mobile. */
  .grid[style*="1fr 1fr"] { grid-template-columns: 1fr !important; }
}

/* ------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .92rem;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s;
  line-height: 1.1; white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary, .btn-accent { background: var(--grad-red); color: #fff; box-shadow: 0 2px 8px rgba(230,48,39,.28); }
.btn-primary:hover, .btn-accent:hover { box-shadow: 0 5px 16px rgba(230,48,39,.34); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: var(--yellow-dark); color: var(--ink); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-xs); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(20,22,28,.05); color: var(--ink); }
.btn-sm { padding: 7px 13px; font-size: .85rem; }
/* Écrans tactiles : agrandir les petites actions (icônes ✏️/🗑 des tableaux)
   pour atteindre une cible confortable au doigt, sans gêner la souris. */
@media (pointer: coarse) {
  .btn-sm { min-height: 40px; min-width: 40px; padding-top: 9px; padding-bottom: 9px; }
}
.btn-block { width: 100%; }

/* ------------------------------- Badges --------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-body);
  font-weight: 600; font-size: .72rem; letter-spacing: .02em;
  padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap;
}
.badge-confirmed { background: var(--green-tint); color: var(--green-600); }
.badge-proposed  { background: var(--amber-tint); color: var(--amber-600); }
.badge-cancelled { background: var(--red-tint); color: var(--red-dark); }
.badge-level     { background: var(--yellow-tint); color: var(--yellow-deep); }

/* -------------------------------- Cards --------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }

/* --------------------------------- Hero --------------------------------- */
.hero, .page-hero {
  background: var(--grad-hero); color: var(--ink); border-radius: 22px;
  padding: 40px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.hero::after, .page-hero::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,.35), transparent 70%); border-radius: 50%;
}
.hero h1 { color: var(--ink); margin-bottom: .3em; }
.hero p { color: var(--ink-soft); font-size: 1.05rem; max-width: 48ch; margin-bottom: 1.6rem; position: relative; }
.page-hero { padding: 30px 36px; margin-bottom: 26px; }
.page-hero .hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; position: relative; }
.page-hero h1 { color: var(--ink); margin: 0 0 .35em; position: relative; }
.page-hero .when { color: var(--ink-soft); font-size: 1rem; margin: 0; position: relative; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; position: relative; }
.hero-chip { display: inline-flex; align-items: center; gap: 7px; background: rgba(23,24,28,.86); color: #fff; font-weight: 600; font-size: .9rem; padding: 7px 13px; border-radius: var(--radius-pill); }
.hero-chip .v { color: var(--yellow); }

/* Fil d'Ariane de section (reste un <h1> pour l'accessibilité, mais discret :
   le vrai titre visuel de la page est son <h2>). */
.crumb { font-family: var(--font-head); font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }

/* ------------------------------ Sections -------------------------------- */
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.section > h2, .accent-title { position: relative; padding-left: 14px; }
.section > h2::before, .accent-title::before { content: ""; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 4px; background: var(--grad-strip); }

/* --------------------------- Grids / layout ----------------------------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

/* --------------------------- Feature (à la une) -------------------------- */
.feature-card { overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-card .feature-banner { background: var(--grad-hero); color: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 18px; }
.feature-card .body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.feature-card h3 { margin: 0; }
.feature-card h3 a { color: var(--ink); }
.gauge { display: flex; flex-direction: column; gap: 5px; }
.gauge-bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.gauge-bar span { display: block; height: 100%; background: var(--grad-strip); border-radius: 999px; }
.gauge small { color: var(--muted); }

/* ------------------------------ Stat tiles ------------------------------ */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; text-align: center; }
.stat .icon { font-size: 1.3rem; }
.stat .val { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; color: var(--ink); }
.stat .lab { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ------------------------------ Ride card ------------------------------- */
.ride-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .2s; }
.ride-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ride-card .strip { height: 4px; background: var(--grad-strip); }
.ride-card .body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ride-card h3 { margin: 0; }
.ride-card h3 a { color: var(--ink); }
.ride-card h3 a:hover { color: var(--red); }
.ride-meta { color: var(--muted); font-size: .9rem; display: flex; flex-direction: column; gap: 3px; }
.ride-stats { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); color: var(--ink-soft); font-weight: 600; font-size: .82rem; padding: 5px 11px; border-radius: var(--radius-pill); border: 1px solid var(--line); }
.ride-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }
.rsvp-counts { display: flex; gap: 10px; font-size: .85rem; color: var(--muted); font-weight: 600; }

/* ------------------------------- Weather -------------------------------- */
.weather { background: var(--grad-dark); color: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.weather .top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.weather .emoji { font-size: 2.4rem; line-height: 1; }
.weather .cond { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--yellow); }
.weather .figs { color: rgba(255,255,255,.85); font-size: .92rem; }
.weather strong { color: var(--yellow); }
.advice { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.advice .tip { background: rgba(255,255,255,.08); border-left: 3px solid var(--yellow); border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.weather .src { display: block; margin-top: 12px; font-size: .76rem; color: rgba(255,255,255,.6); }
/* Bloc « À quoi s'attendre » : météo + conditions fusionnés, fond sombre. */
.expect-card { background: var(--grad-dark); color: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.expect-card strong { color: var(--yellow); }
.expect-card .helptext { color: rgba(255,255,255,.72); }
.expect-card .chip { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.expect-card .src { display: block; font-size: .76rem; color: rgba(255,255,255,.6); }
/* --- Zone de retour (feedback) ------------------------------------------- */
.feedback-box { max-width: 760px; margin-bottom: 24px; border-left: 4px solid var(--yellow); }
.feedback-kinds { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.feedback-kind { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: .9rem; }
.feedback-kind input { accent-color: var(--yellow-dark, #b8860b); }
.feedback-kind:has(input:checked) { border-color: var(--yellow); background: var(--yellow-soft); font-weight: 600; }
.feedback-text { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; resize: vertical; }

/* --- Notes de version (changelog) ---------------------------------------- */
.releases { max-width: 760px; }
.release { position: relative; padding: 0 0 18px 22px; margin-bottom: 6px; border-left: 2px solid var(--line-2); }
.release:last-child { border-left-color: transparent; }
.release::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); }
.release-current::before { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }
.release-head { display: flex; align-items: center; gap: 10px; }
.release-ver { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.release-date { color: var(--ink-soft); font-size: .85rem; margin-left: auto; }
.release-title { margin: 4px 0 8px; font-size: 1.02rem; }
.release-list { margin: 0; padding-left: 18px; }
.release-list li { margin: 5px 0; line-height: 1.5; }
.app-version-link { color: inherit; text-decoration: none; }
.app-version-link:hover { text-decoration: underline; }
.dash-version { align-self: center; display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; padding: 3px 10px; font-size: .74rem; font-weight: 500; color: rgba(255,255,255,.55); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; transition: color .15s, border-color .15s; }
.dash-version::before { content: "✨"; opacity: .7; }
.dash-version:hover { color: rgba(255,255,255,.9); border-color: var(--yellow); }

/* Bouton officiel « Connect with Strava » aligné sur les btn-sm (mise à
   l'échelle proportionnelle uniquement, pour rester conforme à la charte). */
.strava-connect-btn { display: inline-flex; align-items: center; }
.strava-connect-btn img { height: 32px; width: auto; display: block; }

/* --- Éditeur de texte riche (Quill) + rendu --------------------------------- */
/* Bloc autonome : un cadre arrondi qui contient barre d'outils + zone d'édition
   (évite tout chevauchement, occupe toute la largeur). */
.rich-wrap { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-xs); }
.rich-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: var(--bg); padding: 8px 10px; position: relative; }
.rich-wrap .ql-container.ql-snow { border: 0; font-family: inherit; font-size: .96rem; }
.rich-wrap .ql-editor { color: var(--ink); line-height: 1.55; }
.rich-wrap .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; left: 16px; }
/* Bouton plein écran, calé à droite de la barre d'outils. */
.rich-fs-btn { position: absolute; right: 8px; top: 6px; width: 30px; height: 26px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: 1rem; line-height: 1; }
.rich-fs-btn:hover { border-color: var(--yellow); color: var(--ink); }
/* Mode plein écran. */
.rich-wrap.rich-fs { position: fixed; inset: 0; z-index: 3000; border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
.rich-wrap.rich-fs .ql-container { flex: 1 1 auto; overflow: auto; }
.rich-wrap.rich-fs .ql-editor { min-height: 0 !important; height: 100%; max-width: 900px; margin: 0 auto; width: 100%; padding: 24px 8px; }
.rich-wrap.rich-fs .ql-toolbar { padding: 10px 14px; }
body.rich-fs-open { overflow: hidden; }
/* Habillage à la charte : icônes adaptées au thème, survol/actif en jaune,
   focus mis en valeur, groupes d'outils séparés. */
.rich-wrap:focus-within { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }
.rich-wrap .ql-toolbar .ql-stroke { stroke: var(--ink-soft); }
.rich-wrap .ql-toolbar .ql-fill { fill: var(--ink-soft); }
.rich-wrap .ql-toolbar .ql-picker { color: var(--ink-soft); }
.rich-wrap .ql-toolbar button, .rich-wrap .ql-toolbar .ql-picker-label { border-radius: 7px; transition: background .12s; }
.rich-wrap .ql-toolbar button:hover { background: rgba(127,127,127,.14); }
.rich-wrap .ql-toolbar button:hover .ql-stroke, .rich-wrap .ql-toolbar .ql-picker-label:hover .ql-stroke { stroke: var(--ink); }
.rich-wrap .ql-toolbar button:hover .ql-fill { fill: var(--ink); }
.rich-wrap .ql-toolbar button.ql-active, .rich-wrap .ql-toolbar .ql-picker-label.ql-active { background: var(--yellow); }
.rich-wrap .ql-toolbar button.ql-active .ql-stroke, .rich-wrap .ql-toolbar .ql-picker-item.ql-selected { stroke: var(--ink); color: var(--ink); }
.rich-wrap .ql-toolbar button.ql-active .ql-fill { fill: var(--ink); }
.rich-wrap .ql-formats { margin-right: 6px !important; padding-right: 6px; border-right: 1px solid var(--line); }
.rich-wrap .ql-formats:last-of-type { border-right: 0; }
.rich-wrap .ql-picker-options { border-radius: 8px; box-shadow: var(--shadow-sm); border-color: var(--line-2); background: var(--surface); padding: 6px; }
.rich-wrap .ql-picker-item:hover { color: var(--ink); }
.rich-wrap .ql-snow .ql-tooltip { border-radius: 8px; box-shadow: var(--shadow-sm); border-color: var(--line-2); background: var(--surface); color: var(--ink); }
.rich-wrap .ql-snow .ql-tooltip input[type=text] { border-radius: 6px; border-color: var(--line-2); background: var(--bg); color: var(--ink); }
/* Images dans l'éditeur */
.rich-wrap .ql-editor img { max-width: 100%; height: auto; border-radius: 8px; }
.rich-wrap .ql-editor a { color: var(--red); }
.rich-wrap .ql-editor blockquote { border-left: 3px solid var(--yellow); color: var(--ink-soft); }
/* Barre d'outils COLLANTE en plein écran (reste visible au défilement). */
.rich-wrap.rich-fs .ql-toolbar { position: sticky; top: 0; z-index: 5; background: var(--bg); box-shadow: 0 1px 0 var(--line), 0 4px 10px rgba(0,0,0,.04); }
/* Thème sombre affiné pour l'éditeur. */
html[data-theme="dark"] .rich-wrap .ql-snow .ql-tooltip { box-shadow: 0 8px 24px rgba(0,0,0,.5); }
html[data-theme="dark"] .rich-wrap .ql-toolbar button:hover { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .rich-wrap .ql-toolbar .ql-formats { border-right-color: rgba(255,255,255,.10); }
html[data-theme="dark"] .rich-wrap .ql-editor.ql-blank::before { color: rgba(255,255,255,.4); }
html[data-theme="dark"] .rich-wrap .ql-toolbar button.ql-active .ql-stroke { stroke: var(--ink); }
html[data-theme="dark"] .rich-wrap .ql-snow .ql-tooltip a.ql-action, html[data-theme="dark"] .rich-wrap .ql-snow .ql-tooltip a.ql-remove { color: var(--ink); }
/* --- Rendu du contenu riche --- */
.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content p { margin: .5em 0; }
.rich-content ul, .rich-content ol { margin: .5em 0; padding-left: 1.4em; }
.rich-content li { margin: .2em 0; }
.rich-content a { color: var(--red); }
.rich-content img { max-width: 100%; height: auto; border-radius: 8px; margin: .4em 0; }
.rich-content blockquote { border-left: 3px solid var(--yellow); margin: .5em 0; padding: .2em 0 .2em 12px; color: var(--ink-soft); }
.rich-content h2 { font-size: 1.15rem; margin: .6em 0 .3em; }
.rich-content h3 { font-size: 1.02rem; margin: .6em 0 .3em; }

/* --- Bloc photo (formulaire produit) ------------------------------------- */
.photo-field > label { display: block; font-weight: 600; margin-bottom: 8px; }
.photo-row { display: flex; gap: 16px; align-items: flex-start; }
.photo-preview { flex: 0 0 120px; width: 120px; height: 120px; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-empty { font-size: 2.4rem; opacity: .5; }
.photo-inputs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.photo-sub { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.photo-or { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; margin: 4px 0; }
.photo-or::before, .photo-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.photo-inputs input[type=url] { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; }

/* --- Stock : vignette produit -------------------------------------------- */
.prod-thumb { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); overflow: hidden; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-thumb-empty { font-size: 1.1rem; opacity: .6; }
.prod-thumb-lg { width: 56px; height: 56px; border-radius: 10px; }

/* --- Sponsors / partenaires : logo lisible ------------------------------- */
.sponsor-cell { display: flex; align-items: center; gap: 12px; }
.sponsor-logo { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 92px; height: 52px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; }
.sponsor-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.sponsor-name { font-weight: 600; }

/* --- Guide d'utilisation -------------------------------------------------- */
.guide-choose { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; max-width: 760px; }
.guide-choose-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 24px; text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
.guide-choose-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--yellow); }
.guide-choose-emoji { font-size: 2.6rem; line-height: 1; }
.guide-choose-title { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--ink); }
.guide-choose-desc { font-size: .9rem; color: var(--ink-soft); }
.guide-choose-go { margin-top: 6px; font-weight: 700; color: var(--yellow-dark, #b8860b); }
.guide-shot { display: block; max-width: 100%; height: auto; margin: 14px 0; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-sm); }
.guide-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.guide-toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; }
.guide-toc strong { font-family: var(--font-head); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 6px; }
.guide-toc a { color: var(--ink-soft); text-decoration: none; font-size: .9rem; padding: 6px 9px; border-radius: 8px; transition: background .12s, color .12s; }
.guide-toc a:hover { background: var(--bg); color: var(--ink); }
.guide-body { min-width: 0; }
.guide-sec { scroll-margin-top: 16px; padding-bottom: 8px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.guide-sec:last-child { border-bottom: 0; }
.guide-sec h2 { margin: 0 0 10px; }
.guide-sec h3 { margin: 16px 0 6px; font-size: 1.02rem; }
.guide-sec ul { margin: 6px 0; padding-left: 20px; }
.guide-sec li { margin: 4px 0; }
.guide-sec .callout { background: var(--yellow-soft); border-left: 3px solid var(--yellow-dark); border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: .92rem; }
@media (max-width: 760px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; flex-flow: row wrap; }
  .guide-toc strong { width: 100%; }
}

/* Lien discret « Guide » dans la barre latérale (à côté du thème). */
/* Pied de sidebar : nom sur sa propre ligne (lisible en entier), puis une
   rangée de contrôles (cloche · ? · thème) en dessous. */
.dash-user .dash-uname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.dash-controls .sidebar-bell { flex: none; }
.dash-controls .dash-help { margin-left: 0; text-decoration: none; display: grid; place-items: center; font-weight: 700; font-size: 1rem; line-height: 1; flex: none; }
.dash-controls .dash-theme { margin-left: 0; flex: none; }
.dash-controls .dash-help.active { border-color: var(--yellow); color: var(--yellow-dark, #b8860b); }

/* --- Mode démonstration --------------------------------------------------- */
.demo-banner { background: linear-gradient(90deg, var(--yellow), #ffe87a); color: #17181c; border-radius: 10px; padding: 9px 14px; margin-bottom: 16px; font-size: .9rem; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-banner a { color: #17181c; font-weight: 700; text-decoration: underline; margin-left: auto; }
.demo-pick { max-width: 880px; margin: 0 auto; }
.demo-pick-head { text-align: center; margin-bottom: 22px; }
.demo-pick-head .login-logo { height: 56px; margin-bottom: 10px; }
.demo-pick-head h1 { margin: 0 0 6px; }
.demo-pick-head .helptext { max-width: 56ch; margin: 0 auto; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.demo-card { margin: 0; }
.demo-card-btn { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px 16px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.demo-card-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--yellow); }
.demo-card-emoji { font-size: 2.4rem; line-height: 1; }
.demo-card-label { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.demo-card-desc { font-size: .82rem; color: var(--ink-soft); }
.demo-card-current .demo-card-btn { border-color: var(--green-600, #1aab7a); }

/* Journal d'audit : changements lisibles (champ : ancien → nouveau). */
.audit-changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.audit-changes li { font-size: .85rem; line-height: 1.4; }
.audit-changes .ac-field { display: inline-block; font-weight: 600; color: var(--ink); margin-right: 6px; }
.audit-changes .ac-field::after { content: " :"; }
.audit-changes .ac-old { color: var(--muted, #9a9da3); text-decoration: line-through; }
.audit-changes .ac-arrow { margin: 0 5px; color: var(--muted, #9a9da3); }
.audit-changes .ac-new { color: var(--ink); font-weight: 500; }

/* --------------------------------- Map ---------------------------------- */
.rm-map { width: 100%; height: 440px; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.leaflet-container { border-radius: var(--radius); }
.leaflet-tooltip.route-tip { font-family: var(--font-head); font-weight: 700; font-size: .78rem; border: none; box-shadow: var(--shadow-sm); border-radius: 8px; padding: 3px 8px; color: var(--ink); }
.route-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: .88rem; color: var(--muted); font-weight: 500; }
.route-legend span { display: inline-flex; align-items: center; gap: 7px; }
.route-legend .dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); }
.route-legend .dot-start { background: var(--green-600); }
.route-legend .dot-end { background: var(--red); }
.route-legend .arrow { color: #7a1410; font-style: normal; font-weight: 700; }
.elevation-card { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px 6px; }
.elevation-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.elevation-head strong { font-family: var(--font-head); }
.elevation-head span { color: var(--muted); font-size: .84rem; }
.elevation-svg { display: block; width: 100%; height: 120px; }

/* ----------------- Parcours d'une édition (rendu inline) ---------------- */
.course-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.course-toc-link { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); font-weight: 600; font-size: .88rem; text-decoration: none; transition: all .15s; }
.course-toc-link:hover { border-color: var(--yellow); background: var(--yellow-soft, #fff8e1); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.parcours-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 24px 26px; margin-bottom: 28px; scroll-margin-top: 80px; }
.parcours-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.parcours-head h3 { margin: 0; font-family: var(--font-head); font-size: 1.45rem; }
.parcours-chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .parcours-block { padding: 18px 16px 20px; } }

/* ----------------------------- RSVP control ----------------------------- */
.rsvp-panel { display: flex; flex-direction: column; gap: 16px; }
.rsvp-status { color: var(--muted); margin: 0; }
.rsvp-status strong { color: var(--ink); }
.rsvp-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rsvp-btn { font-family: var(--font-body); font-weight: 600; font-size: .92rem; cursor: pointer; padding: 14px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); transition: all .15s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rsvp-btn .ic { font-size: 1.35rem; }
.rsvp-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.rsvp-btn.active.going    { background: var(--green-tint); border-color: var(--green-600); color: var(--green-600); }
.rsvp-btn.active.maybe    { background: var(--amber-tint); border-color: var(--amber-600); color: var(--amber-600); }
.rsvp-btn.active.declined { background: var(--red-tint); border-color: var(--red); color: var(--red-dark); }
.tally { display: flex; gap: 18px; flex-wrap: wrap; }
.tally .t { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.tally .n { font-family: var(--font-head); font-size: 1.15rem; }
.participants { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.participants li { padding: 9px 12px; background: var(--bg); border-radius: 10px; font-size: .9rem; }
details > summary { cursor: pointer; color: var(--red-dark); font-weight: 600; }

/* -------------------------------- Forms --------------------------------- */
form p { margin-bottom: 16px; }
label { font-weight: 600; font-size: .88rem; display: block; margin-bottom: 6px; color: var(--ink); }
input, textarea, select {
  width: 100%; font-family: var(--font-body); font-size: .98rem; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--yellow-dark); box-shadow: 0 0 0 3px var(--yellow-100); }
.helptext, .helptext small { color: var(--muted); font-size: .84rem; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--red); }
input[type="file"] { padding: 9px; background: var(--bg); }

/* ------------------------------- Alerts --------------------------------- */
.alert { background: var(--yellow-soft); border: 1px solid var(--yellow-100); border-left: 3px solid var(--yellow-dark); color: var(--ink-soft); padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; }

/* --------------------------- Profile banner ----------------------------- */
.profile-banner { background: var(--yellow-soft); border: 1px solid var(--yellow-100); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; flex-wrap: wrap; margin-bottom: 18px; }
.profile-banner .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.profile-banner span { color: var(--ink-soft); font-weight: 500; }
.profile-banner span strong { color: var(--ink); }
.profile-banner .btn { background: var(--ink); color: #fff; }
.profile-banner .btn:hover { background: #000; color: #fff; }

/* ------------------------------- Reminders ------------------------------ */
.reminders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.reminder { padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg); border-left: 3px solid var(--muted); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.reminder.warn { background: var(--red-tint); border-left-color: var(--red); }
.reminder.info { background: var(--yellow-soft); border-left-color: var(--yellow-dark); }
.reminder a { font-weight: 700; text-decoration: none; }

/* ------------------------------- Detail --------------------------------- */
.detail-head { margin-bottom: 8px; }
.detail-head .when { color: var(--muted); font-size: 1rem; }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; margin-bottom: 16px; }
.backlink:hover { color: var(--ink); }
.desc { font-size: 1.02rem; color: var(--ink-soft); }

/* ------------------------------- Members -------------------------------- */
.member-card { display: flex; align-items: center; gap: 14px; padding: 16px; transition: transform .15s, box-shadow .2s; }
.member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.member-card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.member-card-body strong { color: var(--ink); }
.member-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.board-card { border-top: 3px solid var(--yellow); }
.avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--line-2); }
.avatar-initials { display: grid; place-items: center; background: var(--ink); color: var(--yellow); font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; border-color: transparent; }
.avatar-lg { width: 86px; height: 86px; font-size: 2rem; }
.member-profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.info-list { display: grid; gap: 2px; margin: 0; }
.info-list div { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.info-list dt { font-weight: 600; color: var(--muted); min-width: 140px; margin: 0; }
.info-list dd { margin: 0; color: var(--ink); }
.status-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); border-left: 4px solid var(--muted); box-shadow: var(--shadow-xs); }
.status-card .status-ic { font-size: 1.7rem; }
.status-card.ok   { border-left-color: var(--green-600); }
.status-card.warn { border-left-color: var(--amber-600); }
.status-card.ko   { border-left-color: var(--red); }

/* ------------------------------ Comments -------------------------------- */
.comment-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comment { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; border-left: 3px solid var(--yellow); }
.comment-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.comment-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.comment-actions .linklike { font-size: .85rem; }
.comment-author { font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.comment-date { font-size: .8rem; color: var(--muted); }
.comment-body { color: var(--ink-soft); }
.comment-empty { color: var(--muted); font-style: italic; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; }
.comment-form textarea { flex: 1; }
.typing-indicator { margin-top: 10px; color: var(--muted); font-size: .86rem; font-style: italic; }
.typing-dots span { animation: typingblink 1.4s infinite both; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingblink { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }

/* ----------------------------- Stats table ------------------------------ */
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.stats-table thead th { font-family: var(--font-head); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); font-weight: 600; }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table .rank { font-size: 1.05rem; width: 48px; text-align: center; }
.stats-table .member { font-weight: 600; }
.stats-table tbody tr:hover { background: var(--yellow-soft); }
.stats-table tbody tr:last-child td { border-bottom: none; }

/* ---------------------------- Questionnaire ----------------------------- */
.qs-list { list-style: none; counter-reset: q; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.qs-item { counter-increment: q; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.qs-q { font-weight: 500; margin-bottom: 10px; }
.qs-q::before { content: counter(q) ". "; font-family: var(--font-head); font-weight: 700; color: var(--red); }
.qs-a ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.qs-a label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; margin: 0; }
.qs-err { color: var(--red-dark); font-size: .85rem; margin-top: 6px; }

/* -------------------------------- Login --------------------------------- */
.login-logo { height: 80px; width: 80px; object-fit: contain; margin: 0 auto 8px; display: block; }
.login-box { max-width: 400px; margin: 56px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); text-align: center; }
.login-box h1 { font-family: var(--font-head); font-size: 1.35rem; margin: 6px 0 18px; }
.login-box form { text-align: left; }

/* ------------------------------- Footer --------------------------------- */
.site-footer { margin-top: auto; padding: 26px 0; color: var(--muted); border-top: 1px solid var(--line); background: transparent; text-align: center; font-size: .88rem; }
.site-footer a { color: var(--red-dark); }

@media (max-width: 640px) {
  .hero, .page-hero { padding: 26px 22px; }
  .rsvp-buttons { grid-template-columns: 1fr; }
  .nav-links .hide-sm { display: none; }
}

/* ----------------------------- Impression ------------------------------ */
@media print {
  .site-header, .nav-tabs-bar, .subnav, .site-footer, .profile-banner, .theme-toggle, .no-print { display: none !important; }
  body { background: #fff; }
  main.container { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================ Thème sombre ============================== */
/* Le sélecteur clair/sombre/auto (header) pose data-theme sur <html>.
   On surcharge les tokens neutres + teintes ; l'en-tête jaune et la barre
   d'onglets restent un îlot « clair » (identité de marque). */
.theme-toggle {
  background: rgba(255, 255, 255, .55); border: none; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 7px 11px; border-radius: var(--radius-pill);
  transition: background .15s;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .9); }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:       #14151a;
  --surface:  #1d1f26;
  --ink:      #e9eaee;
  --ink-soft: #c3c6cd;
  --muted:    #9398a3;
  --line:     #2a2d36;
  --line-2:   #363a45;

  --yellow-soft: #211d10;
  --yellow-tint: #2b2410;
  --yellow-100:  #4a3d12;
  --yellow-deep: #f0d775;
  --red-tint:    #2c1714;
  --red-dark:    #ff7a6e;   /* liens / textes rouges plus clairs sur fond sombre */
  --green-tint:  #102a20;
  --green-600:   #3ddc97;
  --amber-tint:  #2c2410;
  --amber-600:   #f0b342;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .45);
  --shadow:    0 8px 24px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .65);
  --grad-dark: linear-gradient(135deg, #2a2d36 0%, #1d1f26 100%);
}

/* En-tête jaune + barre d'onglets : on force du texte foncé quel que soit le thème. */
html[data-theme="dark"] .nav-tabs a { color: #3b3f46; }
html[data-theme="dark"] .nav-tabs a:hover { background: #fff; color: #17181c; }
html[data-theme="dark"] .nav-links .muted { color: #17181c; }
/* Onglet/élément actif : remplace le « fond encre » (devenu clair) par du jaune marque. */
html[data-theme="dark"] .nav-tabs a.active,
html[data-theme="dark"] .subnav a.active {
  background: var(--yellow); border-color: var(--yellow); color: #17181c;
}
html[data-theme="dark"] .profile-banner .btn { background: var(--yellow); color: #17181c; }
html[data-theme="dark"] .profile-banner .btn:hover { background: var(--yellow-dark); color: #17181c; }
/* Le hero (bandeau jaune) est aussi un îlot clair : texte foncé en sombre. */
html[data-theme="dark"] .hero h1,
html[data-theme="dark"] .page-hero h1 { color: #17181c; }
html[data-theme="dark"] .hero p,
html[data-theme="dark"] .page-hero .when { color: #3b3f46; }
/* En-tête jaune : marque + bouton Déconnexion en texte foncé. */
html[data-theme="dark"] .brand-name { color: #17181c; }
html[data-theme="dark"] .site-header .btn-ghost { color: #3b3f46; }
html[data-theme="dark"] .site-header .btn-ghost:hover { background: rgba(0, 0, 0, .07); color: #17181c; }
/* Autres surfaces jaunes : bannière « À la une », bouton jaune, avatars. */
html[data-theme="dark"] .feature-card .feature-banner { color: #17181c; }
html[data-theme="dark"] .btn-yellow { color: #17181c; }
html[data-theme="dark"] .avatar-initials { background: #17181c; }
html[data-theme="dark"] .btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.theme-toggle { color: inherit; }
/* Listes d'items sur cartes (À régulariser, prochaines sorties…) : en sombre,
   var(--bg) est plus foncé que la carte -> effet « trou noir ». Léger voile clair. */
html[data-theme="dark"] .participants li { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .participants li:hover { background: rgba(255, 255, 255, .08); }

/* Îlots toujours jaunes du dashboard : texte foncé fixe même en mode sombre. */
html[data-theme="dark"] .club-counter,
html[data-theme="dark"] .club-counter-head,
html[data-theme="dark"] .club-counter-head span,
html[data-theme="dark"] .club-fun,
html[data-theme="dark"] .club-counter-grid .ccn,
html[data-theme="dark"] .gear-hero-value,
html[data-theme="dark"] .gear-shifts,
html[data-theme="dark"] .dstat-y,
html[data-theme="dark"] .dstat-y .dstat-l,
html[data-theme="dark"] .profile-banner span { color: #e9eaee; }
/* L'item de menu actif a un fond JAUNE (--grad-hero) → texte foncé, même en
   sombre (sinon #e9eaee clair = illisible). Voir la règle de base #17181c. */
html[data-theme="dark"] .dash-nav a.active { color: #17181c; }
html[data-theme="dark"] .profile-banner span strong { color: #fff; }
/* Boxes/chips « jaunes » en thème sombre : fond jaune translucide + texte doré
   clair + liseré jaune → visiblement jaunes ET lisibles sur les surfaces sombres
   (le fond brun #2b2410 par défaut rendait des pastilles ternes et peu contrastées). */
html[data-theme="dark"] .badge-level,
html[data-theme="dark"] .crown-chip-sm,
html[data-theme="dark"] .town-chip,
html[data-theme="dark"] .alert {
  background: rgba(255, 210, 30, .14); border-color: rgba(255, 210, 30, .34); color: #ffe6a3;
}
html[data-theme="dark"] .alert { border-left-color: var(--yellow); }
html[data-theme="dark"] .town-chip .town-ord { background: var(--yellow); color: #17181c; }
html[data-theme="dark"] .dash-ride-feat,
html[data-theme="dark"] .dash-ride-feat strong,
html[data-theme="dark"] .dash-ride-feat .dash-ride-meta,
html[data-theme="dark"] .dash-ride-feat .dash-ride-rsvp,
html[data-theme="dark"] .dash-avatar { color: #17181c; }
html[data-theme="dark"] .club-counter .ccl,
html[data-theme="dark"] .club-counter-grid span,
html[data-theme="dark"] .gear-hero-label,
html[data-theme="dark"] .gear-shifts small { color: #5a4708; }

/* ----------------------- Vignette de tracé (liste) --------------------- */
/* Mini-carte Leaflet non interactive avec le tracé. */
.ride-thumb { display: block; height: 150px; background: var(--bg); border-bottom: 1px solid var(--line); cursor: pointer; z-index: 0; overflow: hidden; border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px); }
.ride-thumb .leaflet-control-container { display: none; }

/* ==================== Carte : calques + plein écran ==================== */
.map-wrap { position: relative; }
/* Infobulle d'infos au point survolé (km/D+/alt + valeur du calque). */
.route-cursor-tip { background: #17181c; color: #fff; border: none; border-radius: 8px; font-weight: 600; font-size: .78rem; line-height: 1.35; padding: 5px 9px; box-shadow: var(--shadow); }
.route-cursor-tip.leaflet-tooltip-top::before { border-top-color: #17181c; }
.route-cursor-tip b { font-weight: 800; }
.map-controls { position: absolute; top: 10px; right: 10px; z-index: 500; display: flex; gap: 6px; align-items: flex-start; }
.layer-switch { display: flex; flex-wrap: wrap; gap: 4px; background: rgba(255, 255, 255, .92); padding: 4px; border-radius: var(--radius-pill); box-shadow: var(--shadow-sm); max-width: 72vw; }
.layer-switch button { border: none; background: transparent; cursor: pointer; font-size: .82rem; padding: 5px 11px; border-radius: var(--radius-pill); color: #3b3f46; white-space: nowrap; font-family: var(--font-body); }
.layer-switch button.active { background: #17181c; color: #fff; }
.layer-switch button:hover:not(.active) { background: #fff; }
.map-btn { border: none; background: rgba(255, 255, 255, .92); cursor: pointer; font-size: 1rem; line-height: 1; padding: 8px 10px; border-radius: 10px; box-shadow: var(--shadow-sm); color: #17181c; }
.map-btn:hover { background: #fff; }
.rm-wrap:fullscreen { display: flex; flex-direction: column; background: var(--surface); }
.rm-wrap:fullscreen .rm-map { flex: 1 1 auto; height: auto; border-radius: 0; border: 0; }
.rm-wrap:fullscreen .elevation-card { margin: 0; border-radius: 0; border: 0; border-top: 1px solid var(--line); flex: 0 0 auto; }
/* Étiquettes de valeur météo le long du tracé (calques vent/pluie/UV). */
.wx-label { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font: 700 11px/1 var(--font-body); padding: 2px 6px; border-radius: 8px; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); border: 1.5px solid #fff; }
.wx-label.wx-rain { background: #2f6fb0; }
.wx-label.wx-wind { background: #17181c; }
.wx-label.wx-uv { background: #d35400; }
.wx-arrow { display: inline-block; font-size: 13px; line-height: 1; }
/* Annotations / points d'intérêt sur le parcours. */
.map-btn.active { background: #17181c; color: #fff; }
/* Marqueur POI : badge blanc cerclé pour bien ressortir sur la carte
   (l'emoji seul, ex. 🍴, était trop fin/peu visible). */
.annot-pin { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--red, #E63027); box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  font-size: 17px; line-height: 1; cursor: pointer; }
.annot-form { display: flex; flex-direction: column; gap: 7px; min-width: 200px; }
.annot-form select, .annot-form textarea { font-size: .9rem; padding: 7px 9px; }
.annot-pop strong { font-family: var(--font-head); }
.annot-pop .annot-text { margin: 5px 0; }
.annot-pop .annot-meta { color: var(--muted); font-size: .8rem; margin: 4px 0 6px; }
.annot-tip { background: rgba(255, 255, 255, .92); border: 1px solid var(--line-2); color: var(--ink); font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 7px; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); max-width: 200px; white-space: normal; }
.annot-tip.leaflet-tooltip-top::before { border-top-color: rgba(255, 255, 255, .92); }
.annot-photos { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.annot-photos img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-2); }
.annot-actions { margin: 6px 0; font-size: .82rem; }
.annot-comments { margin: 6px 0 2px; border-top: 1px solid var(--line); padding-top: 6px; }
.annot-c { font-size: .82rem; margin: 3px 0; line-height: 1.35; }
.annot-cdate { color: var(--muted); }
.annot-addc { display: flex; gap: 6px; margin-top: 7px; }
.annot-addc input { flex: 1; min-width: 0; }
.annot-file { display: inline-block; cursor: pointer; font-size: .85rem; color: var(--red-dark); font-weight: 600; }
.linklike { background: none; border: none; padding: 0; cursor: pointer; color: var(--red-dark); font: inherit; font-weight: 600; }
.comment-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.comment-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-2); }
/* Carte des braquets favoris (heatmap soignée) */
.gear-wrap { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.gear-hero { background: var(--grad-hero, linear-gradient(135deg, #FFE89A, #FFD21E)); border-radius: 18px; padding: 16px 24px; text-align: center; min-width: 150px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04); }
.gear-hero-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 700; }
.gear-hero-value { font-size: 2.4rem; font-weight: 800; font-family: var(--font-head); line-height: 1.05; color: var(--ink); }
.gear-shifts { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-weight: 700; font-size: .9rem; }
.gear-shifts small { color: var(--ink-soft); font-weight: 500; margin-left: 3px; }
.gear-axis { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; text-align: center; }
.gear-axis-x { font-size: .72rem; color: var(--muted); margin-top: 6px; }
.gear-grid { border-collapse: separate; border-spacing: 5px; }
.gear-grid th { font-weight: 700; color: var(--ink-soft); font-size: .82rem; width: 40px; height: 28px; text-align: center; }
.gear-grid .gear-corner { color: var(--muted); }
.gear-grid td { width: 40px; height: 38px; border-radius: 10px; background: var(--bg); text-align: center; font-weight: 800; color: #b8bcc4; position: relative; transition: transform .1s; }
.gear-grid td.gc-on { background: rgba(26, 171, 122, var(--a)); color: #0f5132; box-shadow: inset 0 0 0 1px rgba(21, 160, 107, .25); }
.gear-grid td.gc-on:hover { transform: scale(1.08); }
.gear-grid td.gc-fav { box-shadow: inset 0 0 0 2px var(--yellow-dark); }
.gc-crown { position: absolute; top: -10px; right: -7px; font-size: .85rem; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }

/* Fiche d'activité : grosses stats + zones FC/puissance */
.stat-big { font-size: 1.7rem; font-weight: 800; font-family: var(--font-head); line-height: 1.1; }
.stat-big span { font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.zone-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--bg); margin-bottom: 14px; }
.zone-bar > div { min-width: 2px; }
.zone-rows { display: flex; flex-direction: column; gap: 8px; }
.zone-row { display: grid; grid-template-columns: 14px 130px 1fr auto; align-items: center; gap: 10px; font-size: .9rem; }
.zone-dot { width: 12px; height: 12px; border-radius: 50%; }
.zone-label { font-weight: 600; }
.zone-bar-mini { height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.zone-bar-mini > span { display: block; height: 100%; border-radius: 5px; }
.zone-val { font-weight: 700; white-space: nowrap; }
@media (max-width: 560px) { .zone-row { grid-template-columns: 14px 1fr auto; } .zone-bar-mini { display: none; } }

/* Upload : phase de traitement serveur (barre animée) */
@keyframes up-stripes { from { background-position: 0 0; } to { background-position: 36px 0; } }
#upBar.up-processing { background-image: linear-gradient(45deg, rgba(255, 255, 255, .35) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .35) 50%, rgba(255, 255, 255, .35) 75%, transparent 75%, transparent); background-size: 36px 36px; animation: up-stripes .8s linear infinite; }

/* Compteur du club (palmarès) */
.club-counter { background: var(--grad-hero, linear-gradient(135deg, #FFE89A, #FFD21E)); border-radius: 20px; padding: 20px 24px; margin-bottom: 22px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04); }
.club-counter-head { font-weight: 800; font-family: var(--font-head); font-size: 1.1rem; color: var(--ink); }
.club-counter-head span { font-weight: 600; color: var(--ink-soft); font-size: .85rem; }
.club-counter-grid { display: flex; gap: 32px; flex-wrap: wrap; margin: 12px 0 10px; }
.club-counter-grid .ccn { font-size: 2.4rem; font-weight: 800; font-family: var(--font-head); line-height: 1; color: var(--ink); }
.club-counter-grid .ccl { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.club-fun { font-size: .95rem; color: var(--ink); border-top: 1px solid rgba(0, 0, 0, .08); padding-top: 10px; }

/* ========================= Boutons « cyclisme » ======================== */
/* Clin d'œil : un cycliste traverse les boutons de validation au survol,
   les boutons d'annulation freinent, et tous ont un retour tactile à l'appui.
   Respecte prefers-reduced-motion. */
.btn { position: relative; }
.btn:active { transform: translateY(1px); }

.btn-accent, .btn-primary { overflow: hidden; }
.btn-accent::after, .btn-primary::after {
  content: "🚴"; position: absolute; top: 50%; left: -2em;
  transform: translateY(-50%); font-size: 1.15em; opacity: 0; pointer-events: none;
}
/* Deux anims combinées : la traversée (lente, avec accélération) + le pédalage
   (rebond rythmé du buste + inclinaison, plusieurs coups pendant la traversée). */
.btn-accent:hover::after, .btn-primary:hover::after {
  animation: cl-ride 1.7s cubic-bezier(.34, .02, .3, 1) both, cl-pedal .22s ease-in-out 8;
}
@keyframes cl-ride {
  0%   { left: -2em; opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 112%; opacity: 0; }
}
@keyframes cl-pedal {
  0%, 100% { transform: translateY(-48%) rotate(-2.5deg); }
  50%      { transform: translateY(-66%) rotate(4deg); }
}

/* Boutons d'annulation (opt-in) : coup de frein appuyé au survol. */
.btn-cancel:hover { animation: cl-brake .4s cubic-bezier(.2, .8, .3, 1); }
@keyframes cl-brake {
  0%   { transform: translateX(0) scaleX(1); }
  28%  { transform: translateX(-3px) scaleX(.97) rotate(-.7deg); }
  55%  { transform: translateX(2px) rotate(.6deg); }
  80%  { transform: translateX(-1px) rotate(-.3deg); }
  100% { transform: translateX(0) scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-accent::after, .btn-primary::after { display: none; }
  .btn:active { transform: none; }
  .btn-cancel:hover { animation: none; }
}

/* ============ Touche « sportive » ============================ */
/* Logo seul dans l'en-tête → un peu plus grand */
.brand-logo { height: 48px; width: 48px; }

/* Chiffres clés en italique dynamique (esprit compteur de vitesse / dossard) */
.stat-big, .ccn, .gear-hero-value, .hero-chip .v { font-style: italic; }

/* Accent « coup de pédale » devant les titres de section */
.section-head h2 { display: flex; align-items: center; gap: 11px; }
.section-head h2::before {
  content: ""; width: 7px; height: 1.05em; flex: none; border-radius: 2px;
  background: var(--grad-strip); transform: skewX(-14deg);
}

/* Boutons : petite impulsion vers l'avant au survol */
.btn { transition: transform .12s ease, background .15s, box-shadow .15s, color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Titres de page un peu plus affirmés */
h1 { letter-spacing: -.03em; }

/* ================== Coquille dashboard (toute l'app) ================== */
body:has(.dash-shell) { background: var(--bg); }

.dash-shell { display: grid; grid-template-columns: 234px minmax(0, 1fr); min-height: 100vh; }
.dash-main-inner { max-width: 1200px; margin-inline: auto; width: 100%; }
.dash-home { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.dash-home-main { min-width: 0; }

/* --- Barre latérale --- */
.dash-side { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto; }
.dash-logo { display: block; text-align: center; padding: 4px 0 14px; flex-shrink: 0; }
.dash-logo img { height: 54px; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.dash-nav a { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 12px; color: var(--ink-soft);
  font-weight: 600; font-size: .95rem; transition: background .12s, color .12s, transform .12s; }
.dash-nav a:hover { background: var(--bg); color: var(--ink); transform: translateX(2px); }
.dash-nav a.active { background: var(--yellow-tint); color: var(--ink); box-shadow: inset 3px 0 0 var(--red); }
.dash-group { display: flex; flex-direction: column; }
/* Menu dépliant natif : la tête (summary) déplie/replie ses enfants au clic,
   sans charger de page. Le filet d'onglet (la barre latérale) est toujours sombre. */
.dash-group > summary.dash-group-head { list-style: none; cursor: pointer; }
.dash-group > summary.dash-group-head::-webkit-details-marker { display: none; }
.dash-group-head { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 12px;
  color: rgba(255, 255, 255, .70); font-family: var(--font-head); font-weight: 700; font-size: .95rem;
  transition: background .12s, color .12s; }
.dash-group-head:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.dash-group-head.active { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 3px 0 0 var(--yellow); }
.dash-chevron { margin-left: auto; font-size: .7rem; opacity: .6; transition: transform .2s; }
.dash-group[open] > .dash-group-head .dash-chevron { transform: rotate(90deg); }
.dash-subnav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px; padding-left: 30px; }
.dash-subnav a { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px;
  font-size: .85rem; color: var(--ink-soft); text-decoration: none; font-family: var(--font-head); font-weight: 500; transition: all .15s; }
.dash-subnav a:hover { background: var(--bg); color: var(--ink); }
.dash-subnav a.active { background: var(--yellow-tint); color: var(--ink); box-shadow: inset 3px 0 0 var(--red); font-weight: 700; }
.dash-side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.dash-theme { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 34px; cursor: pointer; font-size: 1rem; }
.dash-user { display: flex; align-items: center; gap: 10px; }
.dash-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--grad-hero); color: var(--ink); font-weight: 800; font-family: var(--font-head); flex: none; }
.dash-avatar.sm { width: 30px; height: 30px; font-size: .8rem; }
.dash-uname { font-weight: 700; font-size: .9rem; line-height: 1.1; }
.dash-logout { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: .85rem; text-align: left; padding: 0; }
.dash-logout:hover { color: var(--red); }

/* --- Zone principale --- */
.dash-main { padding: 26px 30px; min-width: 0; }
.dash-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-top h1 { margin: 0; }
.dash-date { color: var(--muted); margin: 2px 0 0; }

.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dstat { border-radius: 18px; padding: 18px 20px; color: #fff; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.dstat::after { content: ""; position: absolute; right: -26px; top: -30px; width: 110px; height: 110px; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%); border-radius: 50%; }
.dstat-l { font-size: .82rem; font-weight: 600; opacity: .92; }
.dstat-v { font-size: 2rem; font-weight: 800; font-family: var(--font-head); font-style: italic; line-height: 1.1; margin-top: 4px; }
.dstat-v small { font-size: .95rem; font-style: normal; font-weight: 600; }
.dstat-y { background: var(--grad-hero); color: var(--ink); }
.dstat-r { background: var(--grad-red); }
.dstat-d { background: linear-gradient(135deg, #2c2f37, #17181c); }
.dstat-k { background: linear-gradient(135deg, #FFB300, var(--red)); }

.dash-chart { display: flex; align-items: flex-end; gap: 7px; height: 150px; }
.dash-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.dash-colv { font-size: .68rem; color: var(--muted); }
.dash-coll { font-size: .7rem; color: var(--muted); }
.dash-bar { width: 100%; min-height: 3px; background: var(--grad-strip); border-radius: 6px 6px 0 0; }

.dash-rides { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dash-ride { display: flex; flex-direction: column; gap: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.dash-ride:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.dash-ride strong { font-size: 1.02rem; }
.dash-ride-meta { color: var(--muted); font-size: .85rem; }
.dash-ride-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.dash-ride-rsvp { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.dash-ride-feat { background: var(--grad-hero); border: none; color: var(--ink); }
.dash-ride-tag { align-self: flex-start; background: rgba(23,24,28,.85); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }

/* --- Panneau droit --- */
.dash-right { padding: 26px 22px; border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 18px; }
.dash-cal { background: var(--grad-red); color: #fff; border-radius: 16px; padding: 12px 18px; display: flex; align-items: baseline; gap: 12px; }
.dash-cal-d { font-size: 2.1rem; font-weight: 800; font-family: var(--font-head); font-style: italic; line-height: 1; }
.dash-cal-m { font-weight: 600; opacity: .95; }
.dash-panel h3 { font-size: .98rem; margin: 0 0 10px; }
.dash-task { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .9rem; }
.dash-task:last-child { border-bottom: none; }
.dash-task:hover { color: var(--red); }
.dash-task-d { font-weight: 700; color: var(--red-dark); flex: none; font-size: .82rem; min-width: 44px; }
.dash-club-grid { display: flex; gap: 14px; margin-bottom: 10px; }
.dash-club-grid div { display: flex; flex-direction: column; }
.dash-club-grid b { font-size: 1.3rem; font-family: var(--font-head); font-style: italic; }
.dash-club-grid span { font-size: .72rem; color: var(--muted); }
.dash-msg { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.dash-msg:last-child { border-bottom: none; }
.dash-msg-b { font-size: .85rem; line-height: 1.3; }

/* L'accueil passe en une colonne ; le panneau droit s'empile sous le contenu
   mais en GRILLE multi-colonnes (sinon le calendrier/panneaux deviennent
   énormes en pleine largeur). */
@media (max-width: 1080px) {
  .dash-home { grid-template-columns: 1fr; }
  .dash-right { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: start; }
  .dash-cal { display: flex; align-items: baseline; gap: 12px; justify-content: center; }
  .dash-cal-d { font-size: 2rem; }
}
@media (max-width: 560px) {
  .dash-right { grid-template-columns: 1fr; }
}
/* (Plus de mode « icônes seules » : sidebar complète >=900px, sinon hamburger.) */
/* Mobile : barre du haut, contenu en dessous, défilement normal */
@media (max-width: 680px) {
  .dash-shell { display: block; }
  .dash-side { flex-direction: row; height: auto; position: static; overflow-x: auto; align-items: center; gap: 6px; padding: 8px 10px; }
  .dash-logo { padding: 0; }
  .dash-side-foot { flex-direction: row; border: none; padding-top: 0; margin-left: auto; gap: 8px; }
  .dash-user, .dash-logout { display: none; }
  .dash-nav { flex-direction: row; }
  .dash-subnav { flex-basis: 100%; padding-left: 14px; }
  .dash-main { padding: 16px; }
}

/* ====== Dashboard : version « plus travaillée » (sidebar sombre + fond riche) ====== */
/* Fond avec halos colorés (sur var(--bg) -> marche en clair ET sombre) */
body:has(.dash-shell) {
  background:
    radial-gradient(72rem 42rem at 92% -12%, rgba(255, 210, 30, .13), transparent 60%),
    radial-gradient(60rem 40rem at -12% 112%, rgba(230, 48, 39, .09), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Barre latérale sombre (encre) */
.dash-side {
  background: linear-gradient(185deg, #23262f 0%, #15161b 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 6px 0 28px rgba(10, 11, 14, .18);
}
.dash-logo img { height: 60px; }
.dash-nav a { color: rgba(255, 255, 255, .70); }
.dash-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; transform: translateX(2px); }
.dash-nav a.active { background: var(--grad-hero); color: #17181c; box-shadow: 0 6px 16px rgba(255, 199, 0, .28); font-weight: 700; }
html[data-theme="dark"] .dash-subnav a { color: rgba(255, 255, 255, .82); }
html[data-theme="dark"] .dash-subnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
html[data-theme="dark"] .dash-subnav a.active { background: var(--grad-hero); color: #17181c; box-shadow: none; }
.dash-side-foot { border-top: 1px solid rgba(255, 255, 255, .10); }
.dash-uname { color: #fff; }
.dash-logout { color: rgba(255, 255, 255, .55); }
.dash-logout:hover { color: #ff8a80; }
.dash-theme { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; }

/* Panneaux de droite -> cartes flottantes (plus de colonne blanche plate) */
.dash-right { background: transparent; border-left: none; }
.dash-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: 0 8px 22px rgba(20, 22, 28, .06); }

/* Ombres plus douces et profondes sur les cartes du tableau de bord */
.dash-ride { box-shadow: 0 6px 18px rgba(20, 22, 28, .05); }
.dash-ride:hover { box-shadow: 0 14px 30px rgba(20, 22, 28, .13); }
.dash-cal { box-shadow: 0 10px 26px rgba(230, 48, 39, .28); }
.dash-stats .dstat { box-shadow: 0 12px 26px rgba(20, 22, 28, .14); }

/* Carte "graphe" et autres cartes du main : un poil plus rondes + ombre douce */
.dash-home-main > .card { border-radius: 18px; box-shadow: 0 8px 22px rgba(20, 22, 28, .06); }

@media (max-width: 680px) {
  .dash-side { background: linear-gradient(90deg, #23262f, #15161b); }
}

/* ====== Style « flottant » accentué (les cartes lévitent au-dessus du fond) ====== */
.dash-home-main > .card, .dash-panel, .dash-ride { border: none; }
.dash-main { padding: 28px 34px; }
.dash-stats { gap: 16px; margin-bottom: 22px; }
.dash-rides { gap: 16px; }
.dash-right { gap: 18px; padding: 0; }

.dash-home-main > .card {
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(20, 22, 28, .10), 0 3px 10px rgba(20, 22, 28, .05);
}
.dash-panel {
  border-radius: 20px;
  box-shadow: 0 16px 38px rgba(20, 22, 28, .09), 0 2px 8px rgba(20, 22, 28, .04);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dash-panel:hover { transform: translateY(-3px); box-shadow: 0 26px 52px rgba(20, 22, 28, .13); }

.dash-ride { border-radius: 18px; box-shadow: 0 12px 28px rgba(20, 22, 28, .08); }
.dash-ride:hover { transform: translateY(-4px); box-shadow: 0 28px 50px rgba(20, 22, 28, .17); }

.dash-stats .dstat { border-radius: 22px; box-shadow: 0 18px 40px rgba(20, 22, 28, .17); transition: transform .15s ease, box-shadow .15s ease; }
.dash-stats .dstat:hover { transform: translateY(-4px); box-shadow: 0 28px 54px rgba(20, 22, 28, .22); }

.dash-cal { border-radius: 20px; box-shadow: 0 18px 40px rgba(230, 48, 39, .32); }

/* ====== Toute la page (dashboard) dans un cadre flottant ====== */
/* Desktop / tablette large ET assez haute : la coquille devient une fenêtre
   arrondie ; sidebar fixe, contenu qui défile à l'intérieur. (Pas de cadre sur
   les écrans courts, ex. téléphone en paysage.) */
@media (min-width: 900px) and (min-height: 620px) {
  .container:has(.dash-shell) { padding: 0; }
  .dash-shell {
    margin: 18px;
    height: calc(100vh - 36px);
    min-height: 0;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 34px 80px rgba(20, 22, 28, .20), 0 10px 26px rgba(20, 22, 28, .10);
  }
  .dash-side { position: static; height: 100%; box-shadow: none; }
  .dash-main { height: 100%; overflow-y: auto; }
  /* léger rembourrage du scroll interne */
  .dash-main::-webkit-scrollbar { width: 9px; }
  .dash-main::-webkit-scrollbar-thumb { background: rgba(20, 22, 28, .14); border-radius: 9px; }
}
/* Mobile : plein écran, pas de cadre, défilement normal de la page */
@media (max-width: 899px) {
  .dash-shell { margin: 0; height: auto; min-height: 100vh; border-radius: 0; overflow: visible; }
  .dash-main { overflow: visible; height: auto; }
}

/* ====== Fond derrière le cadre flottant : chaleureux (fini le double beige) ====== */
/* Intérieur du cadre = canevas neutre (les cartes blanches ressortent) */
.dash-shell { background: var(--bg); }
/* Extérieur (la marge autour du cadre) = dégradé doré + halos colorés */
body:has(.dash-shell) {
  background:
    radial-gradient(54rem 38rem at 100% 0%, rgba(230, 48, 39, .16), transparent 55%),
    radial-gradient(64rem 48rem at 0% 100%, rgba(255, 199, 0, .34), transparent 55%),
    linear-gradient(135deg, #FFE7AE 0%, #F4D784 100%);
  background-attachment: fixed;
}
html[data-theme="dark"] body:has(.dash-shell) {
  background:
    radial-gradient(54rem 38rem at 100% 0%, rgba(230, 48, 39, .22), transparent 55%),
    radial-gradient(64rem 48rem at 0% 100%, rgba(255, 199, 0, .16), transparent 55%),
    linear-gradient(140deg, #1e2027 0%, #101116 100%);
  background-attachment: fixed;
}

/* ====== Logo dans un médaillon clair compact (visible sur la barre sombre) ====== */
.dash-logo { display: block; width: fit-content; background: #fff; border-radius: 16px; margin: 4px auto 18px; padding: 9px 14px; box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
.dash-logo img { height: 56px; width: auto; }
@media (max-width: 980px) {
  .dash-logo { margin: 0 auto 6px; padding: 6px; border-radius: 12px; }
  .dash-logo img { height: 36px; }
}
@media (max-width: 680px) {
  .dash-logo { padding: 5px 8px; margin: 0; border-radius: 11px; }
  .dash-logo img { height: 30px; }
}

/* Avatar sidebar : photo du membre si renseignée */
.dash-avatar-photo { background-size: cover; background-position: center; color: transparent; }

/* ====== En-tête sidebar : bandeau jaune travaillé, coupé en diagonale ====== */
@media (min-width: 900px) {
  .dash-side { padding-top: 0; padding-left: 0; padding-right: 0; }
  .dash-nav { padding-left: 14px; padding-right: 14px; }
  .dash-side-foot { padding-left: 14px; padding-right: 14px; }
  .dash-logo {
    width: auto; margin: 0 0 14px; padding: 18px 8px 46px;
    border-radius: 0; box-shadow: none; text-align: center;
    background:
      radial-gradient(135% 95% at 50% 8%, rgba(255, 255, 255, .42), transparent 62%),
      linear-gradient(135deg, #FFE9A6 0%, #FFD21E 68%, #F6C000 100%);
    clip-path: polygon(0 0, 100% 0, 100% 66%, 0 100%);
  }
  .dash-logo img { height: 104px; width: auto; max-width: 100%; margin-inline: auto; filter: drop-shadow(0 2px 4px rgba(120, 80, 0, .35)); }
}

/* Pied de sidebar : bouton thème intégré à la ligne du profil (plus perdu) */
.dash-user { display: flex; align-items: center; gap: 10px; }
.dash-uname { flex: 1; min-width: 0; }
.dash-theme { flex: none; margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .95rem; }
@media (max-width: 680px) { .dash-uname { display: none; } .dash-theme { margin-left: 0; } }

/* Sparklines dans les cartes stats du tableau de bord */
.dstat-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38px; opacity: .85; pointer-events: none; }
.dstat-spark polyline { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.dstat-y .dstat-spark polyline { stroke: rgba(20, 22, 28, .38); }
.dstat-v { position: relative; z-index: 1; }
.dstat-l { position: relative; z-index: 1; }

/* Gros chiffres (stats) en Saira Condensed, esprit compteur */
.dstat-v, .stat-big, .ccn, .gear-hero-value, .dash-cal-d, .dash-club-grid b,
.hero-chip .v, .club-counter-grid .ccn { font-family: var(--font-num); letter-spacing: .01em; }

/* Menu (sidebar) en Saira pour s'accorder aux titres ; texte courant reste Inter */
.dash-nav a, .dash-uname { font-family: var(--font-head); }
.dash-nav a { font-weight: 600; letter-spacing: .005em; }

/* ====== Menu mobile en tiroir (cohérent avec le desktop) ====== */
.dash-mobilebar, .dash-backdrop { display: none; }

/* Téléphone : portrait (étroit) OU paysage (large mais court) → même menu. */
@media (max-width: 899px), (orientation: landscape) and (max-height: 540px) {
  .dash-shell { display: block; }

  /* Barre du haut noire avec ☰ dans une diagonale jaune (motif sidebar) */
  .dash-mobilebar {
    display: flex; align-items: stretch;
    position: sticky; top: 0; z-index: 2100; height: 54px;
    background: linear-gradient(135deg, #23262f, #15161b); padding: 0;
    box-shadow: 0 2px 14px rgba(10, 11, 14, .25);
    transition: box-shadow .25s ease;
  }
  /* Menu ouvert : plus d'ombre sous la barre (le jaune fusionne proprement) */
  .dash-shell.nav-open .dash-mobilebar { box-shadow: none; }
  .dash-burger {
    background: var(--yellow); border: none; cursor: pointer;
    width: 88px; height: 100%; padding-right: 18px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    clip-path: polygon(0 0, 100% 0, 68% 100%, 0 100%);
    transition: width .28s cubic-bezier(.4, 0, .2, 1), clip-path .28s cubic-bezier(.4, 0, .2, 1), padding .28s cubic-bezier(.4, 0, .2, 1);
  }
  .dash-burger span { display: block; width: 25px; height: 3px; background: #17181c; border-radius: 3px; transition: transform .3s ease, opacity .2s ease; }
  /* Menu ouvert : le jaune s'élargit à la largeur du tiroir et sa diagonale
     s'aplatit → il fusionne avec le bandeau jaune du menu (une seule zone). */
  .dash-shell.nav-open .dash-burger {
    width: 272px; max-width: 85vw; padding: 0 0 0 30px; align-items: flex-start;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  .dash-shell.nav-open .dash-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .dash-shell.nav-open .dash-burger span:nth-child(2) { opacity: 0; }
  .dash-shell.nav-open .dash-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .dash-mobilelogo { display: none; }

  /* La sidebar devient un tiroir qui glisse depuis la gauche, SOUS la barre du haut */
  .dash-side {
    position: fixed; top: 54px; left: 0; height: calc(100vh - 54px); width: 272px; max-width: 85vw;
    transform: translateX(-100%); transition: transform .28s cubic-bezier(.4, 0, .2, 1); z-index: 2000;
    flex-direction: column; align-items: stretch; overflow-y: auto; gap: 0;
    padding: 0 0 16px;
    border-right: none;  /* pas de bordure/ombre à droite qui détonne avec la barre du haut */
    scrollbar-width: none;  /* la scrollbar ne doit pas réduire la largeur du bandeau jaune */
  }
  .dash-side::-webkit-scrollbar { width: 0; height: 0; display: none; }
  .dash-shell.nav-open .dash-side { transform: translateX(0); box-shadow: none; }

  /* Bandeau jaune diagonal en haut du tiroir — même dégradé que la barre du
     haut pour un raccord parfait quand le jaune fusionne. */
  .dash-side .dash-logo {
    display: block; width: auto; margin: 0 0 10px; padding: 16px 8px 40px;
    border-radius: 0; box-shadow: none; text-align: center;
    background: var(--yellow);
    clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%);
  }
  .dash-side .dash-logo img { height: 84px; width: auto; margin-inline: auto; filter: drop-shadow(0 2px 4px rgba(120, 80, 0, .35)); }

  /* Menu vertical avec labels visibles */
  .dash-nav { flex-direction: column; padding: 0 12px; gap: 4px; }
  .dash-nav a { justify-content: flex-start; font-size: 1.02rem; padding: 12px 14px; }
  .dash-nav a span { display: inline; }

  /* Pied : profil + thème + déconnexion */
  .dash-side-foot { flex-direction: column; align-items: stretch; gap: 12px; margin: 0; padding: 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
  .dash-user { display: flex; }
  .dash-uname { display: inline; }
  .dash-logout { display: block; }
  .dash-theme { margin-left: auto; }

  /* Voile sombre derrière le tiroir */
  .dash-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1999; }
  .dash-shell.nav-open .dash-backdrop { display: block; }

  .dash-main { padding: 16px; }
}

/* ====== Page de connexion « classe » (carte + bandeau jaune diagonal) ====== */
body:has(.login-box) {
  background:
    radial-gradient(54rem 38rem at 100% 0%, rgba(230, 48, 39, .16), transparent 55%),
    radial-gradient(64rem 48rem at 0% 100%, rgba(255, 199, 0, .34), transparent 55%),
    linear-gradient(135deg, #FFE7AE 0%, #F4D784 100%);
  background-attachment: fixed;
}
html[data-theme="dark"] body:has(.login-box) {
  background:
    radial-gradient(54rem 38rem at 100% 0%, rgba(230, 48, 39, .22), transparent 55%),
    radial-gradient(64rem 48rem at 0% 100%, rgba(255, 199, 0, .16), transparent 55%),
    linear-gradient(140deg, #1e2027 0%, #101116 100%);
}
body:has(.login-box) .site-header { display: none; }
body:has(.login-box) main.container { display: grid; place-items: center; min-height: 100vh; padding: 24px; max-width: none; }
body:has(.login-box) .site-footer { background: transparent; }

.login-box { width: 100%; max-width: 412px; background: var(--surface); border-radius: 24px; overflow: hidden; box-shadow: 0 34px 80px rgba(20, 22, 28, .26), 0 8px 24px rgba(20, 22, 28, .12); }
.login-head { background: radial-gradient(135% 95% at 50% 8%, rgba(255, 255, 255, .42), transparent 62%), linear-gradient(135deg, #FFE9A6 0%, #FFD21E 68%, #F6C000 100%); padding: 30px 30px 48px; text-align: center; clip-path: polygon(0 0, 100% 0, 100% 74%, 0 100%); }
.login-logo { height: 84px; width: auto; margin: 0 auto; filter: drop-shadow(0 2px 4px rgba(120, 80, 0, .3)); }
.login-body { padding: 14px 30px 30px; }
.login-body h1 { margin: 0 0 6px; }
.login-label { display: block; font-weight: 600; font-size: .88rem; margin: 14px 0 6px; }
.login-input { width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
.login-input:focus { outline: none; border-color: var(--yellow-dark); box-shadow: 0 0 0 3px rgba(255, 210, 30, .25); }
.login-foot { margin-top: 16px; text-align: center; }

/* ====== Formulaire « Ma fiche » : grille responsive et lisible ====== */
.form-section-title { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; color: var(--ink); margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.form-section-title:first-of-type { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.form-grid .fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-grid .fld-span2 { grid-column: 1 / -1; }
.form-grid label { font-weight: 600; font-size: .88rem; color: var(--ink-soft); }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.form-grid textarea { min-height: 72px; resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: none; border-color: var(--yellow-dark); box-shadow: 0 0 0 3px rgba(255, 210, 30, .22);
}
.form-grid input[type="file"] { padding: 8px; background: var(--bg); }
.form-grid .helptext { margin: 0; }
.fld-err { color: var(--red); font-size: .82rem; }

.vis-fieldset { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px 8px; margin: 22px 0 18px; }
.vis-fieldset legend { padding: 0 8px; font-weight: 700; font-family: var(--font-head); }
.vis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 16px; margin-top: 8px; }
.vis-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.vis-check input { width: auto; }

@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ====== Ma fiche : disposition photo (gauche) + champs (droite) ====== */
.profile-edit { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 30px; align-items: start; }
.profile-photo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.photo-preview-wrap { width: 180px; height: 180px; border-radius: 20px; overflow: hidden; background: var(--bg); border: 1px solid var(--line-2); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.photo-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { font-size: 3.2rem; opacity: .45; }
.photo-pick { cursor: pointer; }
.photo-clear-lbl { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); cursor: pointer; }
.profile-fields { min-width: 0; }
@media (max-width: 760px) {
  .profile-edit { grid-template-columns: 1fr; }

}

/* ====== Synthèse de perf par sortie ====== */
.synth-card { background: linear-gradient(135deg, var(--surface), var(--bg)); }
.synth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
.synth-stat { background: var(--bg); border-radius: 14px; padding: 14px 16px; text-align: center; }
.synth-v { font-family: var(--font-num); font-style: italic; font-weight: 800; font-size: 1.9rem; line-height: 1; color: var(--red); }
.synth-verdict .synth-v { font-size: 1.25rem; font-style: normal; color: var(--ink); font-family: var(--font-head); }
.synth-l { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 5px; }

/* ====== Saisie « parcours par communes » à étiquettes + autocomplétion ====== */
.town-picker { margin-top: 6px; }
.town-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.town-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--yellow-tint); color: var(--ink); border: 1px solid var(--yellow-100); border-radius: var(--radius-pill); padding: 5px 6px 5px 5px; font-size: .88rem; font-weight: 600; }
.town-chip .town-ord { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: .72rem; font-weight: 800; }
.town-chip button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 0 2px; }
.town-chip button:hover { color: var(--red); }
.town-inputwrap { position: relative; }
.town-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.town-input:focus { outline: none; border-color: var(--yellow-dark); box-shadow: 0 0 0 3px rgba(255, 210, 30, .22); }
.town-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; display: none; }
.town-drop.open { display: block; }
.town-opt { padding: 9px 13px; cursor: pointer; font-size: .9rem; }
.town-opt:hover { background: var(--yellow-tint); }

/* Texte narratif de la synthèse de sortie */
.synth-text { margin: 0 0 14px; font-size: .98rem; line-height: 1.55; color: var(--ink); }

/* ============================ Galerie souvenirs ============================ */
.souvenir-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.souvenir { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2, #f1f1f3); box-shadow: var(--shadow-sm); }
.souvenir img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; transition: transform .25s ease; }
.souvenir:hover img { transform: scale(1.04); }
.souvenir figcaption { padding: 7px 9px; font-size: .8rem; line-height: 1.3; }
.souvenir-cap { display: block; color: var(--ink); font-weight: 600; }
.souvenir-by { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.souvenir-ctl { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.souvenir:hover .souvenir-ctl, .souvenir:focus-within .souvenir-ctl { opacity: 1; }
.souvenir-ctl button { border: none; cursor: pointer; width: 28px; height: 28px; border-radius: 8px; background: rgba(0, 0, 0, .58); color: #fff; font-size: .9rem; line-height: 1; }
.souvenir-ctl button:hover { background: rgba(0, 0, 0, .8); }
.souvenir-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.souvenir-cap-input { flex: 1 1 220px; min-width: 160px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; }
.souvenir-cap-input:focus { outline: none; border-color: var(--yellow-dark); box-shadow: 0 0 0 3px rgba(255, 210, 30, .22); }

/* Visionneuse plein écran */
.lightbox { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .9); }
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.lb-figure img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 6px; }
.lb-figure figcaption { color: #fff; margin-top: 12px; font-size: .95rem; text-align: center; max-width: 80vw; }
.lb-close { position: absolute; top: 14px; right: 18px; background: none; border: none; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .12); border: none; color: #fff; font-size: 2.6rem; width: 56px; height: 72px; cursor: pointer; border-radius: 10px; }
.lb-nav:hover { background: rgba(255, 255, 255, .25); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
@media (max-width: 600px) { .lb-nav { width: 44px; height: 58px; font-size: 2rem; } }

/* ============================== Trophées (jeu) ============================== */
.level-card { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; background: linear-gradient(110deg, var(--yellow-tint), var(--surface) 65%); }
.level-emoji { font-size: 3rem; line-height: 1; }
.level-main { flex: 1; min-width: 0; }
.level-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.level-num { font-family: var(--font-head, inherit); font-weight: 800; font-size: 1.35rem; }
.level-title { font-weight: 700; color: var(--yellow-dark); }
.level-bar { height: 14px; border-radius: 9px; background: var(--line-2); overflow: hidden; margin: 8px 0 6px; }
.level-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--yellow-dark)); border-radius: 9px; transition: width .8s ease; }
.level-xp { font-size: .85rem; color: var(--muted); }

.my-crowns { margin-bottom: 18px; }
.crown-mine { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.crown-chip { background: var(--yellow); color: #1a1a1a; border-radius: var(--radius-pill); padding: 6px 13px; font-weight: 700; font-size: .9rem; }

.kom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kom-card { display: flex; gap: 12px; padding: 13px 15px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); }
.kom-card.kom-mine { border-color: var(--yellow-dark); background: linear-gradient(120deg, var(--yellow-tint), var(--surface) 70%); box-shadow: 0 0 0 2px rgba(255, 210, 30, .25); }
.kom-emoji { font-size: 2rem; line-height: 1; flex: none; }
.kom-body { min-width: 0; }
.kom-title { font-weight: 800; }
.kom-scope { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; white-space: nowrap; }
.kom-desc { font-size: .82rem; color: var(--muted); margin: 2px 0 6px; }
.kom-holder { font-size: .9rem; }
.kom-vacant { color: var(--muted); font-style: italic; }

.badge-counter { font-size: .85rem; color: var(--muted); font-weight: 600; }
.badge-group-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-item { text-align: center; padding: 14px 10px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); }
.badge-medal { font-size: 2.4rem; line-height: 1; }
.badge-name { font-weight: 800; margin-top: 6px; }
.badge-desc { font-size: .76rem; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.badge-tick { font-size: .74rem; font-weight: 700; color: var(--yellow-dark); margin-top: 7px; }
.badge-tick.locked { color: var(--muted); font-weight: 600; }
.badge-locked { opacity: .55; filter: grayscale(.85); }
.badge-locked .badge-medal { filter: grayscale(1); }

/* ===================== Animation de récompense (plein écran) ===================== */
.award-stage { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(20, 20, 25, .82), rgba(0, 0, 0, .94)); animation: award-fade .3s ease; }
.award-stage.closing { animation: award-fade .4s ease reverse forwards; }
@keyframes award-fade { from { opacity: 0; } to { opacity: 1; } }
.award-confetti { position: absolute; inset: 0; pointer-events: none; }
.award-card { position: relative; text-align: center; padding: 34px 30px 28px; border-radius: 22px; max-width: 92vw; width: 380px;
  background: linear-gradient(160deg, #fff, #f4f4f6); box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  animation: award-pop .6s cubic-bezier(.18, .9, .3, 1.4); }
[data-theme="dark"] .award-card { background: linear-gradient(160deg, #23242a, #16171b); color: #f3f3f5; }
@keyframes award-pop { 0% { transform: scale(.4) rotate(-6deg); opacity: 0; } 60% { transform: scale(1.06) rotate(2deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.award-kind { font-family: var(--font-head, inherit); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .82rem; color: var(--yellow-dark); }
.award-halo { position: absolute; top: 96px; left: 50%; width: 180px; height: 180px; margin: -90px 0 0 -90px;
  background: radial-gradient(circle, rgba(255, 210, 30, .55), transparent 65%); border-radius: 50%; animation: award-halo 2.4s ease-in-out infinite; z-index: 0; }
@keyframes award-halo { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.18); opacity: 1; } }
.award-medal { position: relative; z-index: 1; font-size: 5.2rem; line-height: 1; margin: 8px 0 4px; animation: award-shake .7s ease .15s; }
@keyframes award-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg) scale(1.1); } 40% { transform: rotate(10deg) scale(1.1); } 60% { transform: rotate(-7deg); } 80% { transform: rotate(5deg); } }
.award-title { font-family: var(--font-head, inherit); font-weight: 800; font-size: 1.7rem; margin-top: 4px; }
.award-detail { color: var(--muted); margin-top: 4px; font-size: .98rem; }
.award-next { margin-top: 18px; min-width: 140px; }
.award-count { margin-top: 10px; font-size: .78rem; color: var(--muted); }
.award-card.k-kom .award-kind { color: #c8962a; }
.award-card.k-level .award-halo { background: radial-gradient(circle, rgba(120, 200, 120, .5), transparent 65%); }

/* ===================== Charte : la diagonale jaune & noir ===================== */
/* Bandeau de titre signature : fond noir + biseau jaune en diagonale. */
.diag-hero { position: relative; background: #17181c; color: #fff; border-radius: var(--radius); overflow: hidden; padding: 26px 28px; margin-bottom: 22px; }
.diag-hero::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 46%;
  background: radial-gradient(135% 120% at 80% 0, rgba(255,255,255,.35), transparent 60%), linear-gradient(135deg, #FFE9A6 0%, var(--yellow) 60%, var(--yellow-dark) 100%);
  clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 100%); }
.diag-hero > * { position: relative; z-index: 1; }
.diag-hero h1, .diag-hero h2 { color: #fff; margin: 0; }
.diag-hero .diag-hero-sub { color: rgba(255,255,255,.7); margin: 4px 0 0; font-weight: 500; }


/* Page Charte */
.charte-sw { display: flex; flex-wrap: wrap; gap: 12px; }
.charte-color { width: 120px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); }
.charte-color .sw { height: 64px; }
.charte-color .lbl { padding: 7px 9px; font-size: .76rem; }
.charte-color .lbl b { display: block; font-size: .82rem; }
.charte-font { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 10px; }

/* ============ Niveau & couronnes accolés à l'avatar du membre ============ */
.avatar-wrap { position: relative; display: inline-block; line-height: 0; }
/* Badge niveau : pastille ronde foncée, numéro jaune, anneau blanc — discret. */
.avatar-lvl { position: absolute; bottom: -4px; right: -4px; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%; background: #17181c; color: var(--yellow);
  border: 2.5px solid var(--surface); font-size: .78rem; font-weight: 800; line-height: 1; box-shadow: var(--shadow-sm); }
.avatar-lvl-lg { width: 34px; height: 34px; font-size: 1rem; bottom: 0; right: 0; }
/* Petites pastilles (sidebar, listes, participants) : badge compact dans le coin,
   pour ne pas masquer la photo. */
.avatar-lvl-sm { width: 21px; height: 21px; font-size: .7rem; border-width: 2px; bottom: -3px; right: -3px; }
.member-levelline { font-size: .92rem; margin: 0 0 7px; color: var(--ink-soft); }
.member-crownline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.crown-chip-sm { display: inline-block; background: var(--yellow-tint); border: 1px solid var(--yellow-100); color: var(--ink); border-radius: var(--radius-pill); padding: 3px 10px; font-size: .78rem; font-weight: 700; margin: 4px 0 0; }

/* Classement du club par niveau (page Trophées) */
.lvl-rank { width: 100%; border-collapse: collapse; }
.lvl-rank td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lvl-rank tr:last-child td { border-bottom: none; }
.lvl-rank-n { width: 38px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.lvl-rank tr:nth-child(1) .lvl-rank-n { color: #E8B500; font-size: 1.05rem; }
.lvl-rank tr:nth-child(2) .lvl-rank-n,
.lvl-rank tr:nth-child(3) .lvl-rank-n { color: var(--ink-soft); }
.lvl-rank-name { font-weight: 700; }
.lvl-rank-title { color: var(--muted); font-size: .88rem; }
.lvl-rank-lvl { text-align: right; white-space: nowrap; }
.lvl-pill { display: inline-block; background: #17181c; color: var(--yellow); border-radius: var(--radius-pill); padding: 3px 11px; font-size: .8rem; font-weight: 800; }
.lvl-me { background: var(--yellow-tint); }
.lvl-you { background: var(--yellow); color: #17181c; border-radius: var(--radius-pill); padding: 1px 8px; font-size: .7rem; font-weight: 700; margin-left: 4px; }
@media (max-width: 560px) { .lvl-rank-title { display: none; } }

/* ============================ Impression propre ============================ */
@media print {
  .dash-side, .dash-mobilebar, .dash-backdrop, .dash-burger,
  .site-header, .nav-tabs-bar, .theme-toggle, .dash-logout,
  footer, .backlink, .profile-banner, .award-stage { display: none !important; }
  .dash-shell, .dash-main, .dash-main-inner { display: block !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body, .dash-main { background: #fff !important; }
  .card, .diag-hero, .section { box-shadow: none !important; break-inside: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
  @page { margin: 1.4cm; }
}

/* Impression de la charte : les cartes en "break-inside: avoid" laissaient de
   grands vides (une carte qui ne tient pas saute à la page suivante). On laisse
   le contenu s'enchaîner et on compacte un peu pour remplir les pages. */
@media print {
  .charte-doc .card { break-inside: auto !important; margin-bottom: 12px !important; }
  .charte-doc .card-pad { padding: 12px 16px !important; }
  .charte-doc h2, .charte-doc h3 { break-after: avoid; }
}

/* Motif signature authentique : bloc jaune coupé en diagonale sur fond noir
   (repris de l'en-tête de la barre latérale, de la page de connexion, des emails). */
.diag-panel { background:
    radial-gradient(135% 95% at 50% 8%, rgba(255,255,255,.42), transparent 62%),
    linear-gradient(135deg, #FFE9A6 0%, var(--yellow) 68%, #F6C000 100%);
  clip-path: polygon(0 0, 100% 0, 100% 66%, 0 100%); padding: 22px 22px 52px; text-align: center; }
/* Logo sur fond jaune : ombre portée « flottante » (comme l'en-tête sidebar)
   pour détacher le cycliste jaune du fond jaune. */
.login-logo, .diag-panel img, .logo-floaty { filter: drop-shadow(0 2px 4px rgba(120, 80, 0, .38)); }
.diag-onblack { background: #17181c; border-radius: 16px; overflow: hidden; }
.diag-onblack .diag-cap { color: rgba(255,255,255,.82); padding: 6px 22px 20px; font-size: .9rem; }

.dash-avatar-link { flex: none; display: inline-block; }
.dash-avatar-link:hover { filter: brightness(1.04); }

.diag-onwhite { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.diag-onwhite .diag-cap { color: var(--muted); padding: 6px 22px 20px; font-size: .9rem; }

/* ===================== Carrousel souvenirs (fiche sortie) ===================== */
.sv-carousel { position: relative; overflow: hidden; border-radius: 14px; background: #0d0d10; margin-bottom: 12px; }
.sv-track { display: flex; transition: transform .55s cubic-bezier(.4, 0, .2, 1); }
.sv-slide { flex: 0 0 100%; margin: 0; position: relative; }
.sv-slide img { width: 100%; height: clamp(260px, 52vh, 580px); object-fit: contain; background: #0d0d10; display: block; cursor: zoom-in; }
.sv-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px 14px; color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0)); }
.sv-cap { display: block; font-weight: 700; font-size: 1.02rem; }
.sv-by { display: block; font-size: .8rem; opacity: .85; margin-top: 2px; }
.sv-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, .42); color: #fff;
  border: none; width: 44px; height: 64px; font-size: 2rem; cursor: pointer; border-radius: 10px; line-height: 1; }
.sv-nav:hover { background: rgba(0, 0, 0, .68); }
.sv-prev { left: 8px; } .sv-next { right: 8px; }
.sv-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.sv-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .5); cursor: pointer; padding: 0; }
.sv-dot.on { background: var(--yellow); width: 22px; border-radius: 5px; }
.sv-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sv-thumb { position: relative; width: 78px; height: 58px; border-radius: 9px; overflow: hidden; cursor: pointer; border: 2px solid transparent; }
.sv-thumb.on { border-color: var(--yellow-dark); }
.sv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sv-thumb-ctl { position: absolute; top: 2px; right: 2px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.sv-thumb:hover .sv-thumb-ctl { opacity: 1; }
.sv-thumb-ctl button { width: 21px; height: 21px; border: none; border-radius: 5px; background: rgba(0, 0, 0, .62); color: #fff; font-size: .68rem; cursor: pointer; padding: 0; line-height: 1; }
.sv-thumb-ctl form { display: inline; margin: 0; }
@media (max-width: 600px) { .sv-nav { width: 38px; height: 52px; font-size: 1.6rem; } }

/* ============================ Notifications ============================ */
.notif-badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: auto;
  background: var(--red); color: #fff; border-radius: var(--radius-pill); font-size: .68rem; font-weight: 800; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-unread { background: var(--yellow-tint); }
.notif-ic { font-size: 1.4rem; line-height: 1; flex: none; }
.notif-bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-ti { font-weight: 700; }
.notif-bo { font-size: .9rem; color: var(--ink-soft); }
.notif-dt { font-size: .76rem; color: var(--muted); }
.notif-go { flex: none; align-self: center; font-weight: 700; color: var(--red-dark); white-space: nowrap; }
/* Aperçu cloche (réutilise .notif-*) — le lien nav porte déjà le badge */
.np-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-weight: 500; }
.np-row input { width: auto; flex: none; }

/* ===================== Hub Palmarès & Trophées ===================== */
.hub-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.hub-tabs a { padding: 8px 15px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line-2);
  font-weight: 700; font-size: .88rem; color: var(--ink-soft); text-decoration: none; }
.hub-tabs a:hover { border-color: var(--yellow-dark); color: var(--ink); }
.club-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.club-fact { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; text-align: center; }
.club-fact b { display: block; font-family: var(--font-num); font-size: 1.9rem; color: var(--ink); line-height: 1; }
.club-fact span { display: block; font-size: .82rem; color: var(--muted); margin-top: 6px; }
section[id] { scroll-margin-top: 16px; }

/* « Ils y étaient » (sortie passée) */
.avatar-sm { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.went-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.went-card { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 86px; text-align: center; text-decoration: none; color: var(--ink); }
.went-card:hover { color: var(--red-dark); }
.went-name { font-size: .8rem; font-weight: 600; line-height: 1.2; }

.notif-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-top: 7px; }
.notif-act { flex: none; align-self: center; }
.notif-go-mute { color: var(--muted); font-weight: 600; }

/* ===================== Cloche de notifications (intégrée) ===================== */
.bell-wrap { position: relative; }
.bell-btn { position: relative; width: 34px; height: 34px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; font-size: 1.05rem; line-height: 1; display: grid; place-items: center; }
.bell-btn:hover { background: rgba(127,127,127,.16); }
.bell-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: var(--radius-pill); font-size: .62rem; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--surface); }
.bell-pop { position: absolute; width: 340px; max-width: 86vw; background: var(--surface); z-index: 1600;
  border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
/* `hidden` doit TOUJOURS l'emporter : sinon les règles display:flex ci-dessous
   (même spécificité, déclarées après) laissent le popup ouvert en permanence. */
.bell-pop[hidden] { display: none !important; }
/* Barre mobile : la cloche à droite, popup en position FIXE (sinon rogné par la barre) */
.mobilebar-bell { margin-left: auto; }
.mobilebar-bell .bell-btn { color: #fff; }
.mobilebar-bell .bell-pop {
  position: fixed; top: 58px; right: 8px; left: 8px; width: auto; max-width: none;
  max-height: calc(100vh - 72px); display: flex; flex-direction: column;
}
.mobilebar-bell .bell-pop .bell-pop-list { max-height: none; flex: 1; }
/* Pied de sidebar : popup vers le haut */
.sidebar-bell .bell-btn { color: #fff; }
.sidebar-bell .bell-pop { bottom: calc(100% + 10px); left: -6px; }
/* Mobile : les notifications passent par la cloche de la BARRE DU HAUT (popup
   plein écran, par-dessus le contenu). On masque la cloche du pied de tiroir,
   dont le popup recouvrait le menu et débordait du tiroir. */
@media (max-width: 899px) {
  .dash-side .sidebar-bell { display: none; }
}
.bell-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-pop-list { max-height: 60vh; overflow-y: auto; }
.bell-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.bell-item:hover { background: var(--yellow-tint); }
.bell-item.unread { background: var(--yellow-soft); }
.bell-item-bd { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bell-item .notif-ti { font-weight: 600; font-size: .9rem; }
.bell-empty { padding: 22px 14px; text-align: center; color: var(--muted); margin: 0; }
.bell-all { display: block; padding: 12px 14px; text-align: center; font-weight: 700; font-size: .88rem; }
.linklike { background: none; border: none; color: var(--red-dark); cursor: pointer; font-weight: 600; font-size: .82rem; padding: 0; }

/* Sorties passées : carte avec photo souvenir en couverture */
.ride-cover { display: block; height: 168px; background-size: cover; background-position: center; position: relative; }
.ride-cover-tag { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); }
.ride-past .body h3 { margin-top: 10px; }

/* Panneau notifications du tableau de bord */
.dash-notif-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--red); color: #fff; border-radius: var(--radius-pill); font-size: .68rem; font-weight: 800; vertical-align: middle; }
.dash-task-unread { background: var(--yellow-soft); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
html[data-theme="dark"] .dash-task-unread { background: rgba(255, 210, 30, .10); }
html[data-theme="dark"] .dash-task { border-bottom-color: rgba(255, 255, 255, .07); }

/* Boutons d'action par notification (centre) */
.notif-act { display: flex; align-items: center; gap: 6px; flex: none; align-self: center; }
.notif-icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: .9rem; text-decoration: none; line-height: 1; }
.notif-icon-btn:hover { background: var(--yellow-tint); color: var(--ink); }
.notif-del:hover { background: var(--red-tint); color: var(--red); border-color: var(--red); }

/* Lieu de rendez-vous : autocomplétion + lien GPS */
.rdv-wrap { position: relative; }
.rdv-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; display: none; }
.rdv-drop.open { display: block; }
.rdv-opt { padding: 9px 12px; cursor: pointer; font-size: .88rem; }
.rdv-opt:hover { background: var(--yellow-tint); }
.rdv-link { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.rdv-link:hover { color: var(--red-dark); }

/* Bannière d'accueil 1-tap (notifications / installation app) */
.onboard { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
  background: linear-gradient(110deg, var(--yellow-tint), var(--surface) 70%);
  border: 1px solid var(--yellow-100); border-left: 4px solid var(--yellow-dark);
  border-radius: 12px; padding: 12px 14px; }
.onboard-ic { font-size: 1.5rem; line-height: 1; }
.onboard-txt { flex: 1; min-width: 180px; font-weight: 600; font-size: .92rem; color: var(--ink); }
.onboard .btn { flex: none; }
.onboard-x { flex: none; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1.4rem; line-height: 1; padding: 0 4px; }
.onboard-x:hover { color: var(--ink); }

/* Formulaire licence : champs + contrôle fichier PDF propre */
.fld { margin-bottom: 14px; }
.fld > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.file-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.file-current { font-weight: 700; color: var(--red-dark); text-decoration: none; }
.file-current:hover { text-decoration: underline; }
.file-none { color: var(--muted); font-style: italic; }
.file-clear-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink-soft); }
.file-clear-lbl input { width: auto; }
.file-chosen { flex-basis: 100%; font-size: .85rem; color: var(--green-600, #2e7d32); }

/* ===================== Discussion : style chat (avatars + bulles) ===================== */
.comment-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment-av { flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: #17181c; color: var(--yellow); font-weight: 800; font-size: .8rem; }
.comment-av img { width: 100%; height: 100%; object-fit: cover; }
.comment-bubble { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px 14px 14px 14px;
  padding: 9px 13px; max-width: 80%; box-shadow: var(--shadow-xs); }
.comment-head { display: flex; align-items: center; gap: 8px; }
.comment-author { font-weight: 700; font-size: .9rem; color: var(--ink); }
.comment-actions { margin-left: auto; display: inline-flex; gap: 6px; }
.comment-body { margin-top: 3px; font-size: .95rem; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.comment-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.comment-photos img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }
.comment-date { display: block; margin-top: 5px; font-size: .72rem; color: var(--muted); }
/* Mes messages : alignés à droite, bulle jaune */
.comment-mine { flex-direction: row-reverse; }
.comment-mine .comment-bubble { background: var(--yellow-tint); border-color: var(--yellow-100); border-radius: 14px 4px 14px 14px; }
.comment-mine .comment-head { flex-direction: row-reverse; }
.comment-mine .comment-actions { margin-left: 0; margin-right: auto; }
.comment-mine .comment-date { text-align: right; }
.comment-empty { list-style: none; text-align: center; color: var(--muted); font-style: italic; padding: 18px 0; }

/* Tableau de bord : panneau trophées (niveau + couronnes) */
.dash-lvl-chip { display: inline-block; background: #17181c; color: var(--yellow); border-radius: var(--radius-pill); padding: 6px 13px; font-weight: 700; font-size: .85rem; text-decoration: none; }
.dash-lvl-chip:hover { color: #fff; }
.dash-crowns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ============ En-têtes de page : accent diagonal jaune/noir cohérent ============ */
.dash-main-inner h1 { position: relative; padding-left: 16px; }
.dash-main-inner h1::before {
  content: ""; position: absolute; left: 0; top: .14em; bottom: .14em; width: 6px; border-radius: 3px;
  background: var(--yellow);
}
/* Le bandeau diagonal (charte) garde son propre style, sans le liséré */
.dash-main-inner .diag-hero h1 { padding-left: 0; }
.dash-main-inner .diag-hero h1::before { content: none; }

/* Comptes rendus : actions à suivre */
.action-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.action-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.action-item:last-child { border-bottom: none; }
.action-check { background: none; border: none; cursor: pointer; font-size: 1.25rem; line-height: 1; color: var(--ink-soft); padding: 0; }
.action-text { flex: 1; min-width: 0; }
.action-meta { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.action-done .action-text { text-decoration: line-through; color: var(--muted); }
.action-done .action-check { color: var(--green-600, #2e7d32); }
.action-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px dashed var(--line-2); }

/* Formulaire compte rendu : grille 2 colonnes (champs courts) + pleine largeur */
.cr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.cr-grid .cr-full { grid-column: 1 / -1; }
.cr-grid textarea, .cr-grid input, .cr-grid select { width: 100%; }
.cr-check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.cr-check input { width: auto; }
@media (max-width: 720px) { .cr-grid { grid-template-columns: 1fr; } }

/* Sélecteur de carte pour le lieu de rendez-vous */
.rdv-map { height: 300px; border-radius: 10px; overflow: hidden; margin-top: 8px; border: 1px solid var(--line-2); }

/* Sélection de membres (présents/excusés) en cases à cocher */
.member-pick ul { list-style: none; margin: 0; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px;
  max-height: 190px; overflow-y: auto; columns: 2; column-gap: 14px; background: var(--surface); }
.member-pick li { break-inside: avoid; margin: 2px 0; }
.member-pick label { display: flex; align-items: center; gap: 7px; font-weight: 500; font-size: .9rem; cursor: pointer; }
.member-pick input { width: auto; flex: none; }
@media (max-width: 720px) { .member-pick ul { columns: 1; } }

/* ===================== Tour de bienvenue (1ère connexion) ===================== */
body.tour-open { overflow: hidden; }
#clx-tour { position: fixed; inset: 0; z-index: 9999; }
.tour-backdrop { position: fixed; inset: 0; background: rgba(20, 21, 26, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.tour-card { position: relative; width: 430px; max-width: 94vw; background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); animation: tourPop .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes tourPop { from { transform: translateY(14px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.tour-close { position: absolute; right: 12px; top: 12px; z-index: 2; width: 30px; height: 30px; border: none; border-radius: 50%; background: rgba(20, 21, 26, .28); color: #fff; cursor: pointer; font-size: .9rem; line-height: 1; }
.tour-close:hover { background: rgba(20, 21, 26, .5); }
.tour-head { height: 150px; background: radial-gradient(135% 95% at 50% 8%, rgba(255, 255, 255, .45), transparent 62%), linear-gradient(135deg, #FFE9A6 0%, #FFD21E 68%, #F6C000 100%); clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%); display: grid; place-items: center; }
.tour-head img { height: 92px; filter: drop-shadow(0 3px 5px rgba(120, 80, 0, .4)); }
.tour-body { padding: 22px 28px 6px; text-align: center; }
.tour-emoji { font-size: 2.4rem; line-height: 1; margin-bottom: 6px; }
.tour-title { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.tour-text { font-size: 1rem; color: var(--muted); line-height: 1.55; margin: 0 auto; max-width: 34ch; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 20px; margin-top: 12px; }
.tour-dots { display: flex; gap: 7px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; transition: all .2s; }
.tour-dots i.on { background: var(--yellow); width: 22px; border-radius: 5px; }
.tour-btns { display: flex; gap: 6px; align-items: center; }
/* Spotlight */
.tour-spot { position: fixed; inset: 0; z-index: 9999; }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(20, 21, 26, .62); transition: all .3s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.tour-tip { position: fixed; width: 250px; max-width: 80vw; background: var(--surface); color: var(--ink); border-radius: 14px; padding: 14px 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, .4); }
.tour-tip-title { font-weight: 800; margin-bottom: 4px; }
.tour-tip-text { font-size: .9rem; color: var(--muted); line-height: 1.45; }
.tour-tip-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.tour-tip-step { font-size: .8rem; color: var(--muted); font-weight: 600; }
@media (max-width: 560px) { .tour-head { height: 120px; } .tour-head img { height: 70px; } .tour-title { font-size: 1.2rem; } }
.tour-list { list-style: none; margin: 12px auto 0; padding: 0; text-align: left; max-width: 36ch; }
.tour-list li { position: relative; padding: 5px 0 5px 26px; font-size: .92rem; color: var(--ink-soft); line-height: 1.45; }
.tour-list li::before { content: "✓"; position: absolute; left: 2px; top: 5px; color: var(--red); font-weight: 800; }
.tour-body { max-height: 56vh; overflow-y: auto; }
html[data-theme="dark"] .tour-close { background: rgba(0,0,0,.4); }

/* RIB — bloc « payer la cotisation par virement » (profil membre) */
.rib { margin: 0; display: grid; gap: 8px; }
.rib > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rib dt { margin: 0; min-width: 72px; font-weight: 700; color: var(--muted); font-size: .85rem; }
.rib dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rib code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; background: var(--surface-2, rgba(0,0,0,.05)); padding: 3px 8px; border-radius: 6px; letter-spacing: .5px; }

/* === Caisses : encadrés d'aide + grille de comptage accessibles === */
.callout { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2, rgba(0,0,0,.04)); border-left: 4px solid var(--yellow); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; line-height: 1.55; }
.callout .callout-ic { font-size: 1.3rem; line-height: 1.2; flex: none; }
.callout p { margin: 0 0 6px; }
.callout p:last-child { margin-bottom: 0; }
.callout ol, .callout ul { margin: 6px 0 0; padding-left: 22px; }
.callout li { margin: 2px 0; }

.cashgrid { display: flex; gap: 28px; flex-wrap: wrap; }
.cashgrid-col { flex: 1; min-width: 250px; }
.cashgrid-col h3 { margin: 0 0 6px; }
.cash-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border, rgba(0,0,0,.08)); }
.cash-row label.cash-denom { width: 74px; text-align: right; font-weight: 600; flex: none; }
.cash-row input.cg-input { width: 88px; min-height: 44px; font-size: 1.05rem; text-align: center; padding: 6px; border: 1px solid var(--border, rgba(0,0,0,.2)); border-radius: 8px; }
.cash-row .cash-sub { margin-left: auto; min-width: 80px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.cash-total-line { margin-top: 16px; font-size: 1.2rem; padding: 12px 0; border-top: 2px solid var(--border, rgba(0,0,0,.12)); font-variant-numeric: tabular-nums; }
.field { display: block; margin: 0 0 12px; }
.field > span.field-lbl { display: block; font-weight: 600; margin-bottom: 4px; }
.field select, .field input { min-height: 44px; font-size: 1rem; }

/* Texte réservé aux lecteurs d'écran (accessibilité) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- Usure des consommables (carnet) ---------------------------------- */
.wear-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.wear-row:last-child{border-bottom:0}
.wear-ico{font-size:1.5rem;flex:0 0 auto;width:30px;text-align:center}
.wear-main{flex:1;min-width:0}
.wear-name{font-weight:700;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.wear-track{background:var(--line);border-radius:999px;overflow:hidden;height:12px;margin:6px 0 3px;box-shadow:inset 0 1px 2px rgba(20,20,20,.08)}
.wear-fill{display:block;height:100%;border-radius:999px;min-width:4px;transition:width .4s ease}
.wear-fill.wear-ok{background:linear-gradient(90deg,#43c171,#2e9e5b)}
.wear-fill.wear-warn{background:linear-gradient(90deg,#ffb13c,#e8920c)}
.wear-fill.wear-due{background:linear-gradient(90deg,#F0584F,#E63027)}
.wear-meta{font-size:.82rem;color:var(--muted);font-variant-numeric:tabular-nums}
.wear-tag{font-size:.72rem;font-weight:800;padding:2px 8px;border-radius:999px;text-transform:uppercase;letter-spacing:.02em}
.wear-tag.wear-ok{background:rgba(46,158,91,.14);color:#2e9e5b}
.wear-tag.wear-warn{background:rgba(232,146,12,.16);color:#c47600}
.wear-tag.wear-due{background:rgba(230,48,39,.14);color:#E63027}
html[data-theme="dark"] .wear-tag.wear-ok{color:#5bd98a}
html[data-theme="dark"] .wear-tag.wear-warn{color:#ffb13c}
html[data-theme="dark"] .wear-tag.wear-due{color:#ff7a72}
.wear-actions{flex:0 0 auto;display:flex;gap:6px;align-items:center}
.wear-why{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex:0 0 auto;border-radius:50%;border:1px solid var(--line);background:transparent;color:var(--muted);font-size:.72rem;font-weight:700;line-height:1;padding:0;cursor:pointer;user-select:none}
.wear-why:hover,.wear-why:focus{color:var(--ink);border-color:var(--muted);outline:none}
.wear-why-pop{margin-top:8px;font-size:.85rem;line-height:1.4;background:rgba(255,210,30,.14);border-radius:8px;padding:8px 11px;color:var(--ink)}
/* Mobile : empile la ligne d'usure — icône+nom sur la 1re ligne, barre/méta pleine largeur,
   actions repliées en pleine largeur dessous (sinon elles écrasent la colonne et le texte
   tombe à un mot par ligne). */
@media (max-width:560px){
  .wear-row{flex-wrap:wrap;gap:4px 12px}
  /* .wear-main garde son flex:1 (basis 0) → reste à côté de l'icône et wrappe SON
     contenu en interne, au lieu de passer toute la colonne sous l'icône. */
  .wear-actions{flex:1 0 100%;justify-content:flex-start;gap:6px;flex-wrap:wrap;margin-top:2px}
  .wear-actions .btn{padding:5px 9px;font-size:.8rem}
}

/* ===== Côtes / réglages vélo (BikeFit) ===== */
.fit-layout{display:grid;grid-template-columns:minmax(260px,1fr) 1.15fr;gap:18px;align-items:start}
.fit-layout-read{grid-template-columns:minmax(240px,.9fr) 1.1fr}
.fit-figure-wrap{position:sticky;top:12px}
.fit-figure{width:100%}
.fit-svg{width:100%;height:auto;display:block;color:var(--ink);--mk:#e8463c}
/* Vélo (silhouette monochrome recolorée) */
.fit-bikewrap path{fill:currentColor;fill-rule:evenodd}
/* Axe / origine boîtier de pédalier */
.fit-axis{stroke:var(--muted);stroke-width:2;stroke-dasharray:2 9;opacity:.65;fill:none}
.fit-origin{fill:var(--mk)}
/* Cotes numérotées (style bike-fit) */
.fit-dim{transition:opacity .15s}
.fit-dim .solid{stroke:var(--mk);stroke-width:3.2;fill:none}
.fit-dim .dash{stroke:var(--mk);stroke-width:2.4;stroke-dasharray:9 7;fill:none}
.fit-dim .tick{stroke:var(--mk);stroke-width:1.3;stroke-dasharray:4 6;fill:none;opacity:.65}
.fit-dim .lead{stroke:var(--mk);stroke-width:1.5;opacity:.6;fill:none}
.fit-dim .mk circle{fill:var(--mk)}
.fit-dim .mk text{fill:#fff;font-size:24px;font-weight:800;text-anchor:middle;dominant-baseline:central;font-family:var(--font-body,sans-serif)}
.fit-dim .name{fill:var(--mk);font-size:26px;font-weight:700;font-family:var(--font-body,sans-serif)}
/* Édition : la cote du champ focus ressort, les autres s'atténuent. */
.fit-svg:not(.fit-read) .fit-dim{opacity:.38}
.fit-svg:not(.fit-read) .fit-dim.is-on{opacity:1}
.fit-dim.is-on .solid,.fit-dim.is-on .dash{stroke-width:4.2}
.fit-dim.is-on .mk circle{r:25}
/* Zones (mesures sans tracé) : surlignage translucide au focus. */
.fit-zone{fill:var(--accent);opacity:0;transition:opacity .18s}
.fit-zone.is-on{opacity:.16}
/* Formulaire groupé */
.fit-form .fit-group{border:1px solid var(--line);border-radius:12px;padding:10px 14px 4px;margin:0 0 14px}
.fit-form legend{font-weight:800;padding:0 6px;font-size:.95rem}
.fit-field{margin:0 0 12px;border-radius:8px;padding:4px 6px;transition:background .15s}
.fit-field.is-focus{background:rgba(255,210,30,.10)}
.fit-field label{display:block;font-weight:600;font-size:.9rem;margin:0 0 3px}
.fit-field .fit-unit{color:var(--muted);font-weight:400}
.fit-field input,.fit-field textarea{width:100%}
.fit-howto{font-size:.76rem;color:var(--muted);margin:3px 0 0;line-height:1.35}
.fit-field.has-error input{border-color:var(--red)}
.fit-err{color:var(--red);font-size:.78rem;margin:3px 0 0}
/* Récap (mode lecture) */
.fit-recap-group{margin:0 0 10px}
.fit-recap-title{font-weight:800;font-size:.85rem;margin:0 0 2px}
.fit-recap-row{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:3px 0;font-size:.9rem}
.fit-recap-row span{color:var(--muted)}
.fit-num{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 4px;border-radius:999px;background:#e8463c;color:#fff;font-size:.72rem;font-weight:800;vertical-align:middle}
@media (max-width:720px){
  .fit-layout,.fit-layout-read{grid-template-columns:1fr}
  .fit-figure-wrap{position:static}
  .fit-svg{max-width:420px;margin:0 auto}
}

/* Classements — en-têtes de piste (perso / sorties club / engagement) */
.piste-h{margin:22px 0 4px;font-size:1.08rem;font-weight:800;padding-bottom:5px;border-bottom:2px solid var(--accent)}
.piste-h:first-of-type{margin-top:4px}
.eng-detail{font-size:.82rem;color:var(--muted);font-variant-numeric:tabular-nums}

/* ===== Page Trophées refondue (onglets + sélecteurs) ===== */
.trk-tabs button{padding:8px 15px;border-radius:var(--radius-pill);background:var(--surface);
  border:1px solid var(--line-2);font-weight:700;color:var(--muted);cursor:pointer;font-size:.92rem}
.trk-tabs button:hover{border-color:var(--yellow-dark);color:var(--ink)}
.trk-tabs button.is-active{background:var(--yellow);border-color:var(--yellow);color:#1b1d22}
.tab-panel{display:none}
.tab-panel.is-active{display:block;animation:trkfade .18s ease}
@keyframes trkfade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
/* Sélecteur segmenté (Sport / Sorties club / Engagement ; Carrière / Saison) */
.seg{display:inline-flex;flex-wrap:wrap;gap:4px;padding:4px;border-radius:12px;background:var(--bg);
  border:1px solid var(--line);margin:0 0 14px}
.seg button{padding:7px 14px;border:0;border-radius:9px;background:transparent;color:var(--muted);
  font-weight:700;cursor:pointer;font-size:.9rem}
.seg button.is-active{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(20,20,20,.12)}
.seg-sub{margin-bottom:12px}
.seg-sub button.is-active{background:var(--yellow);color:#1b1d22;box-shadow:none}
.seg-panel{display:none}
.seg-panel.is-active{display:block}
/* Cartes du panneau « Moi » */
.trk-two{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}
.trk-card-h{font-weight:800;margin:0 0 8px}
.eng-score{font-family:var(--font-head);font-size:1.1rem}
.eng-score b{font-size:1.9rem}
.eng-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.eng-chip{font-size:.82rem;font-weight:700;background:var(--bg);border:1px solid var(--line);
  border-radius:999px;padding:3px 10px}
@media (max-width:640px){.trk-two{grid-template-columns:1fr}}

/* ===== Page Carnet refondue ===== */
.carnet-strip{display:flex;flex-wrap:wrap;padding:14px 6px;margin-bottom:16px}
.cs-item{flex:1 1 120px;text-align:center;padding:4px 12px;border-right:1px solid var(--line)}
.cs-item:last-child{border-right:0}
.cs-v{display:block;font-family:var(--font-head);font-weight:800;font-size:1.55rem;line-height:1.1}
.cs-v small{font-size:.8rem;font-weight:700;margin-left:2px}
.cs-l{display:block;font-size:.76rem;color:var(--muted);margin-top:3px}
@media (max-width:680px){.cs-item{flex-basis:33%;border-right:0;padding:8px 4px}}
/* Menu déroulant Importer/Exporter (<details>) */
.dropdown{position:relative;display:inline-block}
.dropdown>summary{list-style:none;cursor:pointer}
.dropdown>summary::-webkit-details-marker{display:none}
.dropdown-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:30;background:var(--surface);
  border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 30px rgba(20,20,20,.18);
  padding:6px;min-width:215px;display:flex;flex-direction:column;gap:2px}
.dropdown-menu a,.dropdown-menu button{display:block;width:100%;text-align:left;padding:9px 12px;
  border:0;background:transparent;border-radius:8px;font-size:.9rem;font-weight:600;color:var(--ink);cursor:pointer}
.dropdown-menu a:hover,.dropdown-menu button:hover{background:var(--bg)}
