/* =========================================================================
   /RAM — design system néo-brutaliste (socle commun /Buvette et /Dojo)
   Source : fichier Figma « RAM — Composants néo-brutalistes » (pages Jetons et Composants).
   Plan : Documents/Padel JA/plan-refonte-style.md.

   Règles de cette feuille :
   - une seule définition par composant ; classes préfixées « r- » ;
   - aucune couleur écrite hors des jetons ; aucun !important ;
   - les couleurs du club (app/2-couleurs.js, setTheme) remplacent les jetons --c-* au chargement.
   Ordre : 1. jetons · 2. base · 3. composants · 4. mises en page
   ========================================================================= */

/* ---------- 1. JETONS ---------- */
:root {
  /* couleurs : jour (base neutre de /Buvette) */
  --c-bg: var(--bg, #F1ECE3);
  --c-surface: var(--card, #FFFCF7);
  --c-surface-2: var(--card2, #F6F1E8);
  --c-field: var(--field, #F6F1E8);
  --c-ink: var(--ink, #16191E);
  --c-text: var(--fg, #16191E);
  --c-muted: var(--muted, #5B606B);
  --c-off: var(--off, #E3DDD2);
  --c-kick: var(--kick, #B0123F);
  --c-accent: var(--accent-bg, #E0F50A);
  --c-on-accent: var(--on-accent-bg, #16191E);
  --c-hero: var(--hero, #74102A);
  --c-on-hero: var(--on-hero, #FFFFFF);
  --c-hero-sh: var(--hero-sh, #E0F50A);
  --c-menu: var(--menu, #74102A);
  --c-menu-2: var(--menu2, #4A0A1B);
  --c-on-menu: var(--on-menu, #FFFFFF);
  --c-menu-act: var(--menu-act, #E0F50A);
  --c-on-menu-act: var(--on-menu-act, #16191E);
  /* couleurs fixes de la palette /RAM */
  --c-lime: #E0F50A;
  --c-pink: #FF3D6B;
  --c-green: #9BD43C;
  --c-orange: #F2A93B;
  --c-dark: #1A0509;
  --c-bordeaux: #8E1838;
  /* traits, ombres, coins */
  --bw: 2px;
  --sh: 4px 4px 0 var(--c-ink);
  --sh-sm: 2px 2px 0 var(--c-ink);
  --sh-hero: 6px 6px 0 var(--c-hero-sh);
  --rad: 0px;
  --rad-sm: 0px;
  --rad-pill: 0px;
  /* typographies */
  --f-display: Anton, 'Arial Narrow', Impact, sans-serif;
  --f-label: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Work Sans', system-ui, sans-serif;
  /* espacements */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 22px; --s6: 28px;
}
:root[data-coins='arrondis'] { --rad: 12px; --rad-sm: 8px; --rad-pill: 999px; }
/* nuit : bordeaux validé (sans teinte du club) — appliqué par setTheme dans l'appli, par data-mode dans le catalogue */
:root[data-mode='nuit'] {
  --bg: #2A1B21; --card: #46303A; --card2: #533A45; --field: #33222A;
  --ink: #000000; --fg: #F7EFF0; --muted: #DCCBD0; --off: #5C4450; --kick: #FF6B8E;
  --hero: #74102A; --on-hero: #FFFFFF;
}

/* ---------- 2. BASE ---------- */
.r-app { background: var(--c-bg); color: var(--c-text); font: 15px/1.45 var(--f-body); }
.r-surtitre { display: block; font: 700 12px/1.2 var(--f-label); letter-spacing: .24em; text-transform: uppercase; color: var(--c-kick); }
.r-titre { font: 400 34px/1.02 var(--f-display); letter-spacing: .01em; text-transform: uppercase; margin: 0; }
.r-sous-titre { font: 700 22px/1.1 var(--f-label); margin: 0; }
.r-etiquette { font: 700 13px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; }
.r-petit { font-size: 13px; line-height: 1.4; color: var(--c-muted); }
.r-chiffre { font: 400 40px/1 var(--f-display); }

/* ---------- 3. COMPOSANTS ---------- */
/* Bouton : principal (accent), secondaire (surface ; couleur fond dans une carte), danger, icône */
.r-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 12px 20px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm);
  background: var(--c-accent); color: var(--c-on-accent); box-shadow: var(--sh);
  font: 700 17px/1.1 var(--f-label); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.r-btn svg { width: 20px; height: 20px; flex: none; }
.r-btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.r-btn:disabled { background: var(--c-off); color: var(--c-muted); border-color: var(--c-muted); box-shadow: none; cursor: default; }
.r-btn--sec { background: var(--c-surface); color: var(--c-text); }
.r-card .r-btn--sec, .r-sheet .r-btn--sec { background: var(--c-bg); }
.r-btn--danger { background: var(--c-pink); color: var(--c-dark); }
.r-btn--sm { min-height: 40px; padding: 8px 14px; font-size: 15px; box-shadow: var(--sh-sm); }
.r-btn--full { width: 100%; }
.r-ib {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0;
  border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); background: var(--c-surface); color: var(--c-text);
  box-shadow: var(--sh-sm); cursor: pointer;
}
.r-card .r-ib { background: var(--c-bg); }
.r-ib svg { width: 22px; height: 22px; }
.r-ib--accent { background: var(--c-accent); color: var(--c-on-accent); }

/* Carte : surface, trait, ombre ; titre intégré (picto + titre, actions à droite) */
.r-card { background: var(--c-surface); color: var(--c-text); border: var(--bw) solid var(--c-ink); border-radius: var(--rad); box-shadow: var(--sh); padding: var(--s5); }
.r-card--flush { padding: 0; }
.r-card__head { display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s3); }
.r-card__head > svg { width: 20px; height: 20px; flex: none; color: var(--c-kick); }
.r-card__head > b { flex: 1; min-width: 0; font: 700 19px/1.15 var(--f-label); }
.r-card .r-card, .r-card .r-box { background: var(--c-surface-2); box-shadow: none; }
/* boîte intérieure à une carte : ton sur ton, trait encre */
.r-box { background: var(--c-surface-2); border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); padding: var(--s3); }
/* carte héros : couleur du club, ombre d'accent */
.r-hero { background: var(--c-hero); color: var(--c-on-hero); border: var(--bw) solid var(--c-ink); border-radius: var(--rad); box-shadow: var(--sh-hero); padding: 24px; display: flex; flex-direction: column; gap: var(--s3); }
.r-hero .r-surtitre { color: inherit; opacity: .8; }

/* Champ : étiquette, boîte (fond « champ »), aide ; focus = ombre citron ; erreur = trait rose */
.r-field { display: flex; flex-direction: column; gap: 6px; }
.r-field > label { font: 700 13px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; }
.r-input, .r-select, .r-textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm);
  background: var(--c-surface); color: var(--c-text); font: 400 15px var(--f-body); box-sizing: border-box;
}
:is(.r-card, .r-sheet, .r-hero) :is(.r-input, .r-select, .r-textarea) { background: var(--c-surface-2); }
.r-textarea { min-height: 96px; padding: 12px 14px; resize: vertical; }
.r-select { appearance: none; padding-right: 44px; }
.r-selectw { position: relative; display: block; }
.r-selectw::after { content: ''; position: absolute; right: 12px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); pointer-events: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; color: var(--c-text); }
.r-input:focus, .r-select:focus, .r-textarea:focus { outline: none; background-color: var(--c-surface); box-shadow: 4px 4px 0 var(--c-lime); }
.r-input::placeholder, .r-textarea::placeholder { color: var(--c-muted); opacity: 1; }
.r-field--err .r-input, .r-field--err .r-select { border: 3px solid var(--c-pink); }
.r-field__aide { font-size: 13px; color: var(--c-muted); }
.r-field__err { align-self: flex-start; padding: 3px 8px; background: var(--c-pink); color: var(--c-dark); font-size: 13px; }

/* Interrupteur 52 × 30 et case à cocher 26 */
.r-switch { position: relative; flex: none; width: 52px; height: 30px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--c-off); cursor: pointer; padding: 0; }
.r-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; box-sizing: border-box; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--c-surface); transition: transform .2s; }
.r-switch[aria-checked='true'] { background: var(--c-green); }
.r-switch[aria-checked='true']::after { transform: translateX(22px); }
.r-check { appearance: none; flex: none; width: 26px; height: 26px; margin: 0; vertical-align: middle; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); background: var(--c-surface); display: inline-grid; place-items: center; cursor: pointer; }
.r-check:checked { background: var(--c-lime); box-shadow: var(--sh-sm); }
.r-check:checked::after { content: ''; width: 7px; height: 13px; border: solid var(--c-dark); border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }

/* Pastilles : état (direct, terminé, info), sport, nombre */
.r-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--c-bg); color: var(--c-text); box-shadow: var(--sh-sm); font: 700 13px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.r-card .r-tag { background: var(--c-surface-2); }
.r-tag--live { background: var(--c-pink); color: var(--c-dark); }
.r-tag--live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c-dark); }
.r-tag--ok, .r-tag--padel { background: var(--c-green); color: var(--c-dark); }
.r-tag--accent, .r-tag--tennis { background: var(--c-lime); color: var(--c-dark); }
.r-tag--hot { background: var(--c-pink); color: var(--c-dark); }
.r-tag--flat { box-shadow: none; }
.r-count { display: inline-grid; place-items: center; min-width: 0; padding: 1px 6px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--c-pink); color: var(--c-dark); font: 700 12px/1.3 var(--f-label); flex: none; }
.r-dot { width: 12px; height: 12px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--c-pink); flex: none; }

/* Avatar : initiales sur couleur, ou photo ; cadre de niveau en ombre de sa couleur */
.r-av { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--c-lime) center / cover no-repeat; color: var(--c-dark); box-shadow: var(--sh-sm); font: 700 22px var(--f-label); text-transform: uppercase; overflow: hidden; }
.r-av--sm { width: 34px; height: 34px; font-size: 13px; }
.r-av--lg { width: 84px; height: 84px; font-size: 30px; }
.r-av--pink { background-color: var(--c-pink); }
.r-av--green { background-color: var(--c-green); }
.r-av[style*='url('] { background-color: var(--c-surface); color: transparent; }
.r-av[class*='r-av--n-'] { box-shadow: 0 0 0 5px var(--lvl), 0 0 0 7px var(--c-ink), 9px 9px 0 2px var(--c-ink); margin: 7px; }
.r-av--n-bronze { --lvl: #C8834B; }
.r-av--n-argent { --lvl: #DDE3EA; }
.r-av--n-or { --lvl: #F2C230; }
.r-av--n-platine { --lvl: #7FE3D8; }
.r-av--n-legende { --lvl: #6FB7FF; }

/* Liste dans une carte : lignes séparées par un trait, ligne cliquable sans boîte */
.r-list { display: flex; flex-direction: column; }
.r-row { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s2) 0; width: 100%; background: none; border: 0; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.r-row + .r-row { border-top: var(--bw) solid color-mix(in srgb, var(--c-ink) 12%, transparent); }
.r-row__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.r-row__txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-row__txt small { font-size: 13px; color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-row__ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); background: var(--c-lime); color: var(--c-dark); box-shadow: var(--sh-sm); }
.r-row__ic svg { width: 20px; height: 20px; }
.r-list > .r-row { padding-left: 10px; padding-right: 10px; }
.r-row[aria-current='true'] { background: var(--c-surface-2); outline: var(--bw) solid var(--c-ink); outline-offset: -2px; }

/* Onglets segmentés : barre encadrée, choix actif accent */
.r-tabs { display: inline-flex; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); background: var(--c-surface); box-shadow: var(--sh); overflow: hidden; max-width: 100%; }
.r-tabs > button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 0; border-left: var(--bw) solid var(--c-ink); background: transparent; color: var(--c-text); font: 700 17px/1.1 var(--f-label); letter-spacing: .02em; cursor: pointer; white-space: nowrap; }
.r-tabs > button:first-child { border-left: 0; }
.r-tabs > button[aria-selected='true'], .r-tabs > button[aria-pressed='true'] { background: var(--c-accent); color: var(--c-on-accent); }
.r-tabs--full { display: flex; }
.r-tabs--full > button { flex: 1; justify-content: center; }

/* Jauge 14 px : piste encadrée, remplissage citron (ou vert) */
.r-gauge { display: block; height: 14px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--c-surface); overflow: hidden; }
.r-gauge > i { display: block; height: 100%; background: var(--c-lime); }
.r-gauge--green > i { background: var(--c-green); }

/* Compteur : libellé, chiffre Anton, détail ; picto sur carré citron */
.r-stat { display: flex; justify-content: space-between; gap: var(--s3); background: var(--c-surface); border: var(--bw) solid var(--c-ink); border-radius: var(--rad); box-shadow: var(--sh); padding: var(--s4) 18px; }
.r-stat__lab { display: block; font: 700 13px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.r-stat__num { display: block; font: 400 40px/1 var(--f-display); }
.r-stat__det { display: block; font-size: 13px; color: var(--c-muted); }
.r-stat__ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: var(--bw) solid var(--c-ink); background: var(--c-lime); color: var(--c-dark); }
.r-stat__ic svg { width: 22px; height: 22px; }

/* État vide : centré, sans cadre (la carte qui le contient est encadrée) */
.r-empty { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: 28px var(--s4); text-align: center; color: var(--c-muted); }
.r-empty svg { width: 28px; height: 28px; color: var(--c-kick); }
.r-empty b { color: var(--c-text); font: 700 17px var(--f-label); }

/* Alerte et message flottant : fond plein, texte foncé */
.r-alert { display: flex; align-items: center; gap: var(--s3); padding: 12px 14px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); box-shadow: var(--sh); background: var(--c-green); color: var(--c-dark); }
.r-alert--warn { background: var(--c-lime); }
.r-alert--err { background: var(--c-pink); }
.r-alert svg { width: 24px; height: 24px; flex: none; }

/* Titre de section (hors carte) : barre surface, repère citron, bouton d'ajout carré */
.r-section { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; background: var(--c-surface); border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); margin: var(--s5) 0 var(--s3); }
.r-section::before { content: ''; width: 6px; height: 22px; flex: none; background: var(--c-lime); border: var(--bw) solid var(--c-ink); }
.r-section > span { flex: 1; font: 700 13px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; }

/* Fenêtre du bas (téléphone) et volet (grand écran) */
.r-sheet { background: var(--c-surface); color: var(--c-text); border: var(--bw) solid var(--c-ink); border-bottom: 0; border-radius: var(--rad) var(--rad) 0 0; box-shadow: 0 -4px 0 var(--c-ink); padding: var(--s5); }


/* Liste déroulante ouverte : même largeur que son champ, options de 44 px, choix en citron avec coche */
/* champ dont la liste est ouverte : ombre 4 px, chevron vers le haut */
.r-selectw.is-open .r-select { box-shadow: var(--sh); }
.r-selectw.is-open::after { transform: translateY(-50%) rotate(180deg); }
.r-menu { display: flex; flex-direction: column; margin-top: 4px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); background: var(--c-surface); box-shadow: var(--sh); overflow: hidden; }
.r-menu > button { display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--c-text); font: 400 15px var(--f-body); text-align: left; cursor: pointer; }
.r-menu > button + button { border-top: var(--bw) solid color-mix(in srgb, var(--c-ink) 12%, transparent); }
.r-menu > button[aria-selected='true'] { background: var(--c-lime); color: var(--c-dark); font-weight: 600; }
.r-menu > button[aria-selected='true']::after { content: ''; margin-left: auto; width: 7px; height: 13px; border: solid currentColor; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
/* États de démonstration (catalogue) : focus et appuyé, identiques aux états réels */
.r-btn.is-pressed { transform: translate(2px, 2px); box-shadow: none; }
.r-input.is-focus { outline: none; background-color: var(--c-surface); box-shadow: 4px 4px 0 var(--c-lime); }
.r-btn:focus-visible, .r-ib:focus-visible, .r-tabs > button:focus-visible, .r-row:focus-visible { outline: 3px solid var(--c-pink); outline-offset: 2px; }
.r-btn.is-focus { outline: 3px solid var(--c-pink); outline-offset: 2px; }
/* Héros : rangée de chiffres */
.r-hero__stats { display: flex; flex-wrap: wrap; gap: 28px; }
.r-hero__stats b { display: block; font: 700 22px/1.1 var(--f-label); }
.r-hero__stats span { display: block; font-size: 13px; opacity: .75; }
/* Carte de publication : auteur, affiche encadrée, texte, réactions */
.r-post { background: var(--c-surface); border: var(--bw) solid var(--c-ink); border-radius: var(--rad); box-shadow: var(--sh); padding: 14px; display: flex; flex-direction: column; gap: var(--s3); }
.r-post__who { display: flex; align-items: center; gap: 10px; }
.r-post__who b { display: block; font-weight: 600; }
.r-post__who small { display: block; font-size: 13px; color: var(--c-muted); }
.r-post__who .r-tag { margin-left: auto; }
.r-poster { background: var(--c-lime); color: var(--c-dark); border: var(--bw) solid var(--c-ink); border-radius: var(--rad-sm); padding: 14px; min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s2); }
.r-poster h3 { font: 400 34px/1.02 var(--f-display); text-transform: uppercase; margin: 0; }
.r-post__acts { display: flex; gap: var(--s2); flex-wrap: wrap; padding-top: var(--s2); border-top: var(--bw) solid color-mix(in srgb, var(--c-ink) 12%, transparent); }

