/* Affichage mobile : corrections des chevauchements (paquet mct_mobile_fix). Chargé après portail-pro.css, donc à spécificité égale c'est cette feuille qui l'emporte. */

/* 1. Accueil : sur téléphone, portail-pro.css gardait des rangées de 124 px pour les tuiles alors que la page n'a plus qu'une colonne ;
      les tuiles plus hautes (événements, couvertures) débordaient sur la suivante. La hauteur suit maintenant le contenu. */
@media (max-width: 520px) {
  body.pro .bento { grid-auto-rows: auto; }
  body.pro .bento-tile { min-height: 0; }
  body.pro .bento-tile.cov { min-height: 232px; }
  body.pro .bento-tile.evh { min-height: 320px; }
}

/* 2. Onglet « Notes » des dossiers : il était collé au bord droit et recouvrait les cartes et les tableaux ; sur téléphone c'est un petit bouton en bas à gauche. */
@media (max-width: 720px) {
  body .sn-tab { top: auto; bottom: 14px; left: 14px; right: auto; transform: none; width: auto; height: 44px; padding: 0 16px 0 12px; flex-direction: row; gap: 8px; border-radius: 22px; box-shadow: 0 6px 18px -6px #00000066; }
  body .sn-tab span { writing-mode: horizontal-tb; }
  /* 3. Bas de page : les liens (cookies, visite) restent lisibles au-dessus de la bulle de l'assistant et du bouton Notes. */
  body.pro .mc-foot { padding-bottom: 96px !important; line-height: 1.9; }
  body.pro .mc-foot a { display: inline-block; }
}

/* 4. Bandeau de cookies : plus compact sur téléphone (il couvrait près de la moitié de l'écran) ; « Tout refuser » et « Tout accepter » côte à côte, « Personnaliser » dessous. */
@media (max-width: 560px) {
  .mcc { padding: 12px 14px; gap: 8px; max-height: 66vh; }
  .mcc-txt strong { font-size: 14px; }
  .mcc-txt p { font-size: 12.5px; line-height: 1.4; margin-bottom: 2px; }
  .mcc .mcc-btns { gap: 8px; }
  html[data-theme] body.pro .mcc .mcc-btns button, .mcc .mcc-btns button { box-sizing: border-box; flex: 1 1 calc(50% - 6px); min-width: 0; min-height: 40px; padding: 0 10px; }
  .mcc .mcc-btns .mcc-alt { order: 3; flex-basis: 100%; }
}
/* 5. Une seule fenêtre à la fois : tant que le bandeau de cookies est affiché, la fenêtre des notifications attend (elle apparaît dès le choix fait). */
body:has(.mcc) .notif-popup-overlay { display: none !important; }

/* 6. Liste des fichiers d'un dossier : sur téléphone, une ligne par fichier (nom, puis type · taille · date) avec le bouton « Actions » à droite,
      au lieu d'un tableau à cinq colonnes qui défilait de côté et cachait les actions. */
@media (max-width: 720px) {
  table.files-table, body.pro table.files-table { display: block; width: 100%; overflow: visible; white-space: normal; }
  body.pro table.files-table thead { display: none; }
  body.pro table.files-table tbody { display: block; }
  body.pro table.files-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; padding: 9px 0; border-bottom: 1px solid var(--divider, #0000000f); }
  body.pro table.files-table tr:hover td { background: transparent; }
  body.pro table.files-table td { display: block; padding: 0; border: 0; min-width: 0; }
  body.pro table.files-table td.file-row { display: block; grid-column: 1; grid-row: 1; overflow-wrap: anywhere; line-height: 1.35; }
  body.pro table.files-table td.file-row .file-sub { display: block; margin-top: 2px; font-size: .76rem; color: var(--muted, #5b6068); text-decoration: none; }
  body.pro table.files-table td.meta { display: none; }
  body.pro table.files-table td.act-cell { grid-column: 2; grid-row: 1; justify-self: end; }
}
.files-table .file-sub { display: none; }
