/* Stones Partners — adaptation téléphone (Stones, pas l'associé).
   Chargée après site.css sur toutes les pages par scripts/import-site.py, donc conservée à chaque nouvelle livraison.
   Principe : sur petit écran, on ne se contente pas d'empiler les blocs du bureau. On resserre les espacements,
   on passe les séries de cartes en défilement horizontal, on retire les maquettes illisibles une fois réduites,
   et on replie les questions fréquentes. */

@media (max-width: 700px) {

  /* ── 1. Espacements verticaux : moitié moins qu'au bureau ───────────────────────────── */
  .mp-head { padding: 44px 20px 24px !important; }
  .sx { padding: 44px 20px 24px !important; }
  .ref { padding: 40px 20px !important; gap: 20px !important; }
  .ed, .mp-two { padding: 40px 20px !important; }
  .mp-blk-h { padding: 36px 20px 24px !important; }
  .mp-band { padding: 22px 20px !important; gap: 14px !important; }
  .mp-cta-in { padding: 56px 20px 44px !important; }
  .hx-in { padding-bottom: 40px !important; }
  .hx .mp-eyebrow { margin-top: 24px !important; }
  .hx-vis { margin-top: 28px !important; }
  .mp-dhero-in { padding-bottom: 44px !important; }
  .lg-top { padding: 40px 20px 28px !important; }
  .lg-body { padding: 0 20px 48px !important; }
  .ckl { padding: 0 20px 40px !important; }
  .cmp-w { padding-bottom: 32px !important; }
  .rp { padding: 18px !important; }

  /* cartes : marges internes resserrées */
  .mp-fc, .mp-cu, .mp-st, .mp-co, .sc, .qc, .nt > div, .lv > div, .fl > div, .dpt > div, .vs > div, .qa > div { padding: 20px 20px 22px !important; }
  .svc > div { padding: 22px 20px !important; }
  .mp-xc { padding: 20px !important; }
  .mp-xs { padding: 24px 20px !important; }
  .io > div { padding: 16px 20px !important; }

  /* étapes de la méthode : une ligne d'en-tête et trois cellules compactes */
  .rw > div { padding: 14px 20px 16px !important; }
  .rw > div:first-child { padding-top: 24px !important; }

  /* sections de la page d'accueil écrites avec des styles en ligne */
  [style*="padding: clamp(80px, 9vw, 128px)"] { padding-top: 44px !important; }
  [style*="clamp(48px, 5vw, 64px)"] { padding-bottom: 24px !important; }
  [style*="clamp(64px, 7vw, 96px)"] { padding-bottom: 28px !important; }
  [style*="padding: clamp(96px, 11vw, 160px)"] { padding-top: 52px !important; }
  [style*="padding: clamp(64px, 8vw, 112px)"] { padding-top: 40px !important; padding-bottom: 40px !important; }
  [style*="padding: clamp(48px, 6vw, 80px)"] { padding-top: 32px !important; padding-bottom: 32px !important; }
  [style*="clamp(56px, 6vw, 80px)"] { padding-bottom: 36px !important; }
  [style*="padding: clamp(72px, 9vw, 120px)"], [style*="padding: clamp(72px, 8vw, 112px)"] { padding-top: 44px !important; }
  [style*="padding: clamp(96px, 12vw, 176px)"] { padding-top: 56px !important; padding-bottom: 48px !important; }
  [style*="padding: clamp(48px, 6vw, 88px)"] { padding-top: 36px !important; padding-bottom: 28px !important; }
  [style*="padding: clamp(40px, 5vw, 64px)"] { padding-top: 28px !important; padding-bottom: 28px !important; }
  /* hauteurs minimales pensées pour des colonnes côte à côte */
  [style*="min-height: 200px"] { min-height: 0 !important; }
  [data-g="pc"] { gap: 20px 0 !important; padding-bottom: 32px !important; }
  [data-g="pn"] { padding: 28px 20px !important; gap: 16px !important; }
  [data-g="qq"] { padding-top: 44px !important; padding-bottom: 44px !important; }
  [data-g="kh"] [style*="height: clamp(200px, 22vw, 320px)"] { height: 120px !important; margin-top: 20px !important; }

  /* ── 1 bis. Maquette du haut de page : les écrans 1 et 2 ont une version téléphone (mobile-snippets/hero-*.html),
     la rotation reste celle de site.js ; le corps « bureau » de ces deux écrans est masqué ── */
  #top div[data-scene="1"][style*="flex: 1"]:not(.stn-mob),
  #top div[data-scene="2"][style*="flex: 1"]:not(.stn-mob) { display: none !important; }
  #top .mb-scene.is-on { display: flex !important; }
  /* barre du haut de la fenêtre : on retire la date pour que le fil d'Ariane tienne sur une ligne */
  #top span[data-scene] ~ span[style*="color: #687284"]:last-child, #top div:has(> span > span[data-scene]) > span[style="color: #687284"] { display: none !important; }
  .stn-hstage { height: 460px !important; margin-top: 28px !important; }
  .stn-hsticky { padding-bottom: 24px !important; }

  /* ── 2. Logiciels compatibles : trois colonnes basses au lieu de deux colonnes de 88 px ── */
  .stn-logos { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .stn-logos > div { height: 52px !important; font-size: 14px !important; padding: 0 4px; text-align: center; line-height: 1.15; }
  .stn-logos > div:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
  .stn-logos > div:last-child:nth-child(3n+2) { grid-column: span 2; }

  /* ── 3. Séries de cartes en défilement horizontal ────────────────────────────────────── */
  /* accueil : les trois métiers, les situations « aujourd'hui / avec Stones » ;
     sous-pages : grilles de trois cartes ou plus (exemples, solutions, engagements) */
  #expertises > div > div:nth-child(2),
  #cas-usage .mp-grid,
  .mp-grid.mp-g3:has(> :nth-child(3)),
  .mp-grid.mp-g4:has(> :nth-child(3)) {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    align-items: flex-start !important;
    scroll-padding: 0 20px;
    gap: 12px !important;
    margin: 0 !important;
    padding: 4px 20px 22px !important;
    background: transparent !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #expertises > div > div:nth-child(2)::-webkit-scrollbar,
  #cas-usage .mp-grid::-webkit-scrollbar,
  .mp-grid.mp-g3::-webkit-scrollbar,
  .mp-grid.mp-g4::-webkit-scrollbar { display: none; }

  #expertises > div > div:nth-child(2) > *,
  #cas-usage .mp-grid > *,
  .mp-grid.mp-g3:has(> :nth-child(3)) > *,
  .mp-grid.mp-g4:has(> :nth-child(3)) > * {
    flex: 0 0 82% !important;
    max-width: 82%;
    box-sizing: border-box !important;
    scroll-snap-align: start;
    border: 1px solid #E4E7EC !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    background-color: #FFFFFF;
  }
  .mp-dark .mp-grid.mp-g3:has(> :nth-child(3)) > *,
  .mp-dark .mp-grid.mp-g4:has(> :nth-child(3)) > * { border-color: #222326 !important; background-color: #16171A; }
  .mp-gw:has(> .mp-grid.mp-g3:has(> :nth-child(3))),
  .mp-gw:has(> .mp-grid.mp-g4:has(> :nth-child(3))),
  #cas-usage .mp-gw { border-top: 0 !important; overflow: visible !important; }

  /* les trois métiers : listes limitées aux cinq premiers éléments */
  #expertises > div > div:nth-child(2) li:nth-child(n+6) { display: none !important; }
  #expertises > div > div:nth-child(2) li > :not(:first-child) { display: none !important; }
  #expertises > div > div:nth-child(2) ul { margin-top: 16px !important; }

  /* indication de défilement, ajoutée par site.js sous chaque série */
  .stn-swipe { display: flex; align-items: center; gap: 6px; padding: 0 20px 18px; font-size: 13px; color: #687284; }
  .stn-swipe::after { content: "→"; }

  /* ── 4. Maquettes « En pratique » : la version bureau (illisible une fois réduite) est remplacée
     par une version téléphone (mobile-snippets/m1…m5.html) ── */
  [data-g="b1v"], [data-g="b2v"], [data-g="b3v"], [data-g="b4v"], [data-g="b5v"] { display: none !important; }
  /* panneaux d'explication : texte seul sur téléphone, sans le fondu de relecture en boucle */
  [data-g^="b"][data-g$="a"], [data-g^="b"][data-g$="b"] { min-height: 0 !important; padding: 20px 20px 22px !important; }
  [data-g^="b"][data-g$="a"] .stn-k, [data-g^="b"][data-g$="b"] .stn-k { opacity: 1 !important; animation: none !important; transform: none !important; }
  [data-g^="b"][data-g$="h"] { padding: 36px 20px 24px !important; }
  /* petits visuels des panneaux : ils tiennent dans la largeur, on les réaffiche à hauteur naturelle */
  [data-g^="b"] .stn-cv { display: block !important; margin-top: 18px !important; }
  /* hauteur naturelle, sauf le schéma circulaire (b1b) dont les éléments sont positionnés en absolu */
  [data-g^="b"]:not([data-g="b1b"]) .stn-cv { height: auto !important; min-height: 0 !important; }
  /* rapport d'audit : on garde le calcul, pas la colonne de sommaire */
  [data-g="au"] > div > div:nth-child(2) { display: none !important; }
  [data-g="au"] > div > div:nth-child(3) { padding: 16px !important; }
  /* le rapport s'affiche directement, sans squelette ni relecture en boucle */
  [data-g="au"] .stn-skel { display: none !important; }
  [data-g="au"] [class*="stn-"] { opacity: 1 !important; animation: none !important; transform: none !important; clip-path: none !important; }
  [data-g="au"] > div { margin-top: 0 !important; }

  /* rapport d'audit : la colonne « Ordre » (déjà dite au §3 du rapport) ne tient pas */
  .rp table th:nth-child(5), .rp table td:nth-child(5) { display: none; }
  /* fichier Excel « avant » (logiciels sur mesure) : cellules resserrées */
  .xl th, .xl td { padding: 5px 4px !important; font-size: 10.5px !important; }
  .xl td { max-width: 74px !important; }

  /* ── 5. « Installés chez vous » : icône et titre sur la même ligne ───────────────────── */
  [data-g="kp"] .stn-pr { min-height: 0 !important; padding: 14px 20px !important; gap: 0 !important; display: grid !important; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; align-items: start; }
  [data-g="kp"] .stn-pr > :first-child { grid-row: 1 / span 2; margin: 2px 0 0 !important; }
  [data-g="kp"] .stn-pr > * { margin-top: 0 !important; }
  [data-g="kp"] .stn-pr > :nth-child(n+2) { grid-column: 2; }

  /* ── 6. Questions fréquentes repliées (site.js ajoute la classe et gère l'ouverture) ── */
  .mp-faq.stn-fold > div { padding: 0 !important; }
  .mp-faq.stn-fold h3 { margin: 0; padding: 18px 48px 18px 20px; position: relative; cursor: pointer; font-size: 16px; line-height: 1.35; }
  .mp-faq.stn-fold h3::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 400; color: #687284; }
  .mp-faq.stn-fold > div.is-open h3::after { content: "–"; }
  .mp-faq.stn-fold > div > :not(h3) { display: none; }
  .mp-faq.stn-fold > div.is-open > :not(h3) { display: block; margin: 0 !important; padding: 0 20px 20px; }

  /* ── 7. Titres et confort de lecture ──────────────────────────────────────────────────── */
  .mp-h1 { font-size: 34px !important; line-height: 1.06 !important; }
  .h-serif .mp-h1 { font-size: 36px !important; }
  .mp-h2 { font-size: 26px !important; line-height: 1.15 !important; }
  [data-g="kh"] h2 { font-size: 44px !important; }
  .mp-lead { font-size: 16.5px !important; margin-top: 16px !important; }
  /* boutons : cible tactile d'au moins 44 px */
  .mp-btn, .stn-btn { min-height: 44px; }
  .mp-crumbs a, .mp-crumbs span { line-height: 32px; }
}

/* très petits écrans */
@media (max-width: 380px) {
  .stn-logos > div { font-size: 13px !important; }
  #expertises > div > div:nth-child(2) > *,
  #cas-usage .mp-grid > *,
  .mp-grid.mp-g3:has(> :nth-child(3)) > *,
  .mp-grid.mp-g4:has(> :nth-child(3)) > * { flex-basis: 86% !important; max-width: 86%; }
}

/* ══ Schémas dessinés pour téléphone (mobile-snippets/, insérés par scripts/inject-mobile.py) ══════════════ */
@media (min-width: 701px) { .stn-mob { display: none !important; } }

@media (max-width: 700px) {
  .mb-demo { display: block; padding: 6px 16px 26px; background-image: radial-gradient(#DFE3EA 1px, transparent 1.2px); background-size: 16px 16px; border-bottom: 1px solid #E4E7EC; }
  .mb-demo .mb-card + .mb-card { margin-top: 12px; }
  .mb-card { background: #FFFFFF; border: 1px solid #DCE0E8; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 14px 32px -18px rgba(16,24,40,.22); padding: 14px; font-size: 13px; color: #1C1D1F; }
  .mb-i { width: 15px; height: 15px; flex: none; display: block; }
  .mb-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
  .mb-head b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
  .mb-head small { margin-left: auto; font-size: 12px; color: #687284; }
  .mb-head .mb-chip, .mb-head .mb-live, .mb-head .mb-count { margin-left: auto; }
  .mb-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; background: #EEF0F3; font-size: 12px; color: #687284; }
  .mb-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex: none; }
  .mb-blue { background: #EEF3FE; color: #2F6BF0; } .mb-violet { background: #F1EEFF; color: #6B4FE0; }
  .mb-green { background: #E9F6EF; color: #1F7A4D; } .mb-amber { background: #FFF4DE; color: #9A6400; } .mb-orange { background: #FFF1E8; color: #C2410C; }
  .mb-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: #EEF0F3; color: #2E3238; font-size: 11.5px; font-weight: 500; white-space: nowrap; flex: none; }
  .mb-c-green { background: #E9F6EF; color: #1F7A4D; } .mb-c-blue { background: #EEF3FE; color: #2557D6; } .mb-c-amber { background: #FFF4DE; color: #8A5A00; }
  .mb-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #1F7A4D; font-weight: 500; }
  .mb-live i { width: 7px; height: 7px; border-radius: 99px; background: #22A06B; box-shadow: 0 0 0 3px rgba(34,160,107,.18); }

  /* circuit vertical (écran « circuit des factures », relances) */
  .mb-flow { list-style: none; margin: 0; padding: 0; position: relative; }
  .mb-flow li { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 0; }
  .mb-flow li::before { content: ""; position: absolute; left: 13.5px; top: 36px; bottom: -8px; width: 1px; background: #C9D6F7; }
  .mb-flow li.mb-last::before { display: none; }
  .mb-flow li > div { flex: 1; min-width: 0; }
  .mb-flow b { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
  .mb-flow small { display: block; font-size: 11.5px; color: #687284; line-height: 1.3; margin-top: 1px; }
  .mb-ok { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 99px; background: #E9F6EF; color: #1F7A4D; }
  .mb-ok .mb-i { width: 12px; height: 12px; }

  /* listes (factures, demandes, planning) */
  .mb-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #EEF0F3; }
  .mb-list li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #EEF0F3; }
  .mb-list li > div { flex: 1; min-width: 0; }
  .mb-list b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mb-list small { display: block; font-size: 11.5px; color: #687284; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mb-list li.mb-hl { background: #F7F9FF; margin: 0 -14px; padding-left: 16px; padding-right: 16px; box-shadow: inset 2px 0 0 #2F6BF0; }
  .mb-amt { font-size: 12.5px; font-variant-numeric: tabular-nums; color: #2E3238; white-space: nowrap; }
  .mb-more { margin-top: 10px; font-size: 12px; color: #687284; }
  .mb-av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 99px; background: #EEF0F3; color: #2E3238; font-size: 11px; font-weight: 600; flex: none; }
  .mb-who { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; background: #EEF3FE; color: #2557D6; font-size: 10px; font-weight: 600; flex: none; }

  /* doublon */
  .mb-alert { border-color: #F5D08A; }
  .mb-alert p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: #2E3238; }
  .mb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
  .mb-pair span { padding: 8px 10px; border: 1px solid #E4E7EC; border-radius: 10px; font-size: 12px; color: #687284; }
  .mb-pair b { display: block; font-size: 12.5px; color: #1C1D1F; }
  .mb-note { display: block; margin-top: 10px; font-size: 11.5px; color: #687284; }

  /* boutons d'exemple */
  .mb-btns { display: flex; gap: 8px; }
  .mb-btn { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid #DCE0E8; background: #FFFFFF; font-size: 12.5px; font-weight: 500; color: #1C1D1F; }
  .mb-btn.mb-dark { background: #1C1D1F; border-color: #1C1D1F; color: #FFFFFF; }

  /* demande client */
  .mb-bubble { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: #F2F4F7; font-size: 13px; line-height: 1.45; color: #2E3238; }
  .mb-reply { margin-bottom: 10px; padding: 10px 12px; border: 1px solid #C9D6F7; border-radius: 12px 12px 4px 12px; background: #F7F9FF; }
  .mb-reply small { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #2557D6; margin-bottom: 4px; }
  .mb-reply small .mb-i { width: 12px; height: 12px; }
  .mb-reply p { margin: 0; font-size: 13px; line-height: 1.45; color: #1C1D1F; }
  .mb-src { display: block; margin-top: 6px; font-size: 11px; color: #687284; }
  .mb-checks { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
  .mb-checks li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #2E3238; }
  .mb-checks .mb-i { width: 13px; height: 13px; color: #1F7A4D; }

  /* planning : onglets */
  .mb-seg { display: flex; gap: 2px; padding: 3px; margin-bottom: 8px; border-radius: 10px; background: #F2F4F7; overflow-x: auto; scrollbar-width: none; }
  .mb-seg::-webkit-scrollbar { display: none; }
  .mb-seg button { flex: 1 1 auto; height: 30px; padding: 0 5px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 11px; font-weight: 500; color: #687284; white-space: nowrap; cursor: pointer; }
  .mb-seg button.is-on { background: #FFFFFF; color: #1C1D1F; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
  .mb-seg i { font-style: normal; margin-left: 3px; color: #8D94A0; }
  .mb-tabs .mb-list[data-pane] { display: none; }
  .mb-tabs .mb-list[data-pane].is-on { display: block; }

  /* tableau de bord */
  .mb-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mb-kpis > div { padding: 10px; border: 1px solid #EEF0F3; border-radius: 10px; }
  .mb-kpis small { display: block; font-size: 11px; color: #687284; line-height: 1.25; }
  .mb-kpis b { display: block; margin-top: 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .mb-chart { margin-top: 12px; }
  .mb-chart small { display: block; font-size: 11px; color: #687284; margin-bottom: 6px; }
  .mb-bars { display: flex; align-items: flex-end; gap: 6px; height: 84px; padding-bottom: 1px; border-bottom: 1px solid #E4E7EC; }
  .mb-bars i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: #C9D6F7; }
  .mb-bars i.is-now { background: #2F6BF0; }
  .mb-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10.5px; color: #8D94A0; }
  .mb-chk { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid #EEF0F3; }
  .mb-chk p { margin: 0; font-size: 12.5px; line-height: 1.45; color: #2E3238; }

  /* écrans de la maquette du haut */
  .mb-scene { flex: 1; min-height: 0; flex-direction: column; padding: 12px 14px; font-size: 13px; color: #1C1D1F; overflow: hidden; }
  .mb-bar { display: flex; align-items: center; gap: 4px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid #EEF0F3; }
  .mb-tab { padding: 5px 8px; border-radius: 7px; font-size: 12px; color: #687284; }
  .mb-tab.is-on { background: #F2F4F7; color: #1C1D1F; font-weight: 500; }
  .mb-tab b { font-weight: 500; color: #8D94A0; margin-left: 2px; }
  .mb-bar .mb-live { margin-left: auto; }
  .mb-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid #EEF0F3; font-size: 12px; color: #687284; }
  .mb-foot b { color: #1C1D1F; font-weight: 600; }
  .mb-foot .mb-chip { margin-left: auto; }
  .mb-from { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .mb-from b { display: block; font-size: 13.5px; font-weight: 600; }
  .mb-from small { display: block; font-size: 11.5px; color: #687284; }
  .mb-col { display: flex; flex-direction: column; }

  /* apparition progressive : à chaque affichage pour la maquette du haut, au défilement pour les autres */
  .mb-scene.is-on .mb-anim > * { animation: mb-in .5s cubic-bezier(.16,.84,.24,1) both; animation-delay: calc(var(--i, 0) * 140ms + 150ms); }
  .mb-reveal.mb-arm .mb-anim > *, .mb-reveal.mb-arm.mb-anim > * { opacity: 0; }
  .mb-reveal.mb-play .mb-anim > *, .mb-reveal.mb-play.mb-anim > * { animation: mb-in .55s cubic-bezier(.16,.84,.24,1) both; animation-delay: calc(var(--i, 0) * 110ms); }
}
@keyframes mb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mb-anim > * { animation: none !important; opacity: 1 !important; } }
