/* MakeYouFirst — coquille de l'espace candidat (charte D « Rose & Encre ») : menu latéral repliable / tiroir mobile,
   barre du haut, barre d'onglets mobile, menu du compte, barre de progression, visite guidée.
   Chargée sur toutes les pages (partials/head.php) : tout est limité à body.shell ou à des classes propres. */

.shell {
  --sb-w: 256px; --sb-w-c: 72px; --sb-cur: var(--sb-w);
  --tb-h: 60px; --tab-h: 0px;
  --nav-h: var(--tb-h);           /* les positions « sticky » existantes (calc(var(--nav-h) + …)) suivent la barre du haut */
  --shell-bottom: 0px;            /* hauteur réservée en bas (barre d'onglets mobile) : à utiliser pour les barres collantes */
  background: var(--bg);
}
.shell.is-collapsed { --sb-cur: var(--sb-w-c); }

/* ——— Lien d'évitement ——— */
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 400; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: top .15s; }
.skip-link:focus, .skip-link:focus-visible { top: 12px; color: #fff; }

/* ——— Menu latéral ——— */
.sb { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--sb-cur); display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 14px; background: var(--bg); border-right: 1px solid var(--line); transition: width .22s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 2px 2px 6px 6px; }
.sb-logo { font-size: 17px; gap: 10px; min-width: 0; }
.sb-logo span { overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.sb-btn { flex: none; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--ink3); cursor: pointer; transition: background .15s, color .15s; }
.sb-btn:hover { background: var(--bg2); color: var(--ink); }
.sb-close { display: none; }
.sb-nav { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 2px 6px 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sb-group { display: flex; flex-direction: column; gap: 2px; }
.sb-label { margin: 0 0 4px; padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); white-space: nowrap; }
.sb-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--ink2); white-space: nowrap; transition: background .15s, color .15s; }
.sb-link .ico { color: var(--ink3); transition: color .15s; }
.sb-link:hover { background: var(--bg2); color: var(--ink); }
.sb-link:hover .ico { color: var(--ink); }
.sb-link.is-active { background: var(--p3); color: var(--ink); font-weight: 650; }
.sb-link.is-active .ico { color: var(--pd); }
.sb-link:focus-visible { border-radius: 12px; }
.sb-txt { overflow: hidden; text-overflow: ellipsis; }
.sb-link.is-pending, .tab-bar-i.is-pending { opacity: .6; }

/* Crédits */
.sb .sb-cred { margin-top: auto; flex: none; padding: 14px 16px; border-radius: var(--r); background: var(--bg2); color: var(--ink); display: block; }
.sb .sb-cred:hover { color: var(--ink); background: color-mix(in oklab, var(--bg2) 70%, var(--p2)); }
.sb-cred b { font-size: 24px; }
.sb-cred .bar { display: block; }
.sb-cred-full { display: block; }
.sb-cred-mini { display: none; }

/* Rail replié (ordinateur) */
.shell.is-collapsed .sb-logo span { opacity: 0; width: 0; }
.shell.is-collapsed .sb-head { flex-direction: column; padding: 2px 0 6px; gap: 6px; }
.shell.is-collapsed .sb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell.is-collapsed .sb-group + .sb-group::before { content: ""; display: block; height: 1px; background: var(--line); margin: 0 10px 12px; }
.shell.is-collapsed .sb-nav { gap: 12px; }
.shell.is-collapsed .sb-link { justify-content: center; padding: 0; width: 48px; height: 44px; margin: 0 auto; }
.shell.is-collapsed .sb-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell.is-collapsed .sb .sb-cred { padding: 0; background: none; margin: auto auto 0; }
.shell.is-collapsed .sb-cred-full { display: none; }
.shell.is-collapsed .sb-cred-mini { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--p) calc(var(--pct, 0) * 1%), var(--line) 0); }
.shell.is-collapsed .sb-cred-mini b { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--bg); font-size: 12px; font-weight: 800; letter-spacing: -.02em; }
.sb-tip { position: fixed; z-index: 80; transform: translateY(-50%); padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; }

