/* TiberIA.OS 2.12.1 : la version mobile du site et les corrections du rapport de tests de Sylvain (25/11/2026).
   La version ordinateur ne change pas, sauf les corrections (débordement, flèches, contraste, taille du texte). */

/* ---------- 1. Plus aucun débordement sur le côté ----------
   Les carrousels élargissaient toute la page (jusqu'à 7 000 px) : cartes coupées sur téléphone, flèche de droite
   hors de l'écran, contraste élevé appliqué à moitié, « Tout afficher » collé au bord. */
html,body{max-width:100%;overflow-x:hidden}
@supports (overflow:clip){html,body{overflow-x:clip}}
#carrousels211{grid-template-columns:minmax(0,1fr)}
.car211,.car211-cadre,.car211-piste,#liste,.filtres,.puces,.section,.wrap,.view,main{min-width:0}

/* ---------- 2. Carrousels : flèches au-dessus, jamais sur les cartes ---------- */
.car211-cadre > .car211-fl{display:none!important}
.car211-tete{gap:10px 12px}
.car2121-nav{display:flex;align-items:center;gap:8px;margin-left:auto;padding-right:2px}
.car2121-nav .car211-tout{margin-left:4px}
.car2121-fl{width:40px;height:40px;border-radius:50%;border:1px solid rgba(255,255,255,.25);background:rgba(9,14,27,.92);color:#fff;font:400 24px/1 var(--f-ui,system-ui);cursor:pointer;display:grid;place-items:center;padding:0 0 3px}
.car2121-fl:disabled{opacity:.3;cursor:default}
.car2121-fl:not(:disabled):hover,.car2121-fl:focus-visible{border-color:#FFC21A;color:#FFC21A;outline:none}
.car211-piste{scroll-snap-type:x proximity;scroll-padding-inline:2px;padding-inline:2px}
.car211-el{scroll-snap-stop:normal}

/* Types vides dans une catégorie : grisés, avec leur nombre */
.seg [data-act="type"] .n2121{margin-left:5px;font-size:.82em;opacity:.75}
.seg [data-act="type"][aria-disabled="true"]{opacity:.38;cursor:not-allowed}

/* ---------- 3. Menu du haut : il se replie quand il ne tient plus (texte agrandi, fenêtre étroite) ---------- */
.topbar-in.site{min-width:0}
html.nav2121-compacte .nav.principal{display:none;position:absolute;top:100%;left:0;right:0;background:rgba(6,10,21,.97);border-bottom:1px solid var(--line);padding:8px max(16px,env(safe-area-inset-right,0px)) 12px max(16px,env(safe-area-inset-left,0px));flex-direction:column;align-items:stretch;max-height:calc(100vh - 70px);overflow-y:auto;box-shadow:0 18px 40px rgba(0,0,0,.55)}
html.nav2121-compacte .nav.principal.ouvert{display:flex}
html.nav2121-compacte .nav a{padding:11px 12px;font-size:15px}
html.nav2121-compacte .menu-btn{display:grid}
html.nav2121-compacte .nav-plus,html.nav2121-compacte .nav-plus-liste{display:contents}
html.nav2121-compacte .nav-plus-btn{display:none}
html.nav2121-compacte .credits-chip .mot{display:none}

/* ---------- 4. Accessibilité ---------- */
/* Les anciens réglages A+ et A++ (zoom du corps de page) sont remplacés par la taille en pourcentage. */
html[data-a11y-texte] body{zoom:normal!important}
.a11y2121{display:grid;gap:14px}
.a11y2121 h2{margin:0}
.a11y2121 .petit{font-size:13.5px;margin:0}
.taille2121{display:grid;gap:8px}
.taille2121-boutons{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.taille2121-boutons button{min-height:44px;padding:0 4px;font-weight:700}
.taille2121-boutons [aria-pressed="true"]{background:#FFC21A!important;color:#111!important;border-color:#FFC21A!important}
.a11y2121-ligne{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:15.5px;min-height:40px}
.a11y2121-ligne input{width:22px;height:22px;flex:0 0 22px;accent-color:#FFC21A}
.a11y2121 .lire2121{width:100%;min-height:48px;justify-content:center}
.a11y2121 .lire2121[aria-pressed="true"]{border-color:#FFC21A;color:#FFC21A}
.a11y2121-bas{display:flex;flex-wrap:wrap;gap:8px}
/* Bandeau pendant la lecture à voix haute */
.lecture2121{position:fixed;z-index:95;left:50%;transform:translateX(-50%);top:calc(10px + env(safe-area-inset-top,0px));display:flex;align-items:center;gap:10px;padding:8px 10px 8px 14px;border-radius:999px;background:#0d1530;border:1px solid #FFC21A;color:#fff;font-size:14.5px;box-shadow:0 10px 30px rgba(0,0,0,.5);max-width:calc(100vw - 24px)}
.lecture2121 button{font:inherit;font-weight:700;border:0;border-radius:999px;padding:7px 12px;background:#FFC21A;color:#111;cursor:pointer}

/* Contraste renforcé : vraiment sur toute la page (fond étoilé, panneaux, côtés, barre du bas compris) */
html.a11y-contraste,html.a11y-contraste body{background:#000!important}
html.a11y-contraste .cosmos,html.a11y-contraste body::before,html.a11y-contraste body::after{display:none!important}
html.a11y-contraste body :where(*:not(svg, svg *, img, video, canvas, .disk, .disk *, .spot2121)){background-image:none!important;background-color:#000!important;color:#fff!important;text-shadow:none!important;box-shadow:none!important}
html.a11y-contraste body :where(*:not(svg *, .disk, .disk *)){border-color:#fff!important}
html.a11y-contraste a,html.a11y-contraste a *{color:#FFE066!important}
html.a11y-contraste .btn-primary,html.a11y-contraste .btn211,html.a11y-contraste .ok,html.a11y-contraste [aria-pressed="true"],html.a11y-contraste [aria-current="page"],html.a11y-contraste .credits-chip,html.a11y-contraste .aide-bulle,html.a11y-contraste .lecture2121 button{background-color:#FFE066!important;color:#000!important}
html.a11y-contraste .btn-primary *,html.a11y-contraste [aria-pressed="true"] *,html.a11y-contraste [aria-current="page"] *,html.a11y-contraste .credits-chip *,html.a11y-contraste .aide-bulle *{color:#000!important;background-color:transparent!important}
html.a11y-contraste #boutons211 button,html.a11y-contraste #boutons211 button *{background-color:#000!important;color:#fff!important}
html.a11y-contraste #boutons211 button[aria-pressed="true"]{color:#FFE066!important;border-color:#FFE066!important}
html.a11y-contraste input,html.a11y-contraste textarea,html.a11y-contraste select{border:2px solid #fff!important}
html.a11y-contraste ::placeholder{color:#ccc!important}
html.a11y-contraste .spot2121{box-shadow:0 0 0 4px #FFE066,0 0 0 9999px rgba(0,0,0,.7)!important}

/* ---------- 5. La visite guidée : la case de l'étape est éclairée, la bulle reste dans l'écran ---------- */
.spot2121{position:fixed;z-index:88;pointer-events:none;border-radius:12px;box-shadow:0 0 0 3px #FFC21A,0 0 0 8px rgba(255,194,26,.28),0 0 0 9999px rgba(2,4,10,.62);transition:left .25s ease,top .25s ease,width .25s ease,height .25s ease}
.tour2121{position:fixed!important;z-index:90;width:min(320px,calc(100vw - 24px));max-height:min(70vh,520px);overflow:auto}
.tour2121 .anim211{max-height:120px;object-fit:contain}
.tour2121-points{display:flex;gap:4px;flex-wrap:wrap}
.tour2121-points i{width:7px;height:7px;border-radius:50%;background:rgba(255,255,255,.22)}
.tour2121-points i.fait{background:#FFC21A}
html.a11y-calme .spot2121{transition:none}
@media (prefers-reduced-motion:reduce){.spot2121{transition:none}}

/* La bulle de bienvenue ne cache plus les boutons ♿ et ?, ni les fenêtres */
.intro211{bottom:calc(140px + env(safe-area-inset-bottom,0px));z-index:45}

/* Découpe : « 1 » puis « tôle de 3000 × 1500 mm » sur la ligne suivante (on lisait « 13000×1500 ») */
.chiffre .format2121{display:block;margin-top:2px}

/* Temps d'attente d'une disquette IA */
.attente2121{display:block;margin-top:6px;color:#9AA6BD;font-size:14px}

/* Formulaire de rétractation : champs à remplir clairement indiqués */
.form2121{display:grid;gap:8px;margin:10px 0 0;padding:14px 16px;border-left:3px solid #7CC4FF;background:rgba(124,196,255,.06);border-radius:0 10px 10px 0}
.form2121 p{margin:0}
.form2121 .champ2121{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.form2121 .champ2121 b{font-weight:650}
.form2121 .vide2121{flex:1 1 160px;min-width:120px;border-bottom:1px dashed #9AA6BD;color:#9AA6BD;font-style:italic;font-size:13px;padding-bottom:2px}
.contact2121{margin-top:18px;padding:14px 16px;border:1px solid var(--line);border-radius:12px}

/* Choix « version mobile / version ordinateur » en bas de page */
.affichage2121{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 12px;margin-top:10px;font-size:13.5px;color:#9AA6BD}
.affichage2121 button{font:inherit;background:none;border:0;padding:4px 2px;color:#7CC4FF;text-decoration:underline;cursor:pointer}
.affichage2121 button[aria-pressed="true"]{color:#fff;text-decoration:none;font-weight:700}

/* ======================================================================
   6. LA VERSION MOBILE (écran de 760 px ou moins, quand « Version ordinateur » n'est pas choisie)
   ====================================================================== */
@media (max-width:760px){
  /* En-tête compact : rien ne dépasse, le menu ☰ contient le reste */
  .topbar-in.site{gap:6px;flex-wrap:nowrap}
  .topbar-in.site > *{flex-shrink:0}
  .topbar-in.site .brand{min-width:0;flex-shrink:1;overflow:hidden;text-overflow:ellipsis}
  .credits-chip{padding:5px 8px;font-size:13px}
  .iconbtn{min-width:40px;min-height:40px}

  /* Titres et marges */
  .gut{padding-left:max(14px,env(safe-area-inset-left,0px));padding-right:max(14px,env(safe-area-inset-right,0px))}
  .h1-sm,.section-head h1{font-size:28px;line-height:1.15}
  .section-head p{font-size:15.5px}

  /* Recherche et filtres : pleine largeur, sur une ligne chacun */
  .filtres{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
  .filtres .search{width:100%}
  .filtres .seg{display:flex;flex-wrap:wrap;width:100%;gap:2px}
  .filtres .seg button{flex:1 1 auto;min-height:44px;padding-inline:10px;white-space:nowrap}
  .puces{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:8px;padding:2px 2px 8px;scrollbar-width:none;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
  .puces::-webkit-scrollbar{display:none}
  .puces .puce{flex:0 0 auto;scroll-snap-align:start;min-height:40px}

  /* Carrousels : une carte bien visible, la suivante dépasse un peu pour inviter à glisser */
  #carrousels211{gap:30px}
  .car211-tete{flex-wrap:nowrap;margin-bottom:10px}
  .car211-tete h2{font-size:19px;gap:9px;min-width:0}
  .car211-tete h2 span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .car211-pin{width:30px;height:30px;flex-basis:30px}
  .car211-n{display:none}
  .car2121-fl{display:none}
  .car2121-nav{padding-right:0}
  .car211-tout{white-space:nowrap}
  .car211-piste{gap:12px;padding:2px 2px 6px;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain}
  .car211-piste::-webkit-scrollbar{display:none}
  .car211-el{flex:0 0 min(80%,300px);scroll-snap-align:start}
  .car211-el .dcard-art{padding:12px 0 10px}
  .car211-el .dcard-art .disk{width:84px}
  .car211-el .dcard-body{padding:12px 14px 14px;gap:7px}
  .car211-el .dcard-top h3{font-size:16px}
  .car211-el .dcard-desc{font-size:14px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .dcard,.dcard *{overflow-wrap:anywhere}

  /* Grille « Tout afficher » et résultats de recherche : une carte par ligne, compacte */
  #liste .grid{grid-template-columns:minmax(0,1fr)!important;gap:12px}
  #liste .dcard{flex-direction:row}
  #liste .dcard-art{width:96px;flex:0 0 96px;padding:12px 0;border-bottom:0;border-right:1px solid var(--line)}
  #liste .dcard-art .disk{width:64px}
  #liste .dcard-body{padding:12px 14px}
  #liste .dcard-desc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:14px}

  /* Boutons flottants plus discrets, au-dessus de la barre d'onglets */
  #boutons211{flex-direction:row;gap:8px;left:max(10px,env(safe-area-inset-left,0px));bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  #boutons211 button{width:40px;height:40px;background:rgba(13,21,48,.94)}
  #boutons211 button svg{width:20px;height:20px}
  body.avec-onglets #boutons211{bottom:calc(76px + env(safe-area-inset-bottom,0px))}
  .intro211{left:10px;right:10px;width:auto;bottom:calc(64px + env(safe-area-inset-bottom,0px))}
  body.avec-onglets .intro211{bottom:calc(126px + env(safe-area-inset-bottom,0px))}
  .intro211 .anim211{max-height:72px}
  .aide-bulle{width:50px;height:50px}
  body{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}
  body.avec-onglets{padding-bottom:calc(128px + env(safe-area-inset-bottom,0px))}

  /* Fenêtres : en feuille du bas, jamais plus hautes que l'écran visible */
  .sheet{max-height:92dvh;padding-top:18px}

  /* Visite guidée : la bulle devient une feuille en bas (ou en haut) de l'écran */
  .tour2121{left:10px!important;right:10px!important;width:auto;max-height:46dvh}
  .tour2121 .anim211{max-height:84px}

  /* Pages : tableaux et blocs larges défilent dans leur cadre au lieu de pousser la page */
  table{display:block;max-width:100%;overflow-x:auto}
  pre,code{white-space:pre-wrap;overflow-wrap:anywhere}
  .fiche-side .kv{font-size:14px}
}

/* Très petits écrans */
@media (max-width:380px){
  .car211-el{flex-basis:86%}
  .lecture2121{font-size:13px}
}
