/* Bayān 10.12 — menus mobiles cohérents + corrections de contraste ciblées. */

.bayaan-mobile-tabs-toggle{display:none}

/* Contraste explicite pour les colonnes de l'étude comparée. */
html[data-bayaan-theme] .v7-study-corpus{
  background:var(--bayaan-surface)!important;
  color:var(--bayaan-text)!important;
  border-color:var(--bayaan-border-strong)!important;
}
html[data-bayaan-theme] .v7-study-corpus>summary{
  background:var(--bayaan-action-bg)!important;
  color:var(--bayaan-action-text)!important;
  border-color:var(--bayaan-action-bg)!important;
}
html[data-bayaan-theme] .v7-study-corpus>summary :is(h1,h2,h3,h4,strong,b,span){
  color:var(--bayaan-action-text)!important;
}
html[data-bayaan-theme] .v7-study-corpus>summary .v7-study-chevron{
  color:var(--bayaan-action-text)!important;
  background:color-mix(in srgb,var(--bayaan-action-text) 16%,transparent)!important;
}
html[data-bayaan-theme] .v7-study-corpus-body{
  background:var(--bayaan-surface)!important;
  color:var(--bayaan-text)!important;
}
html[data-bayaan-theme] .v7-study-corpus .v7-column-empty{
  display:block!important;
  background:var(--bayaan-surface-2)!important;
  color:var(--bayaan-text)!important;
  border-radius:8px!important;
  padding:6px 4px!important;
}

/* Onglets de recherche : contraste uniforme même avant transformation mobile. */
html[data-bayaan-theme] :is(.v100-tabs,.v90-tabs,.v90c-tabs,.v7-tabs,.v7-workspace-tabs){
  background:var(--bayaan-surface-2)!important;
  color:var(--bayaan-text)!important;
  border-color:var(--bayaan-border-strong)!important;
}
html[data-bayaan-theme] :is(.v100-tabs,.v90-tabs,.v90c-tabs,.v7-tabs,.v7-workspace-tabs) button{
  color:var(--bayaan-text)!important;
  background:transparent!important;
  border-color:transparent!important;
  opacity:1!important;
}
html[data-bayaan-theme] :is(.v100-tabs,.v90-tabs,.v90c-tabs,.v7-tabs,.v7-workspace-tabs) button.active{
  color:var(--bayaan-action-text)!important;
  background:var(--bayaan-action-bg)!important;
  border-color:var(--bayaan-action-bg)!important;
}

@media(max-width:900px){
  /* Le menu Bayān reste strictement vertical : aucune feuille historique ne peut le remettre en grille. */
  #mainNav.main-nav.mobile-open{
    display:flex!important;
    flex-direction:column!important;
    grid-template-columns:none!important;
    grid-auto-flow:row!important;
    align-items:stretch!important;
    overflow-x:hidden!important;
  }
  #mainNav.main-nav.mobile-open :is(.nav-tab,.nav-method-tab){
    width:100%!important;
    min-width:0!important;
    justify-content:flex-start!important;
    text-align:left!important;
  }

  /* Les grandes barres d'onglets deviennent un vrai menu mobile repliable. */
  .bayaan-mobile-tabs-shell{
    position:relative!important;
    width:100%!important;
    min-width:0!important;
    z-index:30;
  }
  .bayaan-mobile-tabs-toggle{
    width:100%!important;
    min-height:50px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    padding:11px 14px!important;
    border:1px solid var(--bayaan-border-strong)!important;
    border-radius:16px!important;
    background:var(--bayaan-surface)!important;
    color:var(--bayaan-text)!important;
    font:800 16px/1.2 Inter,system-ui,sans-serif!important;
    box-shadow:var(--bayaan-shadow)!important;
    cursor:pointer!important;
  }
  .bayaan-mobile-tabs-toggle::after{
    content:'⌄';
    color:var(--bayaan-emphasis)!important;
    font-size:20px!important;
    transition:transform .18s ease;
  }
  .bayaan-mobile-tabs-toggle[aria-expanded="true"]::after{transform:rotate(180deg)}
  .bayaan-mobile-tabs-toggle small{
    color:var(--bayaan-muted)!important;
    font-size:11px!important;
    font-weight:700!important;
    margin-left:auto!important;
  }
  .bayaan-mobile-tabs-list{
    display:none!important;
    width:100%!important;
    max-width:100%!important;
    margin:7px 0 0!important;
    padding:8px!important;
    flex-direction:column!important;
    grid-template-columns:1fr!important;
    grid-auto-flow:row!important;
    gap:5px!important;
    overflow:visible!important;
    border:1px solid var(--bayaan-border-strong)!important;
    border-radius:16px!important;
    background:var(--bayaan-surface)!important;
    color:var(--bayaan-text)!important;
    box-shadow:0 18px 42px color-mix(in srgb,var(--bayaan-text) 16%,transparent)!important;
  }
  .bayaan-mobile-tabs-list.bayaan-mobile-tabs-open{display:flex!important}
  .bayaan-mobile-tabs-list>button{
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    align-items:center!important;
    justify-content:flex-start!important;
    text-align:left!important;
    white-space:normal!important;
    border-radius:12px!important;
    padding:10px 12px!important;
    color:var(--bayaan-text)!important;
    background:var(--bayaan-surface-2)!important;
    border:1px solid transparent!important;
  }
  .bayaan-mobile-tabs-list>button.active{
    color:var(--bayaan-action-text)!important;
    background:var(--bayaan-action-bg)!important;
    border-color:var(--bayaan-action-bg)!important;
  }

  /* Les barres Research OS / Research Lab ne doivent plus conserver le scroll horizontal de 10.5. */
  :is(.v100-tabs,.v90-tabs,.v90c-tabs,.v7-tabs,.v7-workspace-tabs).bayaan-mobile-tabs-list{
    overflow-x:hidden!important;
    scrollbar-width:none!important;
  }
  :is(.v100-tabs,.v90-tabs,.v90c-tabs,.v7-tabs,.v7-workspace-tabs).bayaan-mobile-tabs-list>button{
    flex:0 0 auto!important;
  }

  /* Lecture et contenus de recherche : aucun texte secondaire trop proche du fond. */
  html[data-bayaan-theme] :is(.v100-empty,.v100-history small,.v100-toolbar small,.v7-column-empty,.v7-compare-method){
    color:var(--bayaan-muted)!important;
    opacity:1!important;
  }
}