/* ——— Colonne principale + barre du haut ——— */
.shell-main { margin-left: var(--sb-cur); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .22s cubic-bezier(.2, .8, .2, 1); min-width: 0; }
.shell-main > .content { flex: 1; width: 100%; }
.tb { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: var(--tb-h); padding: 0 20px 0 28px; background: color-mix(in oklab, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.tb-btn { flex: none; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--ink2); cursor: pointer; transition: background .15s, color .15s; }
.tb-btn:hover { background: var(--bg2); color: var(--ink); }
.tb-burger, .tb-logo { display: none; }
.tb-logo i { width: 30px; height: 30px; }
.tb-crumb { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.tb-crumb-g { color: var(--ink3); white-space: nowrap; }
.tb-crumb-sep { color: var(--line2); }
.tb-crumb-here { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sp { flex: 1; }
.tb-cred { display: none; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px; background: var(--p3); color: var(--pd); font-size: 13px; }
.tb-cred:hover { background: var(--p2); color: var(--pd); }
.tb-cred b { font-weight: 800; }
.shell.is-collapsed .tb-cred { display: inline-flex; }
.shell .content { padding: 28px 32px 48px; }
.shell .content.is-bleed { padding: 0; position: relative; }
.bleed-flash { padding: 12px 16px 0; }
.bleed-flash .alert { margin-bottom: 12px; }
.shell .foot { margin-top: auto; }
.shell .search { height: calc(100vh - var(--tb-h)); }
.content:focus { outline: none; }

/* ——— Menu du compte ——— */
.um-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); transition: background .15s, border-color .15s; }
.um-btn:hover { background: var(--bg2); }
.um[open] .um-btn { border-color: var(--line2); background: var(--bg2); }
.um-btn .avatar { width: 32px; height: 32px; font-size: 12px; }
.um-chev { color: var(--ink3); transition: transform .2s; }
.um[open] .um-chev { transform: rotate(180deg); }
.um-panel { top: calc(100% + 8px); min-width: 272px; padding: 8px; gap: 1px; animation: mf-pop .16s ease-out; transform-origin: top right; }
.um-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.um-head .avatar { width: 40px; height: 40px; flex: none; }
.um-id { display: flex; flex-direction: column; min-width: 0; }
.um-id b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-id small { font-size: 12px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-panel > a, .um-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; }
.um-panel > a .ico, .um-item .ico, .um-lang .ico { color: var(--ink3); }
.um-panel > a:hover, .um-item:hover, .um-panel > a:focus-visible, .um-item:focus-visible { background: var(--bg2); color: var(--ink); }
.um-sep { display: block; height: 1px; background: var(--line); margin: 5px 4px; }
.um-lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 14px; font-weight: 500; }
.um-lang > span:first-child { display: inline-flex; align-items: center; gap: 11px; }
.um-out { margin: 0; }
.um-item .spinner { display: none; }
.mf-nav .nav-space { padding: 8px 14px; }
@keyframes mf-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ——— Barre de progression de navigation ——— */
.mf-progress { position: fixed; z-index: 300; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; opacity: 0; transition: opacity .3s .1s; }
.mf-progress i { display: block; width: 0; height: 100%; background: var(--p); border-radius: 0 3px 3px 0; transition: width .26s ease-out; }
.mf-progress.is-on { opacity: 1; transition: opacity .1s; }
.mf-slow { position: fixed; z-index: 300; left: 50%; bottom: calc(20px + var(--shell-bottom, 0px)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--sh-pop); animation: mf-pop .2s ease-out; }
.btn.is-busy, button.is-busy { cursor: progress; }
.btn.is-busy .spinner, button.is-busy .spinner { width: 13px; height: 13px; }

/* ——— Alertes : icône + fermer ——— */
.alert-flash { display: flex; align-items: flex-start; gap: 10px; }
.alert-flash .alert-ico { flex: none; margin-top: 2px; }
.alert-txt { flex: 1; min-width: 0; }
.alert-x { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -2px -6px -2px 0; border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .6; cursor: pointer; }
.alert-x:hover { opacity: 1; background: #ffffff80; }

/* ——— Barre d'onglets mobile ——— */
.tab-bar { display: none; }

/* ——— Visite guidée ——— */
.tour { position: fixed; inset: 0; z-index: 200; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 2px #fff, 0 0 0 6px oklch(.66 .2 350 / .55), 0 0 0 200vmax #0d0c229e; transition: left .3s cubic-bezier(.2, .8, .2, 1), top .3s cubic-bezier(.2, .8, .2, 1), width .3s cubic-bezier(.2, .8, .2, 1), height .3s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.tour.no-target .tour-spot { box-shadow: 0 0 0 200vmax #0d0c229e; }
.tour-pop { position: fixed; width: min(360px, calc(100vw - 24px)); background: var(--card); color: var(--ink); border-radius: var(--r); padding: 18px 20px 16px; box-shadow: var(--sh-pop); transition: left .3s cubic-bezier(.2, .8, .2, 1), top .3s cubic-bezier(.2, .8, .2, 1); }
.tour-pop.is-in { animation: mf-pop .22s ease-out; }
.tour.no-target .tour-pop:not(.is-sheet) { width: min(420px, calc(100vw - 24px)); padding: 26px 26px 18px; }
.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tour-count { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pd); }
.tour-skip { border: 0; background: none; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; color: var(--ink3); font-size: 13px; font-weight: 600; cursor: pointer; }
.tour-skip:hover { color: var(--ink); background: var(--bg2); }
.tour-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; line-height: 1.2; }
.tour-text { font-size: 14.5px; line-height: 1.55; color: var(--ink2); margin: 0 0 16px; }
.tour-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.tour-dots { display: flex; gap: 4px; margin: -4px 0 14px; }
.tour-dots i { flex: 1; height: 4px; border-radius: 99px; background: var(--line); transition: background .25s; }
.tour-dots i.is-done { background: var(--p2); }
.tour-dots i.is-on { background: var(--p); }
.tour-pop.is-sheet { width: auto; right: 12px; border-radius: 20px; padding: 18px 18px 14px; }
body.tour-on { overflow: hidden; }

