/* ibcsc.be en application (PWA) : barre d'onglets du bas sur telephone et
   tablette en portrait, invitation a installer. Charge avec la refonte claire. */
.app-tabbar { display: none; }
@media (max-width: 760px) {
    body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
    .app-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid #e3e9ee; }
    .app-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 54px; padding: 5px 0 3px; border: 0; border-radius: 14px; background: none; color: #5b6e7d; text-decoration: none; font: 700 11px/1.1 Gilroy, system-ui, sans-serif; letter-spacing: .01em; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
    .app-tab-ic { position: relative; display: grid; place-items: center; width: 58px; height: 30px; border-radius: 15px; transition: background .2s, transform .15s; }
    .app-tab[aria-current], .app-tab[aria-expanded="true"] { color: #0e2233; }
    .app-tab[aria-current] .app-tab-ic, .app-tab[aria-expanded="true"] .app-tab-ic { background: #e0f2fe; color: #075985; }
    .app-tab[aria-current] .app-tab-ic svg { stroke-width: 2.2; }
    .app-tab:active .app-tab-ic { transform: scale(.9); }
    /* Le haut de page reste une barre de titre ; les elements flottants remontent au-dessus des onglets. */
    .to-top { bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
    .scroll-progress { display: none; }
    .site-nav.is-open { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
    .pwa-chip { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
.pwa-chip { position: fixed; left: 16px; bottom: 16px; z-index: 95; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: #0e2233; color: #fff; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); font: 700 14px Gilroy, system-ui, sans-serif; }
.pwa-chip button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 9px; }
.pwa-chip-go { padding: 10px 14px; }
.pwa-chip-go:hover, .pwa-chip-x:hover { background: rgba(255, 255, 255, .12); }
.pwa-chip-x { width: 36px; height: 36px; font-size: 20px; line-height: 1; }
@media (display-mode: standalone) {
    .pwa-chip { display: none; }
    html { overscroll-behavior-y: none; }
}

/* Safari (iOS 26) dessine la page sous la barre d'etat et sous sa barre
   d'adresse flottante : la barre de titre et les onglets prolongent leur
   fond au-dela du bord pour qu'aucune bande de contenu ne transparaisse. */
.site-header::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 240px; background: var(--L-header, #fff); pointer-events: none; }
@media (max-width: 760px) {
    .app-tabbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 240px; background: rgba(255, 255, 255, .97); pointer-events: none; }
    /* Les styles generiques de la refonte (pastilles, cadres) ne s'appliquent pas aux onglets. */
    .app-tabbar .app-tab, .app-tabbar .app-tab-label, .app-tabbar .app-tab-ic { border: 0 !important; box-shadow: none !important; outline-offset: 2px; }
    .app-tabbar .app-tab, .app-tabbar .app-tab-label { background: none !important; padding-left: 0 !important; padding-right: 0 !important; }
    .app-tabbar .app-tab-label { padding: 0 !important; border-radius: 0 !important; text-transform: none !important; letter-spacing: .01em !important; font-size: 11px !important; line-height: 1.1 !important; color: inherit !important; }
    .app-tabbar .app-tab::after, .app-tabbar .app-tab::before, .app-tabbar .app-tab-label::after, .app-tabbar .app-tab-label::before { content: none !important; }
}
/* Application installee : la barre de titre descend sous la barre d'etat. */
@media (display-mode: standalone) {
    .site-header { padding-top: env(safe-area-inset-top); }
}
@media (max-width: 760px) {
    html body .site-header { background: rgba(255, 255, 255, .985) !important; }
    .app-tabbar { background: rgba(255, 255, 255, .985); }
}
@media (max-width: 760px) {
    html body .site-header { background: #fff !important; }
    .app-tabbar { background: #fff !important; }
}
/* Safari rogne les pseudo-elements d'un element a backdrop-filter : sur
   telephone le fond est deja opaque, le flou est retire pour que les
   prolongements haut/bas soient dessines. */
@media (max-width: 760px) {
    html body .site-header, .app-tabbar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (max-width: 760px) { .app-tabbar::after, .mk-actionbar::after { background: #fff !important; } }
/* iOS : le calque de grain plein ecran (fixed, z-index 9999, anime, en
   multiply) passe au-dessus des barres et fausse la teinte que Safari donne
   aux zones de la barre d'etat et de la barre d'adresse ; le fond en
   background-attachment: fixed n'est pas gere non plus. Sur telephone et
   tablette : pas de grain, fond uni. */
@media (max-width: 1080px), (hover: none) {
    body::after { content: none !important; display: none !important; animation: none !important; }
    html { background: #f5f4f0; }
    body { background: #f5f4f0 !important; background-attachment: scroll !important; }
}

/* Programmes : le libelle du rail (« DEV / OPS ») se lit a la verticale le
   long du rail au lieu de s'empiler lettre par lettre dans 16 px. */
@media (max-width: 760px) {
    .training-path-rail small { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; margin-top: 6px; }
}

/* Tableaux d'articles (3 colonnes et plus) : une carte par ligne sur telephone,
   chaque valeur precedee de l'intitule de sa colonne (pose par app-shell.js). */
@media (max-width: 560px) {
    main table.is-stackable, main table.is-stackable tbody, main table.is-stackable tr, main table.is-stackable td { display: block; width: 100% !important; }
    main table.is-stackable { border: 0 !important; background: none !important; }
    main table.is-stackable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    main table.is-stackable tr { margin: 0 0 12px; padding: 12px 14px; border: 1px solid rgba(14, 34, 51, .12); border-radius: 12px; background: #fff; }
    main table.is-stackable td { padding: 6px 0 !important; border: 0 !important; text-align: left !important; }
    main table.is-stackable td + td { border-top: 1px dashed rgba(14, 34, 51, .12) !important; }
    main table.is-stackable td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: #5b6e7d; }
    main table.is-stackable td:first-child { font-weight: 700; font-size: 1.02rem; }
    main table.is-stackable td:first-child::before { display: none; }
    .techblog-table-wrap { overflow: visible !important; border: 0 !important; }
}

/* Signaler : la carte decorative depassait son conteneur de 30 px sur telephone. */
@media (max-width: 760px) { .form-intro .form-map { max-width: 100%; overflow: hidden; } .form-intro { overflow-x: clip; } }

/* Outils : l'atelier gardait 300 px de hauteur et 120 px pour un resultat
   encore vide ; le hibou du pied de page occupait 260 px. */
@media (max-width: 760px) {
    html body main .tools-workbench { min-height: 0 !important; }
    html body main .tool-result:empty { min-height: 0 !important; padding-top: 0 !important; }
    html body .footer-owl-cluster { display: flex !important; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
    html body .footer-owl { padding: 0 !important; }
    html body .footer-owl img { width: auto !important; height: 84px !important; }
}
@media (max-width: 760px) {
    html body footer.site-footer .footer-identity .footer-owl-cluster { display: flex !important; flex-direction: row-reverse !important; align-items: center !important; justify-content: space-between !important; gap: 12px !important; min-height: 0 !important; height: auto !important; }
    html body footer.site-footer .footer-identity .footer-owl { flex: 0 0 auto !important; width: auto !important; height: auto !important; min-height: 0 !important; padding: 0 !important; }
    html body footer.site-footer .footer-identity .footer-owl img { width: auto !important; height: 84px !important; max-height: 84px !important; }
    /* Social links on the left text edge (as on desktop), owl on the right; logos keep their own width. */
    html body footer.site-footer .footer-identity .footer-social-brands { width: auto !important; flex-wrap: nowrap !important; justify-content: flex-start !important; gap: 18px !important; }
    html body footer.site-footer .footer-identity .footer-social-brands > a { width: auto !important; min-width: 0 !important; }
}

/* Telephone, membre connecte : la messagerie est dans l'espace membre et le
   menu ; son lien texte dans la barre du haut elargissait la page (451 px). */
@media (max-width: 600px) {
    .site-header .header-account:not(.header-account-main) { display: none !important; }
}

/* 2026-10-03: on phones the bottom "Menu" tab opens the site menu, so the header burger is hidden.
   The button stays in the DOM: app-shell.js triggers it from the tab. */
@media (max-width: 760px) {
    body:has(.app-tabbar-site) .site-header .menu-toggle { display: none !important; }
    /* Opened menu: "Outils numériques" aligned with the group rows, Connexion shaped like Support. */
    .site-nav .nav-tools-direct { min-height: 54px; padding-inline: 3px !important; letter-spacing: -.005em !important; }
    html body .site-nav a.nav-account,
    html body .site-nav a.nav-cta { height: 48px !important; min-height: 48px !important; border-radius: 10px !important; }
}

/* PWA invitation, above the phone tab bar. */
.pwa-menu-install { display: none; }
.pwa-install-card[hidden], .pwa-menu-install[hidden] { display: none !important; }
@media (max-width: 760px) {
    html body .site-nav .pwa-menu-install {
        display: flex; align-items: center; min-height: 48px; width: 100%;
        padding: 12px; margin-top: 12px; border: 1px solid #c9d6de;
        border-radius: 10px; background: #f3f7fa; color: #0e2233;
        font: 700 .9rem/1.4 Gilroy, system-ui, sans-serif; cursor: pointer;
    }
    html body .pwa-install-card {
        position: fixed; z-index: 2100; left: 12px; right: 12px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        display: grid; grid-template-columns: 48px minmax(0, 1fr) 28px;
        gap: 10px 12px; max-width: 430px; margin-inline: auto; padding: 16px;
        border: 1px solid #d7e1e8; border-radius: 18px; background: #fff;
        color: #0e2233; box-shadow: 0 8px 32px rgba(4, 19, 31, .2);
        font: 400 14px/1.4 Gilroy, system-ui, sans-serif;
    }
    html body .pwa-install-icon { width: 48px; height: 48px; border-radius: 11px; }
    html body .pwa-install-copy strong { display: block; font-size: 15px; font-weight: 800; color: #0e2233; }
    html body .pwa-install-copy p { margin: 4px 0 0; color: #475b6b; font-size: 13px; line-height: 1.4; }
    html body .pwa-install-card button { font-family: inherit; cursor: pointer; text-transform: none; letter-spacing: 0; }
    html body .pwa-install-close { width: 32px; min-height: 44px; margin: -8px -8px 0 0; border: 0; background: none; color: #475b6b; font-size: 25px; padding: 0; }
    html body .pwa-install-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 8px; }
    html body .pwa-install-go { flex: 1 1 190px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: #0e2233; color: #fff; font-size: 13px; font-weight: 700; }
    html body .pwa-install-later { min-height: 44px; padding: 8px; border: 0; background: none; color: #475b6b; font-size: 13px; font-weight: 600; }
}
html body dialog.pwa-guide {
    width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 40px);
    box-sizing: border-box; padding: 28px 24px 24px; margin: auto;
    overflow-y: auto; border: 1px solid #d7e1e8; border-radius: 20px;
    background: #fff; color: #0e2233; box-shadow: 0 20px 80px rgba(4, 19, 31, .3);
    font-family: Gilroy, system-ui, sans-serif;
}
html body dialog.pwa-guide:not([open]) { display: none; }
html body dialog.pwa-guide::backdrop { background: rgba(4, 19, 31, .6); }
html body .pwa-guide-icon { width: 64px; height: 64px; border-radius: 15px; margin-bottom: 16px; }
html body .pwa-guide h2 { margin: 0 0 10px; font-size: 1.45rem; line-height: 1.2; color: #0e2233; }
html body .pwa-guide p { color: #475b6b; font-size: .9rem; line-height: 1.5; margin: 0 0 20px; }
html body .pwa-guide-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: #f3f7fa; color: #475b6b; font-size: 26px; cursor: pointer; }
html body .pwa-guide-steps { padding-left: 24px; margin: 20px 0; color: #0e2233; }
html body .pwa-guide-steps li { padding-left: 6px; margin-bottom: 16px; font-size: .95rem; line-height: 1.5; }
html body .pwa-guide-steps li::marker { color: #075985; font-weight: 800; }
html body .pwa-guide .pwa-guide-note { font-size: .8rem; padding-top: 16px; border-top: 1px solid #d7e1e8; }
html body .pwa-guide-done { display: block; width: 100%; min-height: 48px; border: 0; border-radius: 10px; background: #0e2233; color: #fff; font: 700 .95rem Gilroy, system-ui, sans-serif; cursor: pointer; }
.pwa-install-card button:focus-visible, .pwa-guide button:focus-visible, .pwa-menu-install:focus-visible { outline: 3px solid #0284c7; outline-offset: 3px; }
@media (display-mode: standalone) { .pwa-install-card, .pwa-menu-install { display: none !important; } }
