/* =====================================================================
   BARRE DE MENU RÉGLABLE — 03/12/2026 (js/barre.js)
   Demande de Mathieu : une barre qui se règle comme le Dock de macOS.
   Chargée APRÈS shell.css. Tout ce qui change la disposition vit dans
   @media (min-width:861px) : au téléphone et sur tablette debout, rien ne
   bouge. Sans réglage, aucune des classes gs-barre-* n'est posée.
   ===================================================================== */

/* ── Application ouverte : un point, comme sous une icône du Dock ── */
.gshell-rail-favorite.gs-ouverte{position:relative}
.gshell-rail-favorite.gs-ouverte::before{content:"";position:absolute;left:-8px;top:50%;width:5px;height:5px;
    margin-top:-2.5px;border-radius:50%;background:var(--gs-accent)}
.gshell-rail-favorite.on{color:var(--gs-ink)}

/* ── Menu du clic droit ── */
.gshell-barre-menu{position:fixed;z-index:4000;min-width:216px;padding:5px;border:1px solid var(--gs-line-strong);
    border-radius:11px;background:var(--gs-panel);color:var(--gs-ink);box-shadow:0 14px 38px rgba(35,31,24,.22);
    font-family:inherit;font-size:13px}
.gbm-item{display:flex;align-items:center;gap:6px;width:100%;padding:7px 10px 7px 6px;border:0;border-radius:7px;
    background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.gbm-item:hover,.gbm-item:focus-visible{background:var(--gs-accent-soft);outline:none}
.gbm-coche{flex:0 0 14px;text-align:center;font-size:11px;color:var(--gs-accent)}
.gbm-fermer{color:var(--gs-crit)}
.gbm-sep{height:1px;margin:5px 6px;background:var(--gs-line)}

/* ── Carte de Paramètres › Général ── */
.gset-barre-positions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.gset-barre-croquis{display:block;position:relative;height:46px;margin-bottom:8px;border:1px solid var(--gs-line);
    border-radius:7px;background:var(--gs-ground)}
.gset-barre-croquis i{position:absolute;border-radius:3px;background:var(--gs-accent);opacity:.75}
.gset-barre-croquis.gauche i{left:4px;top:4px;bottom:4px;width:7px}
.gset-barre-croquis.bas i{left:22%;right:22%;bottom:4px;height:7px}
.gset-barre-taille{display:flex;align-items:center;gap:10px;margin-top:4px}
.gset-barre-taille input{flex:1;accent-color:var(--gs-accent)}
.gset-barre-taille .gicon{flex:none;color:var(--gs-ink-faint)}
.gset-barre-taille .petit{width:14px;height:14px}
.gset-barre-taille .grand{width:26px;height:26px}
.gset-barre-elements{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:4px 12px;margin-top:6px}
.gset-barre-el{display:flex;align-items:center;gap:7px;padding:5px 2px;font-size:13px;font-weight:500;text-transform:none;letter-spacing:0;color:var(--gs-ink);cursor:pointer}
.gset-barre-el input{accent-color:var(--gs-accent);width:16px;height:16px}
.gset-barre-bloc{margin-top:16px}
.gset-barre-bloc .gset-ligne+.gset-ligne{margin-top:10px}
.gset-barre-bloc>.gset-titre{margin-bottom:6px}
.gshell-push-toggle:disabled{opacity:.45;cursor:not-allowed}
.gshell-barre-bord{display:none}
@media (max-width:860.98px){#gsetBarre{display:none}}

@media (min-width:861px){
    /* ── Ce qu'on a retiré de la barre ── */
    .gshell-rail .gs-barre-cache{display:none!important}

    /* ── Taille des icônes (seulement si on l'a changée, ou barre en bas) ── */
    body:is(.gs-barre-taille,.gs-barre-bas) .gshell-rail .gshell-item{min-height:calc(var(--gs-barre-ic) + 21px)}
    body:is(.gs-barre-taille,.gs-barre-bas) .gshell-rail .gshell-item .ic{flex:none;width:calc(var(--gs-barre-ic) + 1px);
        height:var(--gs-barre-ic);font-size:calc(var(--gs-barre-ic) * .8)}
    body:is(.gs-barre-taille,.gs-barre-bas) .gshell-rail .gshell-item .ic .gicon{width:var(--gs-barre-ic);height:var(--gs-barre-ic)}
    body:is(.gs-barre-taille,.gs-barre-bas) .gshell-rail .gshell-fav-app-icon{width:var(--gs-barre-ic);border-radius:calc(var(--gs-barre-ic) * .3)}
    body:is(.gs-barre-taille,.gs-barre-bas) .gshell-rail .gshell-fav-app-icon .gli-emoji{font-size:calc(var(--gs-barre-ic) * .65)}
    body:is(.gs-barre-taille,.gs-barre-bas) .gshell-rail .gshell-fav-app-icon .gli-connected-icon{width:calc(var(--gs-barre-ic) * .85);height:calc(var(--gs-barre-ic) * .85)}
    body:is(.gs-barre-taille,.gs-barre-bas) .gshell-rail .ic-gandalf{width:calc(var(--gs-barre-ic) * 1.4);height:calc(var(--gs-barre-ic) * 1.4);
        max-width:none;margin:calc(var(--gs-barre-ic) * -.2)}
    body:is(.gs-barre-taille,.gs-barre-bas) .gshell-rail .ic-bilbo{width:var(--gs-barre-ic);height:var(--gs-barre-ic)}
    body.shell-on.gs-rail-mini.gs-barre-taille{--gs-rail-w:calc(var(--gs-barre-ic) + 40px)}
    body.gs-rail-mini .gshell-rail:not(.gs-rail-deploye) .gshell-rail-favorite.gs-ouverte::before{left:-7px}

    /* ── Masquage automatique : la page prend toute la place, la barre
          revient PAR-DESSUS quand la souris touche le bord (gs-barre-vue) ── */
    body.shell-on.gs-barre-auto,body.shell-on.gs-rail-mini.gs-barre-auto{--gs-rail-w:0px}
    body.shell-on.gs-barre-auto .gshell-barre-bord{display:block;position:fixed;z-index:92;left:0;top:0;bottom:0;width:5px}
    body.gs-app-plein .gshell-barre-bord{display:none!important}
    body.shell-on.gs-barre-auto .gshell-rail{z-index:93;transition:transform .2s ease}
    body.shell-on.gs-barre-auto:not(.gs-barre-bas) .gshell-rail{width:248px;transform:translateX(-102%)}
    body.shell-on.gs-rail-mini.gs-barre-auto:not(.gs-barre-bas) .gshell-rail:not(.gs-rail-deploye){width:calc(var(--gs-barre-ic,20px) + 40px)}
    body.shell-on.gs-barre-auto.gs-barre-vue:not(.gs-barre-bas) .gshell-rail{transform:none;box-shadow:8px 0 28px rgba(35,31,24,.16)}

    /* ── Barre EN BAS : une rangée d'icônes flottante, centrée ── */
    body.shell-on.gs-barre-bas,body.shell-on.gs-rail-mini.gs-barre-bas{--gs-rail-w:0px;--gs-barre-h:calc(var(--gs-barre-ic,20px) + 46px)}
    body.shell-on.gs-barre-bas.gs-barre-auto,body.shell-on.gs-barre-bas.gs-app-plein{--gs-barre-h:0px}
    body.shell-on.gs-barre-bas .gshell-rail{top:auto;bottom:8px;left:calc((100vw - var(--dang-w,0px)) / 2);
        transform:translateX(-50%);width:max-content;max-width:calc(100vw - var(--dang-w,0px) - 24px);
        flex-direction:row;align-items:center;gap:4px;padding:6px 8px;
        border:1px solid var(--gs-line-strong);border-radius:18px;box-shadow:0 10px 34px rgba(35,31,24,.2);
        overflow-x:auto;overflow-y:hidden;z-index:93}
    body.shell-on.gs-barre-bas.gs-barre-auto .gshell-rail{transform:translate(-50%,calc(100% + 16px))}
    body.shell-on.gs-barre-bas.gs-barre-auto.gs-barre-vue .gshell-rail{transform:translateX(-50%)}
    body.shell-on.gs-barre-bas.gs-barre-auto .gshell-barre-bord{top:auto;right:var(--dang-w,0px);width:auto;height:5px}

    body.gs-barre-bas .gshell-rail .gshell-brand,
    body.gs-barre-bas .gshell-rail .gshell-rail-toggle,
    body.gs-barre-bas .gshell-rail .gshell-rail-toggle+.gshell-rail-label{display:none}
    body.gs-barre-bas .gshell-rail .gshell-item{flex:none;width:calc(var(--gs-barre-ic) + 18px);height:calc(var(--gs-barre-ic) + 18px);
        min-height:0;margin:0;padding:0;border-radius:12px;transition:transform .12s ease}
    body.gs-barre-bas .gshell-rail .gshell-item:hover{transform:translateY(-2px) scale(1.1)}
    body.gs-barre-bas .gshell-rail .gshell-item.on{box-shadow:none}
    body.gs-barre-bas .gshell-rail .gshell-rail-favorites,
    body.gs-barre-bas .gshell-rail .gshell-rail-utilities{display:flex;flex-direction:row;align-items:center;gap:4px;
        border:0;padding:0;margin:0}
    body.gs-barre-bas .gshell-rail .gshell-rail-favorites.hidden{display:none}
    body.gs-barre-bas.gs-rail-mini .gshell-rail:not(.gs-rail-deploye) .gshell-rail-label,
    body.gs-barre-bas .gshell-rail .gshell-spacer{flex:0 0 1px;align-self:stretch;width:1px;height:auto;min-height:0;
        margin:5px 5px;padding:0;overflow:hidden;font-size:0;background:var(--gs-line)}
    body.gs-barre-bas.gs-rail-mini .gshell-rail:not(.gs-rail-deploye) .gshell-user{flex:none;margin:0 0 0 2px;padding:0 4px}
    body.gs-barre-bas .gshell-rail .gshell-rail-favorite.gs-ouverte::before,
    body.gs-barre-bas.gs-rail-mini .gshell-rail:not(.gs-rail-deploye) .gshell-rail-favorite.gs-ouverte::before{left:50%;top:auto;bottom:1px;
        margin:0 0 0 -2.5px}
    body.gs-barre-bas .gshell-rail .gshell-rail-favorite.on{box-shadow:none;background:var(--gs-accent-soft)}

    /* La page s'arrête au-dessus de la barre (sauf masquage : --gs-barre-h vaut 0). */
    body.shell-on.gs-barre-bas #app-content{padding-bottom:var(--gs-barre-h)}
    body.shell-on.gs-barre-bas .tasks-view,
    body.shell-on.gs-barre-bas .gshell-appframe,
    body.shell-on.gs-barre-bas .notes-view.nx,
    body.shell-on.gs-barre-bas .web-chat-view,
    body.shell-on.gs-barre-bas .gnv-vue,
    body.shell-on.gs-barre-bas:not(.ai-popup-mode) #ai-chat-view{bottom:var(--gs-barre-h)}
    body.shell-on.gs-barre-bas:not(.ai-popup-mode) #ai-chat-view{height:auto}
    /* Messages et Notes fixent leur HAUTEUR, pas leur bas : vu en connecté sur
       gandalf-dev (03/12), la liste et la zone de saisie passaient sous la barre. */
    body.shell-on.gs-barre-bas #chatView,
    body.shell-on.gs-barre-bas #notesView{height:calc(100dvh - var(--gs-universal-h,72px) - var(--gs-barre-h))!important}
    body.shell-on.gs-barre-bas #notesView{min-height:0!important}
}
/* ── ORDINATEUR : PLUS D'ONGLETS D'APPS EN HAUT — 03/12/2026 ──
   Demande de Mathieu : « ça n'a plus sa place ». La barre de menu montre
   déjà les applications ouvertes (point, section « Ouvertes ») et sert à en
   changer. Hors d'une app, la rangée d'onglets disparaît : 40 px rendus à la
   page. Dans une app, la barre de 44 px garde SEULEMENT l'app à l'écran — son
   nom et ses trois commandes (plein écran, nouvelle fenêtre, fermer) : sans
   elles, on ne pourrait plus fermer une app au toucher, qui n'a pas de clic
   droit. La tablette debout et le téléphone (≤ 860 px) ne changent pas. */
@media (min-width:861px){
    body.shell-on.gs-has-app-tabs:not(.gs-popup-mode):not(.ai-popup-mode){--gs-app-tabs-h:0px}
    body.shell-on:not(:has(#appFrameView:not(.hidden))) .gshell-apptabs{display:none}
    body.shell-on:has(#appFrameView:not(.hidden)) .gshell-apptabs :is(.gshell-apptab-home,.gshell-apptab:not(.on)){display:none}
    body.shell-on:has(#appFrameView:not(.hidden)) .gshell-apptabs .gshell-apptab.on{box-shadow:none}
    body.shell-on:has(#appFrameView:not(.hidden)) .gshell-apptabs .gshell-apptab.on .gshell-apptab-select{cursor:default}
}
@media (prefers-reduced-motion:reduce){
    body.shell-on.gs-barre-auto .gshell-rail,body.gs-barre-bas .gshell-rail .gshell-item{transition:none}
    body.gs-barre-bas .gshell-rail .gshell-item:hover{transform:none}
}