/* ——— Mobile : tiroir + barre d'onglets ——— */
@media (max-width: 899.98px) {
  .shell { --tb-h: 56px; --tab-h: 62px; --sb-cur: 0px; --shell-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); }
  .shell.is-collapsed { --sb-cur: 0px; }
  .sb { width: min(304px, 86vw); transform: translateX(-104%); transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility 0s .26s; visibility: hidden; z-index: 70; padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: none; }
  .nav-toggle:checked ~ .sb { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--sh-pop); }
  .nav-toggle:checked ~ .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: #0d0c2259; animation: mf-fade .2s ease-out; }
  body.drawer-open { overflow: hidden; }
  .sb-collapse { display: none; }
  .sb-close { display: inline-grid; }
  /* le tiroir est toujours déplié, même si le rail est replié sur ordinateur */
  .shell.is-collapsed .sb-logo span { opacity: 1; width: auto; }
  .shell.is-collapsed .sb-head { flex-direction: row; padding: 2px 2px 6px 6px; }
  .shell.is-collapsed .sb-label { position: static; width: auto; height: auto; clip: auto; }
  .shell.is-collapsed .sb-group + .sb-group::before { display: none; }
  .shell.is-collapsed .sb-nav { gap: 14px; }
  .shell.is-collapsed .sb-link { justify-content: flex-start; padding: 0 10px; width: auto; height: auto; margin: 0; }
  .shell.is-collapsed .sb-txt { position: static; width: auto; height: auto; clip: auto; }
  .shell.is-collapsed .sb .sb-cred { padding: 14px 16px; background: var(--bg2); margin: auto 0 0; }
  .shell.is-collapsed .sb-cred-full { display: block; }
  .shell.is-collapsed .sb-cred-mini { display: none; }
  .sb-link { min-height: 44px; font-size: 15px; }
  .shell-main { margin-left: 0; padding-bottom: var(--shell-bottom); }
  .tb { padding: 0 10px 0 8px; gap: 6px; }
  .tb-burger { display: inline-grid; }
  .tb-logo { display: inline-flex; }
  .tb-crumb-g, .tb-crumb-sep { display: none; }
  .tb-crumb { margin-left: 4px; font-size: 15px; }
  .tb-cred, .shell.is-collapsed .tb-cred { display: inline-flex; padding: 6px 10px; }
  .shell .content { padding: 20px 16px 32px; }
  .shell .content.is-bleed { padding: 0; }
  .shell .search { height: auto; }
  .shell .foot { padding: 16px; }
  .shell .sticky-actions { bottom: var(--shell-bottom); }
  .shell .ready-bar { bottom: calc(var(--shell-bottom) + 8px); }
  .tab-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; height: var(--shell-bottom); padding: 0 4px env(safe-area-inset-bottom, 0px); background: color-mix(in oklab, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tab-bar-i { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; height: var(--tab-h); padding: 0 2px; color: var(--ink3); font-size: 10.5px; font-weight: 600; letter-spacing: -.01em; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 12px; }
  .tab-bar-i span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-bar-i:hover { color: var(--ink); }
  .tab-bar-i.is-active { color: var(--ink); }
  .tab-bar-i.is-active .ico { color: var(--pd); }
  .tab-bar-i:active .ico { transform: scale(.92); }
  .tab-bar-i:focus-visible { box-shadow: inset 0 0 0 2px oklch(.66 .2 350 / .5); }
  .um-panel { position: fixed; top: calc(var(--tb-h) + 6px); right: 8px; left: auto; max-width: calc(100vw - 16px); }
}
@media (max-width: 420px) {
  .tb-help { display: none; }
}
/* Pages publiques (barre .mf-nav) consultées connecté : le menu du compte reste ancré sous l'avatar
   (la barre a un backdrop-filter, qui sert de bloc conteneur aux éléments « fixed » : on repasse en absolu). */
@media (max-width: 899.98px) {
  .mf-nav .um-panel { position: absolute; top: calc(100% + 8px); right: 0; left: auto; max-width: calc(100vw - 24px); }
}
@media (max-width: 420px) {
  .mf-nav { gap: 8px; }
  .mf-nav .logo { font-size: 17px; gap: 8px; }
  .mf-nav .nav-btns { gap: 6px; }
  .mf-nav .um-chev { display: none; }
  .mf-nav .um-btn { padding: 3px; }
}
@keyframes mf-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sb, .shell-main, .tour-spot, .tour-pop, .mf-progress i { transition: none !important; }
}
@media print {
  .sb, .tb, .tab-bar, .mf-progress, .tour { display: none !important; }
  .shell-main { margin: 0; }
}
.shell.is-collapsed .sb-nav { scrollbar-width: none; }
.shell.is-collapsed .sb-nav::-webkit-scrollbar { display: none; }
