/* ============================================================================
   mobile.css — couche responsive de la copie « Responsive »
   ----------------------------------------------------------------------------
   Chargé APRÈS style.css. Ne contient QUE :
     - des déclarations de variables inertes sur :root (ne changent rien seules)
     - des règles sous @media (max-width: …)
     - un garde @media (min-width: 861px) qui masque les éléments d'UI mobile
       (tabbar, feuilles) — ces éléments n'existent pas sur le rendu bureau.
   → Le rendu bureau (≥ 861px) de la V1 est laissé strictement intact.
   Thème sombre : on ne réutilise que les variables --… déjà définies dans
   style.css, jamais de couleur en dur.
   Point de bascule mobile unique : 860px (aligné sur les media queries
   existantes de style.css pour les remplacer proprement).
   ========================================================================== */

:root{
  /* Courbes & durées — cf. emil-design-eng / animations.dev */
  --m-ease-drawer: cubic-bezier(.32, .72, 0, 1);   /* glissé façon iOS */
  --m-ease-out: cubic-bezier(.23, 1, .32, 1);       /* entrée franche */
  --m-tabbar-h: 60px;
}

/* Garde-fou : rien de tout ça ne doit apparaître sur desktop. */
@media (min-width: 861px){
  .mobile-tabbar,
  .m-sheet,
  .m-sheet-backdrop,
  .nav-drawer-backdrop{ display: none !important; }
}

/* ==========================================================================
   1. CHROME GLOBAL — le menu du haut devient un tiroir gauche
   ========================================================================== */
@media (max-width: 860px){

  .topbar{ padding: 11px 14px; position: sticky; top: 0; z-index: 50; }
  .topbar .brand{ font-size: 15px; }

  /* Le <nav> du topbar : de menu déroulant (style.css) → tiroir latéral. */
  .topbar nav#topbarNav{
    position: fixed; inset: 0 auto 0 0;
    width: min(82vw, 340px);
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface);
    border: none; border-right: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 20px);
    overflow-y: auto;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .3s var(--m-ease-drawer);
  }
  .topbar nav#topbarNav.show{ transform: translateX(0); }

  .topbar nav#topbarNav a,
  .topbar nav#topbarNav .nav-dropdown-btn{
    width: 100%; justify-content: flex-start;
    padding: 13px 12px; font-size: 15px; border-radius: 9px;
    min-height: 46px; box-sizing: border-box;
  }
  .topbar nav#topbarNav a:active{ background: var(--surface-2); }
  .topbar nav#topbarNav .nav-dropdown{ width: 100%; }
  .topbar nav#topbarNav .nav-dropdown-menu{
    position: static; box-shadow: none; border: none; padding: 0 0 4px 14px; min-width: 0;
  }
  .topbar nav#topbarNav .user{
    margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--border);
    font-size: 13px;
  }

  /* Fond sombre derrière le tiroir (créé par mobile.js). */
  .nav-drawer-backdrop{
    position: fixed; inset: 0; z-index: 55;
    background: rgba(20, 20, 24, .45);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .nav-drawer-backdrop.show{ opacity: 1; pointer-events: auto; }

  .topbar-menu-btn{ width: 42px; height: 42px; font-size: 18px; }
}

/* ==========================================================================
   2. CHROME PROJET — barre latérale masquée, barre d'onglets en bas
   ========================================================================== */

/* Base (inertes tant que le markup mobile n'est pas rendu). */
.mobile-tabbar{ display: none; }

