/* En-tête commun des applis sur mobile : identique à l'accueil (logo, « CSE FOLKLING » puis titre de l'appli), ajouté par le serveur dès l'ouverture de la page.
   Le menu de l'appli (onglets) reste dessous ; l'ancien bloc logo/titre de l'appli est masqué. Sur ordinateur, rien ne change. */
#csef-hd{display:none}
.csef-gear,#csef-hd .hdg{flex:none;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;padding:0;margin-left:6px;border-radius:999px;border:1px solid rgba(255,255,255,.4);background:transparent;color:#fff;cursor:pointer;-webkit-tap-highlight-color:transparent}
.csef-gear:hover,#csef-hd .hdg:hover{background:rgba(255,255,255,.14)}
.csef-gear:focus-visible,#csef-hd .hdg:focus-visible{outline:3px solid #fff;outline-offset:2px}
.csef-gear.on,#csef-hd .hdg.on{background:rgba(255,255,255,.2);border-color:#fff}
.csef-gear svg,#csef-hd .hdg svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#csef-hd .hdg[hidden]{display:none}
#csef-hd .hdhm{flex:none;display:inline-flex;align-items:center;gap:7px;height:40px;padding:0 14px 0 11px;border-radius:999px;border:1px solid rgba(255,255,255,.5);color:#fff;text-decoration:none;font:700 14px/1 "Barlow Condensed",sans-serif;letter-spacing:.08em;text-transform:uppercase;-webkit-tap-highlight-color:transparent}
#csef-hd .hdhm:hover{background:rgba(255,255,255,.14)}
#csef-hd .hdhm:focus-visible{outline:3px solid #fff;outline-offset:2px}
#csef-hd .hdhm svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:720px){
  html:has(#csef-hd){--hdh:68px}
  #csef-hd ~ * .gs>h3{top:calc(var(--hdh,0px) + var(--tp,96px))}
  #csef-hd{display:flex;align-items:center;gap:8px;background:#000;color:#fff;padding:0 12px 0 16px;padding-top:env(safe-area-inset-top,0px);position:sticky;top:0;z-index:50;view-transition-name:csef-hd;min-height:calc(68px + env(safe-area-inset-top,0px));box-sizing:border-box}
  #csef-hd ~ * header.top{top:calc(68px + env(safe-area-inset-top,0px))}
  #csef-hd img{height:44px;width:auto;border-radius:8px;background:#fff;padding:2px;flex:none}
  #csef-hd .b small{margin-bottom:3px}
  #csef-hd .b{min-width:0;flex:1}
  #csef-hd small{display:block;font:600 11px/1 "Barlow Condensed",sans-serif;letter-spacing:.16em;text-transform:uppercase;opacity:.7}
  #csef-hd b{display:block;font:700 22px/1.1 "Barlow Condensed",sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .csef-gear{display:none!important}
  /* l'ancien bloc logo + titre des applis disparaît : on ne garde que le menu (onglets) et, si besoin, le choix de l'exercice (Compta) ou l'état d'enregistrement (Marque) */
  #csef-hd ~ * header.top .toprow>*{display:none!important}
  #csef-hd ~ * header.top .toprow>.hdract:has(select){display:flex!important;margin-left:auto}
  #csef-hd ~ * header.top .toprow>.hdract:has(select) a{display:none!important}
  #csef-hd ~ * header.top .toprow>.sync:has(i){display:flex!important;margin-left:auto}
  #csef-hd ~ * header.top .toprow:not(:has(.hdract select,.sync i)){display:none}
  #csef-hd ~ * header.top:has(.toprow):not(:has(.nav,.hdract select,.sync i)){display:none}
  #csef-hd ~ * header.top:has(.toprow):not(:has(.hdract select,.sync i)){padding-top:0}
  #csef-hd ~ * header.top .nav{margin-top:0}
}
@media (max-width:420px){#csef-hd{gap:8px}#csef-hd b{font-size:19px}}

/* Ordinateur : même titre que sur mobile — petit « CSE FOLKLING » au-dessus, nom de l'appli en grand (le texte d'origine de chaque appli est masqué, le nom vient de --csef-app posé par le serveur) */
@media (min-width:721px){
  html:has(#csef-hd) header .brand:not(:has(>div)){display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px}
  html:has(#csef-hd) header .brand:not(:has(>div))>*{display:none!important}
  html:has(#csef-hd) header .brand>div>*{display:none!important}
  html:has(#csef-hd) header .brand:not(:has(>div))::before,html:has(#csef-hd) header .brand>div::before{content:"CSE Folkling";display:block;margin:0;font:600 11px/1 "Barlow Condensed",sans-serif;letter-spacing:.16em;text-transform:uppercase;color:#fff;opacity:.7}
  html:has(#csef-hd) header .brand:not(:has(>div))::after,html:has(#csef-hd) header .brand>div::after{content:var(--csef-app);display:block;margin:3px 0 0;font:700 22px/1.1 "Barlow Condensed",sans-serif;text-transform:none;letter-spacing:0;color:#fff;white-space:nowrap}
  /* mêmes dimensions que l'en-tête de l'accueil : bandeau de 68 px, logo 44 px, textes 11 px / 22 px sans espace entre eux */
  html:has(#csef-hd) header.top{padding:12px 16px 0;min-height:68px;box-sizing:border-box}
  html:has(#csef-hd) header.top .logo,html:has(#csef-hd) .admbar .logo{box-sizing:border-box;height:44px;width:auto;border-radius:8px;background:#fff;padding:2px;flex:none;display:block}
  html:has(#csef-hd) header.top .brand:not(:has(>div)){gap:0;margin-left:-4px}
  html:has(#csef-hd) header.top .brand:has(>div){gap:8px}
  html:has(#csef-hd) header.top .brand:not(:has(>div))::after,html:has(#csef-hd) header.top .brand>div::after{margin:0;line-height:26px}
  html:has(#csef-hd) header.top .brand>div{display:block}
  html:has(#csef-hd) header.top:not(:has(.toprow)){padding:8px 16px}
  html:has(#csef-hd) .admbar{padding:12px 16px;min-height:68px;box-sizing:border-box}
  html:has(#csef-hd) .admbar header.top{margin:0;padding:0;min-height:44px}
}

/* L'onglet « Réglages » du menu est remplacé par la roue dentée : on le masque dès l'affichage (pas d'instant où les deux coexistent) */
html:has(#csef-hd) :is(nav,.nav) button:is([data-tab="reglages"],[data-go="reglages"],[data-tab="parametres"],[data-go="parametres"],[data-v="reglages"]){display:none!important}

/* Réglages d'une appli (mobile) : un seul bouton rouge sous le bandeau noir ouvre la liste de TOUTES les rubriques de ces réglages */
.rgswb{display:none}
@media (max-width:720px){
  html:has(#csef-hd) .rgswb{grid-column:1/-1;display:block;position:sticky;top:var(--rgtop,68px);z-index:30;background:var(--bg,#eef1f4);margin:0 -16px;padding:8px 16px}
  html:has(#csef-hd) .rgswb+:is(.rg-nav,.snav){display:none!important}
  .rgsw{display:flex;align-items:center;gap:10px;width:100%;min-height:56px;padding:6px 14px;border:0;border-radius:14px;background:#b6000c;color:#fff;text-align:left;cursor:pointer;font:inherit;-webkit-tap-highlight-color:transparent;box-shadow:0 2px 8px rgba(182,0,12,.28)}
  .rgsw:active{background:#8f0009}
  .rgsw .x{flex:1;min-width:0}
  .rgsw small{display:block;font:700 11px/1 "Barlow Condensed",sans-serif;letter-spacing:.14em;text-transform:uppercase;opacity:.85}
  .rgsw b{display:block;margin-top:3px;font:700 20px/1.1 "Barlow Condensed",sans-serif;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .rgsw svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
  .rgsw:focus-visible{outline:3px solid #14222e;outline-offset:2px}
}
