/* CFT-2287 : Mes castings et la feuille des préférences.
 *
 * La page porte `.cfc` et `.cfh` : la typographie, le fond, le bandeau et les boutons viennent
 * de castings.css, refonte.css et styles.css, inchangés. Ici, seulement ce que cette page a en
 * propre, sous le préfixe `mc-`.
 *
 * LES CARTES NE SONT PAS ICI. Un casting se dessine avec `hubCardHtml` et les règles `.cfk-*` de
 * castings.css : la grille `.cfh-cartes` (1, 2 puis 3 colonnes) est reprise telle quelle, donc une
 * carte de Mes castings a exactement la taille et le dessin de la même carte sur le hub. Le
 * billet l'interdit autrement.
 *
 * RIEN NE DÉBORDE. Toutes les largeurs sont en `min()` ou en `1fr`, la feuille se replie en une
 * colonne et les fenêtres se bornent à la fenêtre du navigateur moins 24 px. Mesuré par
 * server/debordement.selftest.js à 320, 360, 390 et 430 px.
 */

.mc{--mc-encre:#0b0b0b; --mc-gris:#6b747c; --mc-filet:rgba(0,0,0,.09); --mc-teal:#007692;
  --mc-teal-clair:#d8eef3; --mc-fond:#f1f3f4}
.mc .rf-section__in{min-width:0}
/* `hidden` doit gagner contre `display:flex` : sans cette ligne, une pastille ou une ligne
   cachée par le script reste visible (même piège que sur le reste du site). */
.mc [hidden]{display:none !important}

/* ── Le titre et la pastille ─────────────────────────────────────────────── */
.mc-h1{display:flex; align-items:center; flex-wrap:wrap; gap:12px}
.mc-badge{display:inline-flex; align-items:center; height:26px; padding:0 12px; border-radius:999px;
  background:var(--mc-teal-clair); color:var(--mc-teal); font-size:13px; font-weight:600;
  letter-spacing:-.01em; line-height:1; white-space:nowrap}
.mc-badge[data-mc-niveau="free"]{background:#e8ecee; color:#3f4750}

/* ── La barre des préférences ────────────────────────────────────────────── */
.mc-prefs{margin-top:20px}
.mc-barre{display:flex; align-items:center; gap:14px 18px; flex-wrap:wrap;
  padding:14px 16px 14px 22px; background:#fff; border-radius:22px}
.mc-barre__titre{font-size:15px; font-weight:600; letter-spacing:-.01em; white-space:nowrap}
.mc-barre__puces{list-style:none; display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin:0; padding:0; min-width:0; flex:1 1 260px}
.mc-barre__puce{display:inline-flex; align-items:center; height:28px; padding:0 12px; border-radius:999px;
  background:var(--mc-teal-clair); color:var(--mc-teal); font-size:13px; font-weight:500;
  white-space:nowrap; max-width:100%; overflow:hidden; text-overflow:ellipsis}
.mc-barre__plus{font-size:13px; color:var(--mc-gris); white-space:nowrap}
.mc-barre__b{flex:none}

/* ── Les boutons de la page ──────────────────────────────────────────────── */
.mc-btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; height:38px;
  padding:0 18px; border:1px solid transparent; border-radius:999px; font-size:14px; font-weight:500;
  line-height:1; cursor:pointer; text-decoration:none; white-space:nowrap; max-width:100%}
.mc-btn--noir{background:var(--mc-encre); color:#fff}
.mc-btn--noir:hover{background:#242424}
.mc-btn--blanc{background:#fff; color:var(--mc-encre); border-color:var(--mc-filet)}
.mc-btn--blanc:hover{border-color:rgba(0,0,0,.22)}
.mc-btn:focus-visible{outline:2px solid var(--mc-teal); outline-offset:2px}
.mc-btn[disabled]{opacity:.5; cursor:not-allowed}
.mc-chev{width:12px; height:12px; flex:none}
.mc-rond{display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px;
  border-radius:50%; background:currentColor; color:#fff; flex:none}
.mc-btn--blanc .mc-rond{background:var(--mc-encre)}
.mc-rond svg{width:15px; height:15px; color:#fff}

/* ── La feuille des préférences ──────────────────────────────────────────── */
.mc-feuille{margin-top:12px; padding:16px 18px 22px; background:#fff; border-radius:22px}
.mc-feuille__haut{display:flex; align-items:center; justify-content:space-between; gap:16px; padding:4px 4px 12px}
.mc-feuille__titre{margin:0; font-size:20px; font-weight:600; letter-spacing:-.02em}
.mc-filet{height:1px; background:var(--mc-filet)}
.mc-lignes{display:grid; grid-template-columns:minmax(0,1fr); grid-auto-flow:row}
.mc-ligne{display:grid; grid-template-columns:minmax(0,1fr) auto 12px; align-items:center; gap:14px;
  width:100%; padding:18px 6px; background:none; border:0; border-bottom:1px solid var(--mc-filet);
  text-align:left; font:inherit; color:inherit; cursor:pointer}
.mc-ligne:last-child{border-bottom:0}
.mc-ligne:hover .mc-ligne__l{color:var(--mc-encre)}
.mc-ligne:focus-visible{outline:2px solid var(--mc-teal); outline-offset:-2px; border-radius:8px}
.mc-ligne__l{font-size:11px; font-weight:600; letter-spacing:.07em; text-transform:uppercase; color:var(--mc-gris)}
.mc-ligne__v{font-size:15px; font-weight:500; color:var(--mc-encre); text-align:right; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.mc-ligne__v[data-mc-etat="vide"]{color:var(--mc-gris); font-weight:400}
.mc-ligne > .mc-chev{color:var(--mc-gris)}
.mc-note{margin:14px 0 0; font-size:12.5px; line-height:1.5; color:var(--mc-gris)}
.mc-note a{color:var(--mc-teal); text-decoration:underline}

@media (min-width:900px){
  /* Deux colonnes, remplies par le HAUT : la colonne de gauche est la première dans le dessin. */
  .mc-feuille{padding:18px 28px 26px}
  .mc-lignes{grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:repeat(5, auto); grid-auto-flow:column}
  .mc-ligne{padding:16px 12px}
  .mc-ligne:nth-child(n+6){border-left:1px solid var(--mc-filet); padding-left:34px}
  .mc-ligne__v{text-align:left}
  .mc-ligne{grid-template-columns:150px minmax(0,1fr) 12px}
}

/* ── La porte du visiteur ────────────────────────────────────────────────── */
.mc-porte{margin-top:24px}
.mc-porte__carte{padding:40px 24px; background:#fff; border-radius:24px; text-align:center}
.mc-porte__titre{margin:0; font-size:24px; font-weight:600; letter-spacing:-.025em}
.mc-porte__texte{max-width:520px; margin:12px auto 0; font-size:15px; line-height:1.5; color:var(--mc-gris)}
.mc-porte__boutons{display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin-top:22px}
@media (min-width:768px){ .mc-porte__carte{padding:56px 40px} .mc-porte__titre{font-size:30px} }

/* ── Les envois, groupés par date ────────────────────────────────────────── */
.mc-envois{margin-top:16px}
.mc-etat, .mc-vide{margin:8px 0 0; font-size:15px; line-height:1.5; color:var(--mc-gris)}
.mc-vide b{color:var(--mc-encre); font-weight:600}
.mc-lien{background:none; border:0; padding:0; font:inherit; color:var(--mc-teal); text-decoration:underline; cursor:pointer}

.mc-groupe{margin-top:34px}
.mc-groupe:first-child{margin-top:8px}
.mc-groupe__tete{display:flex; align-items:flex-start; gap:12px; margin:0 0 16px}
.mc-groupe__pastille{display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px;
  border-radius:50%; background:var(--mc-teal); color:#fff; flex:none}
.mc-groupe__pastille svg{width:17px; height:17px}
.mc-groupe__t{display:flex; flex-direction:column; gap:2px; min-width:0}
.mc-groupe__date{font-size:17px; font-weight:600; letter-spacing:-.02em}
.mc-groupe__sous{display:flex; align-items:center; gap:10px; font-size:12.5px; color:var(--mc-gris)}
.mc-groupe__n{font-weight:500}

/* ── Les expirés ─────────────────────────────────────────────────────────── */
.mc-expires{margin-top:38px}
.mc-expires__tete{display:flex; align-items:flex-start; gap:12px; margin-bottom:14px}
.mc-expires__pastille{display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px;
  color:var(--mc-gris); flex:none}
.mc-expires__pastille svg{width:20px; height:20px}
.mc-expires__t{display:flex; flex-direction:column; gap:2px}
.mc-expires__t b{font-size:17px; font-weight:600; letter-spacing:-.02em}
.mc-expires__t span{font-size:12.5px; color:var(--mc-gris)}
.mc-expires__n{margin-left:10px; font-weight:500}
.mc-expires__liste{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px}
.mc-expire{display:grid; grid-template-columns:20px minmax(0,1fr) auto; align-items:center; gap:14px;
  padding:13px 18px; background:#fff; border-radius:14px}
.mc-expire__ic{width:20px; height:20px; opacity:.45; flex:none}
.mc-expire__t{display:flex; flex-direction:column; gap:2px; min-width:0}
.mc-expire__titre{font-size:15px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.mc-expire__type{font-size:12.5px; color:var(--mc-gris); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.mc-expire__quand{font-size:12.5px; color:var(--mc-gris); text-align:right; white-space:nowrap}
.mc-expire__lien{color:inherit; text-decoration:none}
.mc-expire__lien:hover .mc-expire__titre{text-decoration:underline}

.mc-historique{margin-top:26px}
.mc-historique__b{height:44px}
.mc-historique .mc-note{margin-top:8px}

.mc-bas{margin-top:36px}
.mc-retour{font-size:14px; color:var(--mc-teal); text-decoration:none}
.mc-retour:hover{text-decoration:underline}

/* ── Les fenêtres ────────────────────────────────────────────────────────── */
.mc-f{width:min(590px, calc(100vw - 24px)); max-height:calc(100vh - 32px); margin:auto; padding:0;
  border:0; border-radius:24px; background:#fff; color:var(--mc-encre);
  box-shadow:0 24px 80px rgba(9,20,24,.28); overflow:visible}
.mc-f[data-mc-f="roles"]{width:min(980px, calc(100vw - 24px))}
.mc-f::backdrop{background:rgba(12,20,24,.45)}
.mc-f__forme{display:flex; flex-direction:column; gap:0; max-height:calc(100vh - 32px); padding:24px 20px 20px}
.mc-f__haut{display:flex; align-items:flex-start; justify-content:space-between; gap:12px}
.mc-f__titre{margin:2px 0 0; font-size:20px; font-weight:600; letter-spacing:-.02em}
.mc-f__x{display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px;
  border:0; border-radius:50%; background:#eef1f2; color:#3f4750; font-size:17px; line-height:1; cursor:pointer; flex:none}
.mc-f__x:hover{background:#e2e6e8}
.mc-f__x:focus-visible{outline:2px solid var(--mc-teal); outline-offset:2px}
.mc-f__corps{display:flex; flex-direction:column; gap:16px; padding:18px 0 20px; overflow:auto; min-height:0}
.mc-f__fini{width:100%; height:46px; font-size:15px; font-weight:600; margin-top:4px; flex:none}

/* Les libellés de champ et les champs */
.mc-champ{display:flex; flex-direction:column; gap:8px}
.mc-champ__l{margin:0; font-size:11px; font-weight:600; letter-spacing:.07em; text-transform:uppercase; color:var(--mc-gris)}
.mc-champ__boite{display:flex; align-items:center; gap:10px; height:48px; padding:0 14px;
  border:1px solid rgba(0,0,0,.16); border-radius:12px; background:#fff; min-width:0}
.mc-champ__boite:focus-within{border-color:var(--mc-teal); box-shadow:0 0 0 3px rgba(0,118,146,.12)}
.mc-pin{width:16px; height:16px; color:var(--mc-teal); flex:none}
.mc-champ__c{flex:1 1 auto; min-width:0; height:100%; border:0; outline:0; background:none; font:inherit; font-size:15px}
.mc-select{width:100%; height:48px; padding:0 38px 0 14px; font:inherit; font-size:15px; color:inherit;
  border:1px solid rgba(0,0,0,.16); border-radius:12px; background:#fff; appearance:none; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6.25 8 10.25l4-4' stroke='%233f4750' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; background-size:16px}
.mc-select:focus-visible{outline:2px solid var(--mc-teal); outline-offset:1px}
.mc-aide{margin:0; font-size:12.5px; line-height:1.5; color:var(--mc-gris)}
.mc-deux{display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:end; gap:12px}
.mc-deux__a{font-size:14px; color:var(--mc-gris); padding-bottom:12px; text-align:center}

/* Un nombre avec ses deux boutons */
.mc-nombre{display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap}
.mc-nombre__b{display:inline-flex; align-items:center; justify-content:center; width:44px; height:48px;
  border:1px solid rgba(0,0,0,.16); border-radius:12px; background:#fff; color:inherit;
  font-size:19px; line-height:1; cursor:pointer; flex:none}
.mc-nombre__b:hover{border-color:rgba(0,0,0,.3)}
.mc-nombre__b:focus-visible{outline:2px solid var(--mc-teal); outline-offset:2px}
.mc-nombre__c{width:74px; height:48px; padding:0 6px; text-align:center; font:inherit; font-size:16px;
  border:1px solid var(--mc-teal); border-radius:12px; background:#fff; color:inherit; appearance:textfield}
.mc-nombre__c::-webkit-outer-spin-button, .mc-nombre__c::-webkit-inner-spin-button{-webkit-appearance:none; margin:0}
.mc-nombre__c:focus-visible{outline:2px solid var(--mc-teal); outline-offset:2px}
.mc-nombre__s{font-size:13px; color:var(--mc-gris)}

/* Une bascule */
.mc-bascule{display:flex; align-items:center; gap:12px; font-size:14px; cursor:pointer}
.mc-bascule--titre{justify-content:space-between}
.mc-bascule--titre > span{font-weight:500}
.mc-bascule input{appearance:none; width:46px; height:26px; border-radius:999px; background:#dfe3e5;
  position:relative; cursor:pointer; flex:none; transition:background .15s}
.mc-bascule input::after{content:""; position:absolute; top:3px; left:3px; width:20px; height:20px;
  border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:transform .15s}
.mc-bascule input:checked{background:var(--mc-teal)}
.mc-bascule input:checked::after{transform:translateX(20px)}
.mc-bascule input:focus-visible{outline:2px solid var(--mc-teal); outline-offset:2px}

/* Les puces cochables */
.mc-puces{display:flex; flex-wrap:wrap; gap:8px; min-width:0}
.mc-puce{display:inline-flex; min-width:0; max-width:100%}
.mc-puce input{position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden;
  clip:rect(0 0 0 0); white-space:nowrap; border:0}
.mc-puce label{display:inline-flex; flex-direction:column; gap:2px; padding:7px 14px; border-radius:999px;
  border:1px solid rgba(0,0,0,.16); background:#fff; font-size:13.5px; font-weight:500; line-height:1.25;
  cursor:pointer; max-width:100%; overflow-wrap:anywhere}
.mc-puce label:hover{border-color:rgba(0,0,0,.3)}
.mc-puce input:checked + label{border-color:var(--mc-teal); color:var(--mc-teal); box-shadow:inset 0 0 0 1px var(--mc-teal)}
.mc-puce input:focus-visible + label{outline:2px solid var(--mc-teal); outline-offset:2px}
.mc-puce input:disabled + label{background:#f4f6f7; color:var(--mc-gris); cursor:default; border-style:dashed}
.mc-puce__aide{font-size:11.5px; font-weight:400; color:var(--mc-gris); line-height:1.35}
.mc-puces--rayons label{padding:9px 16px}

/* Une colonne par métier (Rôles) */
.mc-colonnes{columns:220px 3; column-gap:18px}
.mc-col{display:block; break-inside:avoid; margin:0 0 16px; padding:0; border:0; min-width:0}
.mc-col legend{padding:0 0 8px; font-size:12px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--mc-gris)}
.mc-puces--col{flex-direction:column; flex-wrap:nowrap; align-items:flex-start; gap:6px}
.mc-puces--col .mc-puce label{border-radius:10px; font-size:13px; padding:6px 10px}

/* La ligne Pro d'une fenêtre verrouillée */
.mc-verrou{display:flex; align-items:center; gap:8px; margin:0 0 8px; padding:10px 12px;
  background:#f4f6f7; border-radius:12px; font-size:12.5px; color:#3f4750}
.mc-verrou a{color:var(--mc-teal); font-weight:500; text-decoration:underline; margin-left:auto}
.mc-lock{width:16px; height:16px; flex:none}
.mc-f[data-mc-verrouille] .mc-f__corps{opacity:.55}

@media (max-width:899px){
  .mc-colonnes{columns:1}
}

/* ── Les cartes restent celles du hub ────────────────────────────────────── */
.mc .cfh-cartes{margin:0}

@media (max-width:639px){
  .mc-barre{padding:14px; border-radius:18px}
  .mc-barre__puces{flex:1 1 100%}
  .mc-feuille{padding:14px 12px 18px; border-radius:18px}
  .mc-ligne{grid-template-columns:minmax(0,1fr) 12px; grid-template-areas:"l c" "v c"; row-gap:6px}
  .mc-ligne__l{grid-area:l}
  .mc-ligne__v{grid-area:v; text-align:left; white-space:normal}
  .mc-ligne > .mc-chev{grid-area:c; align-self:center}
  .mc-f__forme{padding:20px 16px 16px}
  .mc-expire{grid-template-columns:minmax(0,1fr); gap:4px; padding:12px 14px}
  .mc-expire__ic{display:none}
  .mc-expire__quand{text-align:left}
}