@media (max-width: 860px){

  /* On masque UNIQUEMENT la barre latérale des pages projet (#boSidebar).
     Le backoffice garde son propre bandeau .bo-sidebar (sans id). */
  #boSidebar{ display: none !important; }

  .bo-layout{ display: block; max-width: none; }
  .bo-content{ padding: 16px 14px 24px; }

  .mobile-tabbar{
    display: flex; align-items: stretch;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -1px 2px rgba(0,0,0,.05), 0 -10px 28px -18px rgba(0,0,0,.25);
  }
  .mobile-tabbar a,
  .mobile-tabbar button{
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: var(--m-tabbar-h);
    padding: 8px 4px 6px;
    background: none; border: none; font: inherit;
    font-size: 10px; font-weight: 700; letter-spacing: .01em;
    color: var(--muted); text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s var(--m-ease-out), color .12s ease;
  }
  .mobile-tabbar .m-tab-ico{ font-size: 20px; line-height: 1; }
  .mobile-tabbar .m-tab-label{
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mobile-tabbar a.active{ color: var(--accent); }
  .mobile-tabbar a:active,
  .mobile-tabbar button:active{ transform: scale(.93); }

  /* Réserver la place de la tabbar + décoller les éléments flottants. */
  body.has-tabbar .shell,
  body.has-tabbar .bo-content{
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 26px);
  }
  body.has-tabbar #pilotToggle{
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 16px) !important;
    right: 16px !important;
  }
  body.has-tabbar #pilotPanel{
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 78px) !important;
  }
  body.has-tabbar .toast{
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 16px);
  }

  /* Tiroir / feuille ouvert : on efface le bouton flottant de l'Assistant IA
     (z-index 1000 en style inline) qui sinon flotte par-dessus tout. */
  .m-overlay-open #pilotToggle{ display: none !important; }
}

/* ==========================================================================
   3. FEUILLE BAS générique (.m-sheet) — menu « Plus », pickers…
   ========================================================================== */