/* Intercalaires (Figma « Intercalaire (.ps-itabs) ») : 2 à 5 onglets collés au-dessus d'une carte, sans espace.
   Actif : fond surface, 39 px, se fond dans la carte ; inactif : surface 2, 35 px, texte gris. Bord 2 px encre. */
.r-itabs { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 6px; padding-left: var(--s3); margin-bottom: calc(-1 * var(--bw)); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.r-itabs > button, .r-itabs > a { flex: none; display: inline-flex; align-items: center; gap: var(--s2); min-height: 35px; padding: 0 14px; border: var(--bw) solid var(--c-ink); border-bottom: 0; border-radius: var(--rad-sm) var(--rad-sm) 0 0; background: var(--c-surface-2); color: var(--c-muted); font: 700 14px/1.1 var(--f-label); letter-spacing: .02em; text-decoration: none; white-space: nowrap; cursor: pointer; }
.r-itabs > [aria-selected='true'], .r-itabs > [aria-current] { min-height: 39px; padding-bottom: var(--bw); background: var(--c-surface); color: var(--c-text); }
.r-itabs.plus-d { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.r-itabs.plus-g { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
.r-itabs.plus-g.plus-d { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
.r-itabs > :focus-visible { outline: 3px solid var(--c-pink); outline-offset: 2px; }
/* Pastille de compte : nombre court (paires, rang). Bordeaux par défaut, --rose pour le premier ou une tête de série, --citron pour « Fidèle » */
.r-pastille { display: inline-flex; align-items: center; flex: none; padding: 2px 7px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--c-bordeaux); color: #FFFFFF; font: 700 12px/1.2 var(--f-label); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.r-pastille--rose { background: var(--c-pink); color: var(--c-dark); }
.r-pastille--citron { background: var(--c-lime); color: var(--c-dark); }
:root[data-mode='nuit'] .r-pastille:not(.r-pastille--rose):not(.r-pastille--citron) { background: var(--c-menu-2); }

/* ---------- Navigation à deux niveaux ---------- */
/* en-tête de page : surtitre, grand titre, actions à droite */
.r-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s5) var(--s6) var(--s2); }
@media (max-width: 700px) { .r-head { padding: var(--s4) var(--s4) var(--s2); } .r-head__t h1 { font-size: 30px; } .r-head__act { flex-wrap: wrap; } }
.r-head__t { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.r-head__t h1 { font: 400 48px/1 var(--f-display); text-transform: uppercase; margin: 0; }
.r-head__act { display: flex; align-items: center; gap: 10px; flex: none; }
/* menu principal (colonne) et sous-menu (colonne plus sombre) */
.r-rail { background: var(--c-menu); color: var(--c-on-menu); border-right: var(--bw) solid var(--c-ink); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s4) 0; }
.r-rail__it { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 74px; min-height: 56px; border: var(--bw) solid transparent; border-radius: var(--rad-sm); background: transparent; color: inherit; font: 700 12px/1.1 var(--f-label); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; position: relative; }
.r-rail__it svg { width: 22px; height: 22px; }
.r-rail__it[aria-current='page'] { background: var(--c-menu-act); color: var(--c-on-menu-act); border-color: var(--c-ink); box-shadow: var(--sh-sm); }
.r-rail__it .r-count { position: absolute; top: 2px; right: 8px; }
.r-sub { background: var(--c-menu-2); color: var(--c-on-menu); border-right: var(--bw) solid var(--c-ink); display: flex; flex-direction: column; gap: 6px; padding: var(--s4) var(--s3); }
.r-sub__head { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding-bottom: var(--s4); }
.r-sub__head .r-surtitre { grid-column: 1; color: inherit; opacity: .8; }
.r-sub__head > b { grid-column: 1; }
.r-sub__head > .r-ib { grid-column: 2; grid-row: 1 / span 2; }
.r-sub__head b { font: 400 28px/1 var(--f-display); text-transform: uppercase; }
.r-sub__it { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 12px; border: var(--bw) solid transparent; border-radius: var(--rad-sm); background: transparent; color: inherit; font: 700 17px/1.1 var(--f-label); text-align: left; cursor: pointer; }
.r-sub__it svg { width: 20px; height: 20px; flex: none; }
.r-sub__it .r-count { margin-left: auto; }
.r-sub__it[aria-selected='true'] { background: var(--c-menu-act); color: var(--c-on-menu-act); border-color: var(--c-ink); box-shadow: var(--sh-sm); }
/* téléphone : barre du bas et bande de sous-menu */
.r-bottom { display: flex; gap: 2px; padding: var(--s2) 6px calc(var(--s2) + env(safe-area-inset-bottom, 0px)); background: var(--c-menu); border-top: var(--bw) solid var(--c-ink); }
.r-bottom .r-rail__it { flex: 1; width: auto; }
.r-bottom, .r-strip { color: var(--c-on-menu); }
.r-strip { display: flex; gap: 6px; padding: 10px 12px; background: var(--c-menu-2); border-top: var(--bw) solid var(--c-ink); border-bottom: var(--bw) solid var(--c-ink); overflow-x: auto; }
.r-strip .r-sub__it { flex: none; flex-direction: column; gap: 4px; min-height: 52px; padding: 6px 10px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- 4. MISES EN PAGE ---------- */
.r-stack { display: flex; flex-direction: column; gap: var(--s4); }
.r-row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.r-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.r-bento { display: grid; grid-template-columns: 1fr; gap: var(--s5); }
@media (min-width: 1024px) {
  .r-bento { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); align-items: start; }
  .r-bento__side { position: sticky; top: var(--s2); display: flex; flex-direction: column; gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { .r-btn, .r-switch::after { transition: none; } }

/* ---------- Interrupteur (switch) : un seul dessin pour /Buvette et /Dojo (button.tg, role="switch") ----------
   Bouton de 20 px dans une piste de 52 x 30 px (bordure de 2 px comprise), centré en hauteur, 3 px de marge intérieure des deux côtés
   (5 px depuis le bord extérieur de la piste), déplacement exact de 22 px : jamais de débordement sur la bordure.
   box-sizing explicite sur les pseudo-éléments (« * » ne les couvre pas : le bouton faisait 24 px et débordait de 1 px sur iOS),
   et apparence native du bouton retirée (Safari). Piste éteinte : mi-chemin entre le texte et la carte, au moins 3:1 jour et nuit. */
.tg { -webkit-appearance: none; appearance: none; box-sizing: border-box; display: block; position: relative; flex: none; width: 52px; height: 44px; margin: 0; padding: 0; border: 0; background: none; color: inherit; font-size: 0; cursor: pointer; }
.tg::before, .tg::after { content: ''; position: absolute; box-sizing: border-box; }
.tg::before { left: 0; top: 7px; width: 52px; height: 30px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: color-mix(in srgb, var(--c-text) 50%, var(--c-surface)); transition: background .2s; }
.tg::after { left: 5px; top: 12px; width: 20px; height: 20px; border: var(--bw) solid var(--c-ink); border-radius: var(--rad-pill); background: var(--b-creme, #F7EFF0); transition: transform .2s ease; }
.tg[aria-checked='true']::before { background: var(--c-green); }
.tg[aria-checked='true']::after { transform: translateX(22px); }
.tg:focus-visible { outline: 3px solid var(--c-pink); outline-offset: 2px; }

/* ---------- Téléphone : gouttière commune et intercalaires de classeur (toutes les bandes d'onglets des trois applis) ----------
   --gut : l'écart entre le bord de l'écran et les cartes, l'en-tête et les intercalaires (10 px sur téléphone, inchangé ailleurs).
   Toute bande d'onglets sous l'en-tête (#main > .seg) prend le dessin des intercalaires de l'ordinateur : onglet actif à liseré citron,
   compteur dans l'onglet, collé au haut de la carte qui suit (aucun espace ni liseré), défilement horizontal avec fondu (segHint). */
:root { --gut: 16px; }
@media (max-width: 700px) {
  :root { --gut: 10px; }
  :root:root #main > .pad { padding-left: var(--gut); padding-right: var(--gut); }
  :root:root #phone .top { padding-left: max(var(--gut), env(safe-area-inset-left, 0px)) !important; padding-right: max(var(--gut), env(safe-area-inset-right, 0px)) !important; }
}
@media (max-width: 1023px) {
  :root:root #main > .seg.seg { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: flex-end; gap: 6px; width: auto; max-width: none; min-width: 0; margin: 0 var(--gut) -2px; padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; position: relative; top: auto; z-index: 2; }
  :root:root #main > .seg.seg::-webkit-scrollbar { display: none; }
  :root:root #main > .seg.seg > button { flex: none; width: auto; min-width: 0; min-height: 44px; padding: 0 16px; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; background: var(--c-bg); color: var(--c-text); border: var(--bw) solid var(--c-ink); border-bottom: 0; border-radius: 0; box-shadow: none; transform: none; font: 700 16px/1.1 var(--f-label); letter-spacing: .02em; text-transform: none; }
  :root:root #main > .seg.seg > button::before { display: none; }
  :root:root #main > .seg.seg > button .lb { display: inline; font: inherit; }
  :root:root #main > .seg.seg > button svg { width: 20px; height: 20px; flex: none; color: var(--c-muted); }
  :root:root #main > .seg.seg > button[aria-selected='true'] { background: var(--card, var(--c-surface)); color: var(--c-text); box-shadow: inset 0 4px 0 var(--c-lime); padding-bottom: 2px; }
  :root:root #main > .seg.seg > button[aria-selected='true'] svg { color: var(--c-ico, var(--c-text)); }
  :root:root #main > .seg.seg > button .cnt { position: static; margin: 0 0 0 2px; min-width: 0; height: auto; padding: 1px 6px; border: var(--bw) solid var(--c-ink); border-radius: 0; background: var(--c-pink); color: var(--c-dark); font: 700 13px/1.2 var(--f-label); }
  /* la carte qui suit : collée à la bande (plus de marge ni de remplissage au-dessus) */
  :root:root #main > .seg.seg + * { margin-top: 0; }
  :root:root #main > .seg.seg + .pad, :root:root #main > .seg.seg + .pad.pad { padding-top: 0; margin: 0; }
  :root:root #main > .seg.seg + .pad > :first-child { margin-top: 0; }
  :root:root #phone #main > .seg.seg + .lis { margin: 0 var(--gut) 12px; }
  /* page qui commence par des chiffres, des filtres ou un bouton (pas par une carte) : un peu d'air sous l'onglet */
  :root:root #main > .seg.seg + .pad > :first-child:not(.card):not(.cobento):not(.u2fiche) { margin-top: 12px; }
}

/* ---------- Objectifs et compétences (fiche élève et fiche de groupe de /Dojo, École > Mon espace de /Buvette) ---------- */
.obj-card { display: flex; flex-direction: column; gap: 4px; }
.obj { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--c-ink) 16%, transparent); }
.obj:first-of-type, .objlibre + .obj { border-top: 0; }
.objh { display: flex; align-items: center; gap: 10px; }
.objh b { flex: 1; min-width: 0; font: 700 19px/1.15 var(--f-label); overflow-wrap: anywhere; }
.objp { flex: none; font: 700 16px var(--f-label); color: var(--c-muted); white-space: nowrap; }
.objb { display: block; height: 12px; border: var(--bw) solid var(--c-ink); background: var(--c-bg); }
.objb i { display: block; height: 100%; background: var(--c-green); transition: width .25s; }
.objl { display: flex; flex-direction: column; gap: 6px; }
.objc { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 10px; border: var(--bw) solid var(--c-ink); background: var(--c-surface-2); color: var(--c-text); text-align: left; font: inherit; cursor: pointer; }
.objc.ro { cursor: default; }
.objk { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: var(--bw) solid var(--c-ink); background: var(--c-surface); color: var(--c-dark); }
.objk svg { width: 18px; height: 18px; opacity: 0; }
.objc.on .objk { background: var(--c-green); }
.objc.on .objk svg { opacity: 1; }
.objc.on { background: color-mix(in srgb, var(--c-green) 18%, var(--c-surface-2)); }
.objt { align-self: flex-start; }
.objlibre { margin: 0 0 6px; color: var(--c-muted); }
.objr { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: var(--bw) solid var(--c-ink); background: var(--c-surface-2); }
.objn { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 600; }
.objn small { color: var(--c-muted); font: 700 14px var(--f-label); }
.objg { display: flex; flex-wrap: wrap; gap: 6px; }
.objs { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px 0 6px; border: var(--bw) solid var(--c-ink); background: var(--c-surface); color: var(--c-text); font: 700 14px var(--f-label); cursor: pointer; }
.objs i { display: grid; place-items: center; width: 18px; height: 18px; border: var(--bw) solid var(--c-ink); background: var(--c-bg); }
.objs i svg { width: 12px; height: 12px; opacity: 0; color: var(--c-dark); }
.objs.on { background: color-mix(in srgb, var(--c-green) 28%, var(--c-surface)); }
.objs.on i { background: var(--c-green); }
.objs.on i svg { opacity: 1; }
.objer { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.objer input { flex: 1; min-width: 0; }
.objmv { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }

/* ---------- Sur-titres et titres d'étiquette : jamais de fond coloré ni d'inclinaison, lisibles jour et nuit ----------
   (demande de Baptiste : un texte rose clair sur un bandeau rose surligné était illisible). Le style « street » ne les surligne plus. */
:root :is(.kicker, .coey, .segt span, .top h1 .sub, .cohd > span, .evl.cotheme) { background: none !important; transform: none !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; width: auto !important; }
:root :is(.kicker, .coey, .segt span, .top h1 .sub) { color: color-mix(in srgb, var(--c-kick) 78%, var(--c-text)) !important; opacity: 1 !important; }
:root :is(.cohero, .hero-t, .r-hero) :is(.kicker, .coey) { color: var(--c-on-hero) !important; opacity: .85 !important; }
:root :is(.poster, .promo-w, .card.setup) :is(.kicker, .coey) { color: var(--c-on-accent) !important; }
:root :is(.cohd > span, .evl.cotheme, .evl.cotheme svg) { color: inherit !important; }
:root :is(.kicker, .coey, .cohd > span) svg { color: currentColor !important; }

/* intercalaires : jamais de fondu ni de voile sur le bord (même quand une rangée défile : elle est alors coupée net) ;
   les pastilles de filtre (.chips) gardent leur comportement */
.seg, .seg.plus-d, .seg.plus-g, .seg.plus-g.plus-d, #main > .seg:not(.haut), #main > .seg:not(.haut).plus-d, #main > .seg:not(.haut).plus-g, #main > .seg:not(.haut).plus-g.plus-d,
.r-itabs, .r-itabs.plus-d, .r-itabs.plus-g, .r-itabs.plus-g.plus-d { -webkit-mask-image: none !important; mask-image: none !important; }