.m-sheet-backdrop{
  position: fixed; inset: 0; z-index: 64;
  background: rgba(20, 20, 24, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.m-sheet-backdrop.show{ opacity: 1; pointer-events: auto; }

.m-sheet{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow);
  max-height: 84vh; overflow-y: auto;
  padding: 0 0 calc(env(safe-area-inset-bottom) + 14px);
  transform: translateY(100%);
  transition: transform .32s var(--m-ease-drawer);
}
.m-sheet.show{ transform: translateY(0); }
.m-sheet-grip{
  width: 36px; height: 4px; border-radius: 999px;
  background: var(--border-strong);
  margin: 9px auto 4px;
}
.m-sheet-head{
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 12px 10px 20px;
}
.m-sheet-head h2{ font-size: 15px; font-weight: 700; }
.m-sheet-close{
  background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 6px 10px; border-radius: 8px;
}
.m-sheet-close:active{ background: var(--surface-2); }
.m-sheet h3{
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 14px 20px 4px;
}
.m-sheet a{
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; min-height: 48px; box-sizing: border-box;
  color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600;
}
.m-sheet a .m-ico{ font-size: 18px; width: 22px; text-align: center; flex: none; }
.m-sheet a.active{ color: var(--accent); background: var(--accent-soft); }
.m-sheet a:active{ background: var(--surface-2); }

@media (max-width: 860px) and (prefers-reduced-motion: reduce){
  .m-sheet, .topbar nav#topbarNav{ transition: none; }
}

/* ==========================================================================
   4. TABLEAUX → CARTES  (mobile.js pose data-label + .is-cardable)
   ========================================================================== */
@media (max-width: 860px){

  .table-wrap.is-cardable{
    overflow: visible; border: none; box-shadow: none; background: none; cursor: auto;
    border-radius: 0;
  }
  .table-wrap.is-cardable table,
  .table-wrap.is-cardable tbody,
  .table-wrap.is-cardable tfoot,
  .table-wrap.is-cardable tr,
  .table-wrap.is-cardable td,
  .table-wrap.is-cardable tfoot th{ display: block; width: auto; }

  .table-wrap.is-cardable thead{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  .table-wrap.is-cardable tbody tr,
  .table-wrap.is-cardable tfoot tr{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    padding: 4px 2px;
  }
  .table-wrap.is-cardable tbody tr:hover td{ background: none; }
  .table-wrap.is-cardable tbody tr[onclick],
  .table-wrap.is-cardable tbody tr[data-href]{ cursor: pointer; }

  .table-wrap.is-cardable td,
  .table-wrap.is-cardable tfoot th{
    display: flex; gap: 14px; align-items: baseline; justify-content: space-between;
    padding: 9px 14px; border: none;
    font-size: 14px; text-align: right;
    white-space: normal; overflow-wrap: anywhere;
  }
  .table-wrap.is-cardable td + td,
  .table-wrap.is-cardable tfoot th + th{ border-top: 1px solid var(--border); }
  .table-wrap.is-cardable td::before,
  .table-wrap.is-cardable tfoot th::before{
    content: attr(data-label);
    flex: 0 0 40%; text-align: left;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    color: var(--muted);
  }
  .table-wrap.is-cardable td.is-blank::before{ content: ""; }
  .table-wrap.is-cardable tfoot th{ font-size: 14px; }
  .table-wrap.is-cardable td.is-actions{
    justify-content: flex-end; gap: 10px; flex-wrap: wrap;
    padding-top: 12px; text-align: right;
  }
  .table-wrap.is-cardable td.is-actions::before{ content: ""; flex: 0; }
  .table-wrap.is-cardable td.is-actions .btn-secondary,
  .table-wrap.is-cardable td.is-actions .btn-primary,
  .table-wrap.is-cardable td.is-actions button,
  .table-wrap.is-cardable td.is-actions a{ min-height: 40px; display: inline-flex; align-items: center; }

  .table-wrap.is-cardable .empty-row td{ text-align: center; }
  .table-wrap.is-cardable .empty-row td::before{ content: ""; display: none; }
  .table-wrap.is-cardable .empty-row td{ display: block; }

  /* Cellule vide (« — ») : n'apporte rien en carte, on la masque. */
  .table-wrap.is-cardable td.is-empty{ display: none; }

  /* Rangée pleine largeur (bouton « Afficher N autres », note de bas de liste). */
  .table-wrap.is-cardable tr.m-row-full{
    display: block; background: none; border: none; box-shadow: none;
    margin: 2px 0 14px; padding: 0;
  }
  .table-wrap.is-cardable tr.m-row-full td{
    display: block; width: auto; padding: 0; border: none; text-align: center;
  }
  .table-wrap.is-cardable tr.m-row-full td::before{ content: ""; display: none; }

  /* -- Mode COMPACT : tables « liste » (lignes → fiche au tap). Une entrée =
     un titre + ses champs non vides qui s'enroulent en dessous, au lieu d'un
     empilement label/valeur qui déroule sur des écrans. Les libellés sont
     gardés (petits) pour ne pas rendre des colonnes chiffrées ambiguës. -- */
  .table-wrap.is-cardable.is-compact tbody tr{
    position: relative;
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px;
    padding: 11px 14px; margin-bottom: 8px;
  }
  .table-wrap.is-cardable.is-compact tbody tr:has(td.is-actions){ padding-right: 46px; }
  .table-wrap.is-cardable.is-compact tbody td{
    display: inline-flex; align-items: baseline; gap: 5px;
    width: auto; padding: 0; border: none;
    font-size: 13px; text-align: left; white-space: normal; overflow-wrap: anywhere;
  }
  .table-wrap.is-cardable.is-compact tbody td::before{
    content: attr(data-label); flex: none;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    color: var(--muted);
  }
  .table-wrap.is-cardable.is-compact tbody td.is-primary{
    flex: 1 1 100%; font-size: 14.5px; font-weight: 600; color: var(--text);
  }
  .table-wrap.is-cardable.is-compact tbody td.is-primary::before{ content: ""; display: none; }
  .table-wrap.is-cardable.is-compact tbody td.is-blank,
  .table-wrap.is-cardable.is-compact tbody td.is-empty{ display: none; }
  .table-wrap.is-cardable.is-compact tbody td.is-actions{
    position: absolute; top: 8px; right: 8px; margin: 0; gap: 8px;
  }
  .table-wrap.is-cardable.is-compact tbody td.is-actions::before{ content: ""; display: none; }
  .table-wrap.is-cardable.is-compact tbody tr[onclick]:active{ background: var(--surface-2); }

  /* Tableaux volontairement laissés en défilement (matrice, sous-tables des
     vues frise/agenda). 1re colonne figée + amorti tactile. */
  .table-wrap:not(.is-cardable){
    -webkit-overflow-scrolling: touch;
  }
  .roles-matrix{ font-size: 12px; }

  /* -- Longue liste repliée (roster surtout) : bouton pour déplier -- */
  .m-list-toggle{
    display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-start;
    font: inherit; font-weight: 600; font-size: 14px;
    padding: 13px 16px; min-height: 48px; margin-bottom: 14px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); color: var(--text); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-list-toggle:active{ background: var(--surface-2); }
  .m-list-toggle .m-count{ color: var(--muted); font-weight: 600; }
  .m-list-toggle .m-caret{ margin-left: auto; color: var(--muted); transition: transform .15s ease; }
  .m-list-toggle[aria-expanded="true"] .m-caret{ transform: rotate(180deg); }
  .table-wrap.m-collapsed{ display: none; }
}

/* Sécurité : jamais visible / jamais replié côté bureau. */
@media (min-width: 861px){
  .m-list-toggle{ display: none !important; }
  .table-wrap.m-collapsed{ display: block; }
}

/* ==========================================================================
   5. FORMULAIRES & CIBLES TACTILES
   ========================================================================== */
@media (max-width: 860px){

  /* 16px = pas de zoom auto au focus sur iOS Safari. */
  input[type="text"], input[type="email"], input[type="password"], input[type="date"],
  input[type="time"], input[type="datetime-local"], input[type="number"], input[type="tel"],
  input[type="search"], textarea, select{
    font-size: 16px; padding: 11px 13px;
  }

  .btn-primary, .btn-secondary, .summary-btn{ min-height: 46px; }
  .btn-primary{ padding: 12px 18px; }

  /* Boutons pleine largeur dans les formulaires (plus faciles au pouce). */
  form .btn-primary:not(.m-inline),
  form button[type="submit"].btn-primary:not(.m-inline){
    width: 100%; justify-content: center;
  }

  .card{ padding: 18px 15px; }
  .card h2{ font-size: 15px; }

  .page-head{ gap: 12px; }
  .page-head h1{ font-size: 20px; }
  .page-head-title{ gap: 10px; }

  .field-row{ grid-template-columns: 1fr; }

  /* Onglets internes défilables plutôt qu'empilés. */
  .tabs-nav{ flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs-nav button{ white-space: nowrap; flex: none; }
  .seg-toggle{ flex-wrap: wrap; }

  .chip-text-input{ font-size: 16px; }
  .chip-remove{ width: 22px; height: 22px; font-size: 16px; }

  .project-grid{ grid-template-columns: 1fr; }
}

/* ==========================================================================
   6. MODALES → FEUILLES BAS
   ========================================================================== */
@media (max-width: 860px){
  /* Les modales/drawers de l'appli (z-index 20/15 dans style.css) doivent
     passer AU-DESSUS de la barre d'onglets (45) et du tiroir (60). */
  .modal-overlay{ z-index: 80 !important; }
  .drawer-overlay{ z-index: 78 !important; }
  .drawer-panel{ z-index: 79 !important; }
  /* Et on efface la barre d'onglets + le bouton IA tant qu'une de ces
     surfaces est ouverte (:has — Chrome/Safari récents ; sinon le z-index
     ci-dessus suffit à garder la modale utilisable). */
  body:has(.modal-overlay.show) .mobile-tabbar,
  body:has(.drawer-overlay.show) .mobile-tabbar,
  body:has(.modal-overlay.show) #pilotToggle,
  body:has(.drawer-overlay.show) #pilotToggle{ display: none !important; }
}

@media (max-width: 640px){

  .modal-overlay{ align-items: flex-end; padding: 0; }
  .modal-card{
    max-width: none; width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    padding: 20px 18px calc(env(safe-area-inset-bottom) + 20px);
    transform: translateY(100%) scale(1);
    transition: transform .32s var(--m-ease-drawer);
  }
  .modal-overlay.show .modal-card{ transform: translateY(0) scale(1); }
  .modal-actions{ flex-direction: column-reverse; align-items: stretch; }
  .modal-actions .btn-primary,
  .modal-actions .btn-secondary{ width: 100%; justify-content: center; }
  .modal-actions-right{ display: flex; flex-direction: column; gap: 8px; width: 100%; }

  /* Drawer (programmation / planning) : déjà plein écran < 700px dans style.css.
     On ajoute juste le respect des encoches. */
  .drawer-head{ padding-top: calc(env(safe-area-inset-top) + 16px); }
  .drawer-foot{ padding-bottom: calc(env(safe-area-inset-bottom) + 12px); }
  .drawer-foot{ flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .drawer-foot .btn-primary, .drawer-foot .btn-secondary{ width: 100%; justify-content: center; }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce){
  .modal-card{ transition: opacity .18s ease; }
}

/* ==========================================================================
   7. PLANNING — la vue « Chronologie » (déjà une liste par jour) est le
   défaut ; on la rend confortable et on borne la frise.
   ========================================================================== */
@media (max-width: 860px){

  #chronologie .table-wrap{ border: none !important; overflow: visible; }
  /* Lignes multi-colonnes sans <thead> → on « déplie » chaque ligne en un
     petit bloc : l'heure sur sa propre ligne, le reste qui s'enroule. */
  #chronologie table, #chronologie tbody, #chronologie tr, #chronologie td{ display: block; }
  #chronologie tbody tr{
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
    padding: 12px 14px; border-top: 1px solid var(--border);
  }
  #chronologie tbody tr:first-child{ border-top: none; }
  #chronologie tbody td{
    width: auto; padding: 2px 0; border: none; font-size: 13px;
    white-space: normal; overflow-wrap: normal;
  }
  #chronologie tbody td:first-child{
    width: 100%; font-weight: 700; font-size: 12px; color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  #chronologie tbody td:last-child{ width: 100%; text-align: right; white-space: nowrap; }
  #chronologie tbody tr:hover td{ background: none; }
  #chronologie .page-head{ flex-wrap: wrap; }
  #chronologie .page-head h2{ font-size: 14px; }

  /* Frise / Agenda : restent en défilement horizontal (secours). */
  .gantt-day-wrap, .agenda-wrap, .timeline-wrap{ -webkit-overflow-scrolling: touch; }
  .gantt-zoom button{ width: 34px; height: 34px; }

  /* La barre « Disponibles » du planning équipe : bande scrollable collante. */
  .planning-toolbar{ gap: 10px; padding: 10px; }
  #dispo-list{ flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  #dispo-list .team-chip{ flex: none; }
}

/* ==========================================================================
   8. PROGRAMMATION — vue « Déroulé » (construite par mobile.js depuis le DOM
   de la timeline). Bascule Déroulé / Timeline visible seulement en mobile.
   ========================================================================== */
.prog-run-order{ display: none; }
.prog-view-toggle{ display: none; }

@media (max-width: 860px){

  .prog-view-toggle{ display: inline-flex; margin-bottom: 14px; }

  /* Par défaut (déroulé) : timeline masquée, liste visible. */
  body.prog-mobile-list .timeline-wrap,
  body.prog-mobile-list .legend-row{ display: none; }
  body.prog-mobile-list .prog-run-order{ display: block; }

  .prog-run-order .prog-scene{
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow);
    margin-bottom: 14px; overflow: hidden;
  }
  .prog-run-order .prog-scene-head{
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    font-weight: 700; font-size: 13.5px;
  }
  .prog-run-order .prog-scene-dot{ width: 9px; height: 9px; border-radius: 50%; flex: none; }
  .prog-run-order .prog-passage{
    display: flex; align-items: baseline; gap: 12px;
    padding: 12px 14px; border-top: 1px solid var(--border);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .prog-run-order .prog-scene-head + .prog-passage{ border-top: none; }
  .prog-run-order .prog-passage:first-child{ border-top: none; }
  .prog-run-order .prog-passage:active{ background: var(--surface-2); }
  .prog-run-order .prog-passage-time{
    flex: none; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px;
    color: var(--muted); min-width: 92px;
  }
  .prog-run-order .prog-passage-body{ flex: 1; min-width: 0; }
  .prog-run-order .prog-passage-nom{ font-weight: 600; font-size: 14px; }
  .prog-run-order .prog-passage-style{ font-size: 12px; color: var(--muted); margin-top: 1px; }
  .prog-run-order .prog-empty{ padding: 14px; color: var(--muted); font-size: 13px; }
}

/* ==========================================================================
   9. PROJET (project.php) — tuiles en une colonne, réglages « ordinateur »
   masqués (bac de tuiles, poignées de redimensionnement).
   ========================================================================== */
@media (max-width: 860px){
  /* minmax(0,1fr) : sans le min 0, une seule colonne 1fr peut « exploser »
     à la largeur min-content d'une tuile (tableau, frise 7 jours…) et
     déborder l'écran. min-width:0 sur les enfants ferme la même faille. */
  #dashboardGrid{ grid-template-columns: minmax(0, 1fr) !important; }
  #dashboardGrid > *{ grid-column: auto !important; min-width: 0 !important; }
  #dashboardTray{ display: none !important; }
  .dashboard-block [data-resize-handle],
  .dashboard-block .resize-handle,
  .dash-resize{ display: none !important; }

  /* Tableaux d'aperçu DANS une tuile : cartes allégées (pas de double
     ombre/bordure marquée avec la tuile qui les contient). */
  .dashboard-block .table-wrap.is-cardable tbody tr{
    box-shadow: none; background: var(--surface-2); margin-bottom: 8px;
  }
}

/* ==========================================================================
   10. ÉQUIPES (team-form.php) — le board reste une grille 2D en défilement
   horizontal, mais 1re colonne (horaire) figée + colonnes plus étroites.
   ========================================================================== */
@media (max-width: 860px){
  .team-board-wrap{ -webkit-overflow-scrolling: touch; }
  .team-board td.slot-cell{ min-width: 128px; }
  .team-board .horaire-cell{
    position: sticky; left: 0; z-index: 3;
    background: var(--bg);
    padding-right: 8px;
  }
  .team-board thead th:first-child{ position: sticky; left: 0; z-index: 4; background: var(--bg); }
  .slot-empty{ padding: 10px 9px; }
  .team-chip{ padding: 7px 8px 7px 12px; }
}

/* ==========================================================================
   11. BACKOFFICE — pas de tabbar, mais bandeau latéral qui s'enroule et
   tableaux exploitables.
   ========================================================================== */
@media (max-width: 860px){
  .bo-content{ min-width: 0; }
  /* Le bandeau .bo-sidebar (sans id) du backoffice : enroulé, pas en scroll. */
  .bo-layout > .bo-sidebar:not(#boSidebar){
    flex-wrap: wrap; overflow: visible; cursor: auto;
    gap: 6px; padding: 12px;
  }
  .bo-layout > .bo-sidebar:not(#boSidebar) .bo-nav-item{
    flex: none; min-height: 40px;
  }
  .bo-layout > .bo-sidebar:not(#boSidebar) .bo-title{ width: 100%; }
}

/* ==========================================================================
   12. Divers confort tactile
   ========================================================================== */
@media (hover: none){
  .table-wrap, .timeline-wrap, .team-board-wrap, .bo-sidebar{ cursor: auto; }
}
@media (max-width: 860px){
  .shell{ padding-left: 14px; padding-right: 14px; }
  h1{ overflow-wrap: anywhere; }
  .alert{ font-size: 13px; }
  /* Évite tout débordement horizontal accidentel de la page. */
  html, body{ max-width: 100%; overflow-x: hidden; }
}
