/* Maison 3D — interface sobre autour d'une scène riche, aux codes du gabarit :
   variables du site --acc, --titre, --t1, --t2, --bd, --f-display ; classes préfixées m3d-. */
.m3d { --m3d-encre: var(--titre, #16181D); --m3d-acc: var(--acc, #D9621F); --m3d-t2: var(--t2, #5b5f66); --m3d-bd: var(--bd, rgba(20, 18, 15, .1)); --m3d-fond: #ebe8e3; display: grid; gap: 16px; color: var(--t1, #15171A); }
.m3d *, .m3d *::before, .m3d *::after { box-sizing: border-box; }
.m3d button { font: inherit; color: inherit; }
.m3d svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.m3d-sec { scroll-margin-top: 110px; }
/* en-tête de la maquette : le titre, et à côté les trois gestes pour s'en servir */
.m3d-page svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.m3d-entete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px clamp(24px, 4vw, 64px); align-items: end; margin-bottom: clamp(18px, 2.2vw, 28px); }
.m3d-entete-texte { max-width: 760px; }
.m3d-entete .pv-lead { margin-bottom: 0; }
.m3d-gestes { list-style: none; margin: 0 0 4px; padding: 0; display: flex; gap: 8px; }
.m3d-gestes li { display: flex; align-items: center; gap: 10px; padding: 9px 15px 9px 12px; border-radius: 14px; background: color-mix(in srgb, var(--acc, #D9621F) 7%, #fff); font-size: 12.5px; line-height: 1.3; color: var(--t2, #5b5f66); }
.m3d-gestes svg { flex: none; width: 22px; height: 22px; color: var(--acc, #D9621F); }
.m3d-gestes span { display: grid; }
.m3d-gestes b { font-size: 13.5px; font-weight: 600; color: var(--titre, #16181D); }
@media (max-width: 1180px) {
  .m3d-entete { grid-template-columns: minmax(0, 1fr); }
  .m3d-gestes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .m3d-gestes { gap: 6px; }
  .m3d-gestes li { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 10px 11px; font-size: 11.5px; }
  .m3d-gestes b { font-size: 12.5px; }
}

/* ——— chapitres */
/* tous les chapitres sont visibles d'un coup : une rangée sur ordinateur, une grille sur tablette et téléphone (jamais de défilement latéral) */
.m3d-chapitres { display: grid; grid-template-columns: repeat(var(--m3d-n, 8), minmax(0, 1fr)); gap: 8px; padding: 2px 2px 6px; scroll-margin-top: 104px; }
.m3d-chapitres button { all: unset; box-sizing: border-box; min-width: 0; display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 8px 12px 8px 11px; border-radius: 16px; background: #fff; border: 1px solid var(--m3d-bd); cursor: pointer; transition: background .2s, color .2s, border-color .2s, box-shadow .2s; }
.m3d-chapitres button b { font-weight: 600; }
.m3d-chapitres button svg { width: 20px; height: 20px; flex: none; color: var(--m3d-acc); }
.m3d-chapitres button span { display: grid; line-height: 1.15; font-size: 14px; font-weight: 600; color: var(--m3d-encre); }
.m3d-chapitres button small { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: var(--m3d-t2); }
.m3d-chapitres button:hover { border-color: color-mix(in srgb, var(--m3d-encre) 35%, #fff); }
.m3d-chapitres button[aria-selected=true] { background: var(--m3d-encre); border-color: var(--m3d-encre); box-shadow: 0 10px 22px -14px rgba(20, 18, 15, .7); }
.m3d-chapitres button[aria-selected=true] span, .m3d-chapitres button[aria-selected=true] svg { color: #fff; }
.m3d-chapitres button[aria-selected=true] small { color: rgba(255, 255, 255, .62); }
.m3d :focus-visible { outline: 2px solid var(--m3d-acc); outline-offset: 2px; }

/* ——— scène */
/* la scène prend toute la largeur de la section ; le configurateur du chapitre se range dessous */
.m3d-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.m3d-scene { position: relative; border-radius: 20px; overflow: hidden; background: var(--m3d-fond); height: clamp(440px, 72svh, 740px); box-shadow: 0 34px 70px -42px rgba(20, 18, 15, .55), inset 0 0 0 1px rgba(20, 18, 15, .05); isolation: isolate; }
.m3d-scene canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline-offset: -3px; -webkit-tap-highlight-color: transparent; user-select: none; }
.m3d-scene canvas.m3d-saisie { cursor: grabbing; }
.m3d-brosse .m3d-scene canvas { cursor: crosshair; }
.m3d-scene:fullscreen { aspect-ratio: auto; border-radius: 0; width: 100vw; height: 100vh; }
.m3d-mention { position: absolute; left: 14px; top: 14px; margin: 0; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, .72); color: var(--m3d-t2); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; }
.m3d-outils { position: absolute; right: 12px; top: 12px; display: grid; gap: 6px; }
.m3d-outils button, .m3d-moments button { all: unset; box-sizing: border-box; cursor: pointer; }
.m3d-outils button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .84); color: var(--m3d-encre); box-shadow: 0 6px 16px -10px rgba(20, 18, 15, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .18s, transform .18s; }
.m3d-outils button:hover { background: #fff; }
.m3d-outils button:active { transform: scale(.94); }
.m3d-outils svg { width: 19px; height: 19px; }
.m3d-moments { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .84); box-shadow: 0 6px 16px -10px rgba(20, 18, 15, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.m3d-moments button { padding: 8px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--m3d-t2); transition: background .18s, color .18s; }
.m3d-moments button[aria-pressed=true] { background: var(--m3d-encre); color: #fff; }
.m3d-aide { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(22, 24, 29, .74); color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap; pointer-events: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: opacity .5s; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.m3d-aide[hidden] { display: none; }
.m3d-touche .m3d-aide { opacity: 0; }
[data-m3d-chapitre="combles"] .m3d-moments, .m3d-intro .m3d-moments { visibility: hidden; }

/* parcours : passer d'un point à l'autre sans quitter la scène des yeux */
.m3d-parcours { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: 0 10px 24px -12px rgba(20, 18, 15, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); max-width: calc(100% - 24px); }
.m3d-parcours[hidden] { display: none; }
.m3d-parcours button { all: unset; box-sizing: border-box; flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: #fff; background: var(--m3d-encre); transition: transform .16s, background .16s; }
.m3d-parcours button:hover { background: color-mix(in srgb, var(--m3d-encre) 82%, #fff); }
.m3d-parcours button:active { transform: scale(.93); }
.m3d-parcours svg { width: 20px; height: 20px; stroke-width: 2.2; }
.m3d-parcours span { display: grid; justify-items: center; min-width: 168px; padding: 0 12px; line-height: 1.2; text-align: center; }
.m3d-parcours small { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--m3d-acc); }
.m3d-parcours b { font-size: 13.5px; font-weight: 600; color: var(--m3d-encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.m3d-parcours:not([hidden]) ~ .m3d-aide { display: none; }

/* voile de préparation et repli */
.m3d-voile { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--m3d-fond); color: var(--m3d-t2); font-size: 13.5px; font-weight: 500; transition: opacity .6s .1s; }
.m3d-voile p { margin: 0; }
.m3d-voile span { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--m3d-encre) 14%, transparent); border-top-color: var(--m3d-acc); animation: m3d-tour 1s linear infinite; }
@keyframes m3d-tour { to { transform: rotate(360deg); } }
[data-m3d-etat="pret"] .m3d-voile, [data-m3d-etat="repli"] .m3d-voile { opacity: 0; pointer-events: none; }
.m3d-repli { display: none; position: absolute; inset: 0; place-content: center; justify-items: start; gap: 12px; padding: clamp(22px, 6vw, 64px); background: var(--m3d-fond); }
.m3d-repli h3 { margin: 0; font-family: var(--f-display, inherit); font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; letter-spacing: -.015em; color: var(--m3d-encre); max-width: 22ch; }
.m3d-repli p { margin: 0 0 6px; max-width: 46ch; color: var(--m3d-t2); line-height: 1.55; }
[data-m3d-etat="repli"] .m3d-repli, [data-m3d-etat="perdu"] .m3d-repli { display: grid; }
[data-m3d-etat="repli"] canvas, [data-m3d-etat="repli"] .m3d-outils, [data-m3d-etat="repli"] .m3d-moments, [data-m3d-etat="repli"] .m3d-mention, [data-m3d-etat="repli"] .m3d-chapitres, [data-m3d-etat="repli"] .m3d-panneau { display: none; }
[data-m3d-etat="repli"] .m3d-grille { grid-template-columns: 1fr; }

/* ——— repères et légendes */
.m3d-reperes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.m3d-repere { all: unset; box-sizing: border-box; position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; margin: -16px 0 0 -16px; pointer-events: auto; cursor: pointer; will-change: transform; }
.m3d-repere i { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--m3d-acc); color: #fff; font-style: normal; font-size: 13.5px; font-weight: 700; box-shadow: 0 0 0 4px rgba(255, 255, 255, .55), 0 8px 18px -8px rgba(20, 18, 15, .7); transition: transform .2s, background .2s; }
.m3d-repere b { padding: 5px 10px; border-radius: 999px; background: rgba(22, 24, 29, .82); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; pointer-events: none; }
.m3d-repere:hover b, .m3d-repere:focus-visible b, .m3d-repere.actif b { opacity: 1; transform: none; }
.m3d-repere.actif i { transform: scale(1.14); }
.m3d-repere.fait i { background: #2f7d4f; }
.m3d-repere.ouvert b { display: none; }
.m3d-repere.ouvert i { box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 8px 18px -8px rgba(20, 18, 15, .7); }
/* fiche du repère choisi : l'explication à côté de la bulle, la vue et les autres repères ne bougent pas */
.m3d-fiche { position: absolute; left: 0; top: 0; width: max-content; max-width: min(264px, calc(100% - 76px)); padding: 13px 15px 13px; border-radius: 16px; background: rgba(255, 255, 255, .97); color: var(--m3d-encre); box-shadow: 0 22px 44px -22px rgba(20, 18, 15, .6), 0 0 0 1px rgba(20, 18, 15, .06); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); pointer-events: auto; will-change: transform; animation: m3d-fiche .24s ease-out; }
.m3d-fiche[hidden] { display: none; }
.m3d-fiche > b { display: block; padding-right: 28px; font-size: 14px; font-weight: 600; line-height: 1.25; letter-spacing: -.005em; }
.m3d-fiche p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--m3d-t2); }
.m3d-fiche button { all: unset; box-sizing: border-box; cursor: pointer; }
.m3d-fiche .m3d-fiche-fermer { position: absolute; right: 7px; top: 7px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--m3d-t2); transition: background .16s, color .16s; }
.m3d-fiche .m3d-fiche-fermer:hover { background: rgba(20, 18, 15, .07); color: var(--m3d-encre); }
.m3d-fiche-fermer svg { width: 15px; height: 15px; stroke-width: 2; }
.m3d-fiche-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.m3d-fiche-actions button { min-height: 34px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--m3d-bd); font-size: 12.5px; font-weight: 600; color: var(--m3d-encre); background: #fff; transition: background .16s, border-color .16s; }
.m3d-fiche-actions button:hover { border-color: color-mix(in srgb, var(--m3d-encre) 40%, #fff); }
.m3d-fiche-actions .m3d-fiche-action { background: var(--m3d-encre); border-color: var(--m3d-encre); color: #fff; }
.m3d-fiche-actions .m3d-fiche-action:hover { background: color-mix(in srgb, var(--m3d-encre) 86%, #fff); }
@keyframes m3d-fiche { from { opacity: 0; } }
/* téléphone : la fiche se pose sous la scène, la maquette reste entièrement visible */
.m3d-fiche-quai[hidden] { display: none; }
.m3d-fiche.m3d-fiche-posee { position: relative; width: auto; max-width: none; border: 1px solid var(--m3d-bd); box-shadow: 0 14px 30px -24px rgba(20, 18, 15, .5); -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
.m3d-fiche-posee .m3d-fiche-actions button { min-height: 40px; padding: 9px 15px; }
.m3d-repere-legende { margin: -5px 0 0 -5px; cursor: default; pointer-events: none; gap: 0; }
.m3d-repere-legende i { width: 10px; height: 10px; background: #fff; box-shadow: 0 0 0 2px var(--m3d-encre); }
.m3d-repere-legende::after { content: ""; order: 1; width: 26px; height: 1.5px; background: var(--m3d-encre); }
.m3d-repere-legende b { order: 2; opacity: 1; transform: none; background: rgba(255, 255, 255, .92); color: var(--m3d-encre); box-shadow: 0 6px 16px -10px rgba(20, 18, 15, .6); }
.m3d-repere-legende.actif b { background: var(--m3d-encre); color: #fff; }
.m3d-repere-droite { flex-direction: row-reverse; margin-left: 0; transform-origin: right; }
.m3d-repere-droite b { order: 0; } .m3d-repere-droite::after { order: 1; } .m3d-repere-droite i { order: 2; }

/* ——— curseur avant / après */
.m3d-curseur { position: absolute; top: 0; bottom: 0; left: 50%; width: 44px; margin-left: -22px; cursor: ew-resize; touch-action: none; }
.m3d-curseur[hidden] { display: none; }
.m3d-curseur i { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(20, 18, 15, .18); }
.m3d-curseur b { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: #fff; box-shadow: 0 10px 22px -10px rgba(20, 18, 15, .7); }
.m3d-curseur b::before { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--m3d-encre), var(--m3d-encre)) 15px 50% / 2px 14px no-repeat, linear-gradient(var(--m3d-encre), var(--m3d-encre)) 25px 50% / 2px 14px no-repeat; }
.m3d-curseur span { position: absolute; top: 58px; padding: 5px 10px; border-radius: 999px; background: rgba(22, 24, 29, .74); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.m3d-curseur .av { right: calc(50% + 12px); } .m3d-curseur .ap { left: calc(50% + 12px); }

/* ——— panneau */
/* une grille franche : l'en-tête, le corps rangé en colonnes choisies par chaque chapitre, le pied de navigation */
.m3d-panneau { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: clamp(22px, 2.4vw, 32px) clamp(20px, 2.6vw, 34px); border-radius: 22px; background: color-mix(in srgb, var(--m3d-acc) 4%, #fff); border: 1px solid color-mix(in srgb, var(--m3d-acc) 13%, #fff); box-shadow: 0 24px 50px -36px rgba(20, 18, 15, .4); }
.m3d-panneau > * { margin: 0; min-width: 0; }
.m3d-panneau > .m3d-tete { max-width: 780px; }
.m3d-cols { display: grid; grid-template-columns: repeat(var(--m3d-c, 2), minmax(0, 1fr)); gap: 24px clamp(26px, 3.6vw, 56px); align-items: start; }
.m3d-col { display: grid; gap: 22px; align-content: start; min-width: 0; }
.m3d-carte { padding: 18px 18px 20px; border-radius: 16px; background: #fff; border: 1px solid var(--m3d-bd); box-shadow: 0 16px 34px -30px rgba(20, 18, 15, .5); }
.m3d-tete { display: grid; gap: 7px; }
.m3d-tete .m3d-surtitre span { display: inline-block; margin-right: 10px; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--m3d-acc) 13%, #fff); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
/* le chapitre qui s'ouvre s'installe bloc après bloc */
@keyframes m3d-monte { from { opacity: 0; transform: translateY(12px); } }
.m3d-entree > * { animation: m3d-monte .5s cubic-bezier(.2, .7, .2, 1) both; }
.m3d-entree > :nth-child(2) { animation-delay: .07s; }
.m3d-entree > :nth-child(3) { animation-delay: .13s; }
.m3d-entree > :nth-child(n+4) { animation-delay: .18s; }
.m3d-entree .m3d-col:nth-child(2) > * { animation: m3d-monte .5s .16s cubic-bezier(.2, .7, .2, 1) both; }
.m3d-entree .m3d-col:nth-child(3) > * { animation: m3d-monte .5s .24s cubic-bezier(.2, .7, .2, 1) both; }
/* réglages par onglets : une famille de choix à la fois, la valeur en cours rappelée sous chaque nom */
.m3d-reglages { display: grid; gap: 22px; }
.m3d-onglets { display: grid; grid-template-columns: repeat(var(--m3d-o, 4), minmax(0, 1fr)); gap: 5px; padding: 5px; border-radius: 18px; background: color-mix(in srgb, var(--m3d-encre) 7%, #fff); }
.m3d-onglets button { all: unset; box-sizing: border-box; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 9px 16px; border-radius: 14px; cursor: pointer; transition: background .22s, box-shadow .22s; }
.m3d-onglets svg { flex: none; width: 22px; height: 22px; color: var(--m3d-t2); transition: color .22s, transform .22s; }
.m3d-onglets span { display: grid; gap: 1px; min-width: 0; }
.m3d-onglets b { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; color: var(--m3d-encre); }
.m3d-onglets small { font-size: 12px; color: var(--m3d-t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m3d-onglets button:hover { background: rgba(255, 255, 255, .62); }
.m3d-onglets button[aria-selected=true] { background: #fff; box-shadow: 0 10px 22px -14px rgba(20, 18, 15, .5), 0 0 0 1px var(--m3d-bd); }
.m3d-onglets button[aria-selected=true] svg { color: var(--m3d-acc); transform: scale(1.08); }
.m3d-volet-entree { animation: m3d-monte .38s cubic-bezier(.2, .7, .2, 1) both; }
.m3d-bloc.m3d-pied-reglages { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.m3d-pied-reglages .m3d-mention-texte { flex: 1 1 280px; }
.m3d-resume { padding: 11px 13px; border-radius: 12px; background: #fff; border: 1px solid var(--m3d-bd); color: var(--m3d-encre); font-weight: 500; }
.m3d-bascule { max-width: 440px; }
.m3d-invite { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0; padding: 16px; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--m3d-acc) 36%, #fff); font-size: 13.5px; line-height: 1.55; color: var(--m3d-t2); }
.m3d-invite[hidden] { display: none; }
.m3d-invite svg { width: 24px; height: 24px; color: var(--m3d-acc); }
.m3d-bilan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; }
.m3d-tete p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--m3d-t2); }
.m3d-tete .m3d-surtitre { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--m3d-acc); }
.m3d-tete h3 { margin: 0; font-family: var(--f-display, inherit); font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: -.018em; color: var(--m3d-encre); }
.m3d-bloc { display: grid; gap: 11px; }
.m3d-bloc[hidden] { display: none; }
.m3d-bloc h4 { margin: 0; font-family: var(--f-display, inherit); font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--m3d-encre); }
.m3d-note, .m3d-nom, .m3d-gamme, .m3d-compte { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--m3d-t2); }
.m3d-gamme { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.m3d-nom { font-weight: 600; color: var(--m3d-encre); }
.m3d-compte b { font-size: 20px; font-weight: 700; color: var(--m3d-encre); font-variant-numeric: tabular-nums; }
.m3d-mention-texte { margin: 0; font-size: 12px; line-height: 1.5; color: var(--m3d-t2); }
.m3d-choix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.m3d-choix button, .m3d .m3d-bouton { all: unset; box-sizing: border-box; cursor: pointer; text-align: center; min-height: 44px; padding: 9px 12px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 1px solid var(--m3d-bd); font-size: 13.5px; font-weight: 600; color: var(--m3d-encre); transition: background .18s, color .18s, border-color .18s, transform .18s; }
.m3d-choix button b { font-weight: 600; }
.m3d-choix button:hover, .m3d-bouton:hover { border-color: color-mix(in srgb, var(--m3d-encre) 40%, #fff); }
.m3d-choix button[aria-pressed=true], .m3d-bouton[aria-pressed=true] { background: var(--m3d-encre); border-color: var(--m3d-encre); color: #fff; }
.m3d-mats button:last-child:nth-child(odd) { grid-column: 1 / -1; }
.m3d-choix.m3d-trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.m3d .m3d-trois button { font-size: 12.5px; padding-inline: 6px; line-height: 1.2; }
.m3d-bouton:active { transform: scale(.98); }
.m3d .m3d-bouton.m3d-retour { display: inline-flex; grid-auto-flow: column; gap: 9px; width: auto; justify-self: start; padding-inline: 16px; }
.m3d-retour svg { width: 17px; height: 17px; flex: none; }
.m3d-bouton.m3d-plein { background: color-mix(in srgb, var(--m3d-acc) 12%, #fff); border-color: color-mix(in srgb, var(--m3d-acc) 40%, #fff); }
.m3d-bouton.m3d-plein[aria-pressed=true] { background: var(--m3d-encre); border-color: var(--m3d-encre); }
.m3d-actions-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.m3d-actions-3 { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
.m3d-pastilles { display: flex; flex-wrap: wrap; gap: 9px; }
.m3d-pastille { all: unset; box-sizing: border-box; width: 36px; height: 36px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(20, 18, 15, .18), inset 0 -8px 12px -8px rgba(0, 0, 0, .35); transition: transform .16s, box-shadow .16s; }
.m3d-pastille:hover { transform: scale(1.07); }
.m3d-pastille[aria-pressed=true] { box-shadow: inset 0 0 0 1px rgba(20, 18, 15, .18), 0 0 0 3px #fff, 0 0 0 5px var(--m3d-encre); }
.m3d-petites .m3d-pastille { width: 28px; height: 28px; }
.m3d-ligne { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; align-items: center; }
.m3d-ligne > span { font-size: 13px; font-weight: 600; color: var(--m3d-t2); }
.m3d-couches, .m3d-etapes, .m3d-defauts { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.m3d-couches button, .m3d-etapes button, .m3d-defauts button, .m3d-statique li { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 11px; align-items: start; width: 100%; padding: 9px 10px; border-radius: 12px; border: 1px solid transparent; }
.m3d-couches button, .m3d-etapes button, .m3d-defauts button { cursor: pointer; transition: background .18s, border-color .18s; }
.m3d-couches button:hover, .m3d-etapes button:hover, .m3d-defauts button:hover { background: #fff; }
.m3d-couches button[aria-pressed=true], .m3d-etapes button[aria-pressed=true], .m3d-defauts button[aria-pressed=true] { background: #fff; border-color: color-mix(in srgb, var(--m3d-acc) 45%, #fff); }
.m3d-couches i, .m3d-etapes i, .m3d-defauts i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--m3d-acc) 14%, #fff); color: var(--m3d-acc); font-style: normal; font-size: 12.5px; font-weight: 700; }
.m3d-defauts .fait i { background: #2f7d4f; color: #fff; }
.m3d-couches span, .m3d-etapes span, .m3d-defauts span { display: grid; gap: 2px; }
.m3d-couches b, .m3d-etapes b, .m3d-defauts b { font-size: 14px; font-weight: 600; color: var(--m3d-encre); }
.m3d-couches small, .m3d-etapes small, .m3d-defauts small { font-size: 12.5px; line-height: 1.45; color: var(--m3d-t2); }
.m3d-couches small { display: none; }
.m3d-couches button[aria-pressed=true] small { display: block; }
.m3d-couches { gap: 2px; } .m3d-couches button { padding: 6px 10px; align-items: center; }
@media (min-width: 961px) {
  /* listes en deux colonnes quand la place le permet : on lit de haut en bas, puis la colonne suivante */
  .m3d-couches { grid-auto-flow: column; grid-template-rows: repeat(var(--m3d-r, 4), auto); grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  .m3d-etapes-2, .m3d-cols[style*="--m3d-c:1"] .m3d-etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
}
.m3d-detail { padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--m3d-bd); }
.m3d-detail p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--m3d-t2); }
.m3d-jauge { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--m3d-encre) 10%, #fff); overflow: hidden; }
.m3d-jauge i { display: block; height: 100%; background: var(--m3d-acc); transform-origin: left; transform: scaleX(1); }
.m3d-curseur-ligne { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--m3d-t2); }
.m3d-curseur-ligne input { width: 100%; height: 28px; accent-color: var(--m3d-acc); }
.m3d-legende { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.m3d-legende li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13.5px; line-height: 1.5; color: var(--m3d-t2); }
.m3d-legende i { width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(20, 18, 15, .15); }
.m3d-legende b { color: var(--m3d-encre); font-weight: 600; }
.m3d-panneau > .m3d-suivant { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 20px; border-top: 1px solid var(--m3d-bd); }
.m3d .m3d-suivant button b { transition: transform .22s; }
.m3d .m3d-suivant .m3d-apres:hover b { transform: translateX(3px); }
.m3d .m3d-suivant .m3d-avant:hover b { transform: translateX(-3px); }
.m3d .m3d-suivant button { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 2px; min-height: 52px; padding: 9px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--m3d-bd); transition: border-color .18s, background .18s; }
.m3d .m3d-suivant button:hover { border-color: color-mix(in srgb, var(--m3d-encre) 40%, #fff); }
.m3d .m3d-suivant .m3d-apres { text-align: right; background: color-mix(in srgb, var(--m3d-acc) 10%, #fff); border-color: color-mix(in srgb, var(--m3d-acc) 38%, #fff); }
.m3d-suivant small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--m3d-t2); }
.m3d-suivant b { font-size: 14.5px; font-weight: 600; color: var(--m3d-encre); }
.m3d-recap { margin: 0; display: grid; gap: 0; }
.m3d-recap div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--m3d-bd); }
.m3d-recap div:last-child { border-bottom: 0; }
.m3d-recap dt { font-size: 12.5px; font-weight: 600; color: var(--m3d-t2); }
.m3d-recap dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--m3d-encre); }
.m3d-liens { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.m3d-liens button, .m3d-lien-discret { all: unset; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--m3d-encre); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--m3d-acc) 60%, transparent); text-underline-offset: 4px; min-height: 30px; display: inline-flex; align-items: center; }
.m3d-liens button:hover, .m3d-lien-discret:hover { color: var(--m3d-acc); }
.m3d-cta { gap: 13px; }
.m3d-carte.m3d-cta { background: color-mix(in srgb, var(--m3d-acc) 7%, #fff); border-color: color-mix(in srgb, var(--m3d-acc) 26%, #fff); }
.m3d-chapitres button { transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s; }
.m3d-chapitres button:hover { transform: translateY(-1px); }
.m3d-chapitres button:active { transform: scale(.98); }
.m3d-cta .btn { width: 100%; justify-content: center; text-align: center; }

/* ——— tablette et téléphone : la scène reste sous l'en-tête pendant qu'on fait défiler le panneau */
@media (max-width: 1080px) {
  .m3d-pastille { width: 44px; height: 44px; }
  .m3d-petites .m3d-pastille { width: 40px; height: 40px; }
  .m3d-pastilles { gap: 8px; }
  .m3d-moments button { min-height: 44px; display: grid; place-items: center; padding: 0 14px; }
  .m3d-outils button { width: 44px; height: 44px; }
  .m3d-liens button, .m3d-lien-discret { min-height: 44px; }
  .m3d-ligne { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .m3d-curseur-ligne input { height: 44px; }
  .m3d-grille { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .m3d-chapitres { grid-template-columns: repeat(var(--m3d-cols, 4), minmax(0, 1fr)); }
  .m3d-scene { height: clamp(320px, 56svh, 620px); }
  .m3d-pastilles:has(> :nth-child(7)) { display: grid; grid-template-columns: repeat(4, max-content); }
}
@media (max-width: 960px) {
  .m3d-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .m3d { gap: 12px; }
  .m3d-scene { position: sticky; top: var(--m3d-haut, 80px); z-index: 3; height: clamp(280px, 48svh, 460px); border-radius: 16px; }
  /* téléphone : pastilles compactes, numéro et pictogramme au-dessus du nom */
  .m3d-chapitres { gap: 6px; padding: 0 0 2px; scroll-margin-top: 92px; }
  .m3d-chapitres button { display: grid; grid-template-columns: auto auto; grid-template-areas: "n i" "t t"; justify-content: center; align-content: center; align-items: center; gap: 4px 6px; min-height: 62px; padding: 8px 2px; border-radius: 14px; text-align: center; }
  .m3d-chapitres button span { display: contents; }
  .m3d-chapitres button small { grid-area: n; font-size: 10.5px; }
  .m3d-chapitres button svg { grid-area: i; width: 18px; height: 18px; }
  .m3d-chapitres button b { grid-area: t; font-size: clamp(9.5px, 2.85vw, 11.5px); line-height: 1.15; letter-spacing: -.01em; color: var(--m3d-encre); }
  .m3d-chapitres button[aria-selected=true] b { color: #fff; }
  .m3d-suivant b { font-size: 13.5px; }
  .m3d-panneau { padding: 20px 16px; border-radius: 18px; gap: 20px; }
  .m3d-onglets button { flex-direction: column; justify-content: center; gap: 5px; min-height: 62px; padding: 8px 2px; text-align: center; }
  .m3d-onglets b { font-size: clamp(10.5px, 3vw, 12.5px); }
  .m3d-onglets small { display: none; }
  .m3d-onglets svg { width: 20px; height: 20px; }
  .m3d-carte { padding: 16px; }
  .m3d-outils button { width: 44px; height: 44px; }
  .m3d-outils [data-m3d-outil="ecran"] { display: none; }
  .m3d-moments button { padding: 10px 12px; }
  .m3d-aide { bottom: 62px; font-size: 12px; }
  .m3d-parcours { bottom: 64px; }
  .m3d-parcours span { min-width: 132px; }
  .m3d-repere-legende b { font-size: 11px; padding: 4px 8px; }
  .m3d-repere-legende::after { width: 14px; }
  .m3d-tete h3 { font-size: 19px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .m3d-grille { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
  .m3d-scene { position: sticky; top: var(--m3d-haut, 96px); height: calc(100svh - var(--m3d-haut, 96px) - 10px); min-height: 200px; aspect-ratio: auto; }
}
@media (pointer: coarse) {
  .m3d-pastille { width: 44px; height: 44px; }
  .m3d-petites .m3d-pastille { width: 40px; height: 40px; }
  .m3d-liens button, .m3d-lien-discret { min-height: 44px; }
  .m3d-moments button { min-height: 44px; display: grid; place-items: center; padding: 0 14px; }
}
/* tablette : la scène reste sous l'en-tête pendant qu'on règle, comme sur téléphone */
@media (min-width: 761px) and (max-width: 1080px) {
  .m3d-scene { position: sticky; top: var(--m3d-haut, 96px); z-index: 3; height: clamp(320px, 50svh, 560px); }
}
/* ——— grand écran : les réglages se posent dans la scène, sur son bord droit. Plus rien à faire défiler : on règle
   et on regarde en même temps. La classe est posée par le script (sans lui, le panneau reste sous la scène). */
.m3d-dock-bascule { display: none; }
.m3d-dock .m3d-grille { position: relative; display: block; }
.m3d-dock .m3d-scene { height: clamp(500px, calc(100svh - 196px), 860px); }
.m3d-dock .m3d-panneau { position: absolute; z-index: 4; top: 14px; right: 14px; bottom: 14px; width: min(404px, 36%); overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin; align-content: start; gap: 18px; padding: 20px 20px 18px; border-radius: 18px; background: color-mix(in srgb, var(--m3d-acc) 3%, rgb(255 255 255 / .93)); border: 1px solid rgb(255 255 255 / .75); box-shadow: 0 26px 54px -28px rgba(20, 18, 15, .6); -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15); transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s, visibility 0s; }
.m3d-dock.m3d-dock-ferme .m3d-panneau { transform: translateX(26px) scale(.985); opacity: 0; visibility: hidden; pointer-events: none; transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s, visibility 0s .45s; }
.m3d-dock .m3d-cols { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.m3d-dock .m3d-col { gap: 18px; }
.m3d-dock .m3d-tete h3 { font-size: 18.5px; }
/* dans la scène, le titre du chapitre suffit : le texte d'introduction laisse la place aux réglages */
.m3d-dock .m3d-tete p:not(.m3d-surtitre) { display: none; }
.m3d-dock .m3d-panneau { gap: 16px; }
.m3d-dock [data-reglage="couverture"] .m3d-col:last-child .m3d-bloc:last-child h4, .m3d-dock .m3d-cta .m3d-note, .m3d-dock .m3d-cta .m3d-mention-texte { display: none; }
.m3d-dock .m3d-onglets button { flex-direction: column; justify-content: center; gap: 5px; min-height: 60px; padding: 8px 2px; text-align: center; }
.m3d-dock .m3d-onglets b { font-size: 12.5px; }
.m3d-dock .m3d-onglets small { display: none; }
.m3d-dock .m3d-onglets svg { width: 20px; height: 20px; }
/* les couches sur deux colonnes ; le rôle de la couche choisie s'affiche à côté d'elle, sur la maquette */
.m3d-dock .m3d-couches { grid-auto-flow: column; grid-template-rows: repeat(var(--m3d-r, 4), auto); grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 6px; }
.m3d-dock .m3d-couches button[aria-pressed=true] small { display: none; }
.m3d-dock .m3d-couches b { font-size: 13px; }
.m3d-dock .m3d-etapes-2, .m3d-dock .m3d-cols[style*="--m3d-c:1"] .m3d-etapes { grid-template-columns: minmax(0, 1fr); }
.m3d-dock .m3d-carte { padding: 15px; }
.m3d-dock .m3d-bascule { max-width: none; }
/* la rangée des chapitres reste sous les yeux juste au-dessus : le pied « précédent / suivant » n'a plus lieu d'être */
.m3d-dock .m3d-panneau > .m3d-suivant { display: none; }
.m3d-dock .m3d-pied-reglages .m3d-mention-texte { display: none; }
.m3d-dock .m3d-tete { gap: 6px; }
.m3d-dock .m3d-bloc { gap: 9px; }
/* couvertures sur deux rangées serrées : 3 + 2, 2 + 2, ou une seule rangée */
.m3d-dock .m3d-mats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.m3d-dock .m3d-mats button { grid-column: span 2; padding-inline: 4px; font-size: 12.5px; line-height: 1.2; }
.m3d-dock .m3d-mats button:first-child:nth-last-child(2), .m3d-dock .m3d-mats button:first-child:nth-last-child(2) ~ button,
.m3d-dock .m3d-mats button:first-child:nth-last-child(4), .m3d-dock .m3d-mats button:first-child:nth-last-child(4) ~ button,
.m3d-dock .m3d-mats button:first-child:nth-last-child(5) ~ button:nth-child(n+4) { grid-column: span 3; }
.m3d-dock .m3d-couches button { padding: 5px 6px; gap: 8px; }
/* un fondu en bas du panneau quand il reste des réglages plus bas */
.m3d-dock .m3d-panneau.m3d-defile::after { content: ""; position: sticky; bottom: -18px; height: 26px; margin: -26px -20px -18px; background: linear-gradient(180deg, rgb(255 255 255 / 0), rgb(255 255 255 / .96)); pointer-events: none; }
.m3d-dock .m3d-outils { right: auto; left: 12px; top: 56px; }
.m3d-dock .m3d-parcours, .m3d-dock .m3d-aide { left: calc((100% - var(--m3d-dock, 0px)) / 2); transition: left .45s cubic-bezier(.2, .7, .2, 1), opacity .5s; }
.m3d-dock .m3d-aide { bottom: 66px; }
.m3d-dock .m3d-fiche { max-width: min(264px, calc(100% - var(--m3d-dock, 0px) - 90px)); }
.m3d-dock .m3d-dock-bascule { all: unset; box-sizing: border-box; position: absolute; z-index: 5; top: 26px; right: calc(var(--m3d-dock, 0px) - 6px); display: inline-flex; align-items: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 9px; border-radius: 999px; background: #fff; color: var(--m3d-encre); font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 22px -12px rgba(20, 18, 15, .6), 0 0 0 1px var(--m3d-bd); transition: right .45s cubic-bezier(.2, .7, .2, 1), padding .3s; }
.m3d-dock .m3d-dock-bascule:hover { background: color-mix(in srgb, var(--m3d-acc) 8%, #fff); }
.m3d-dock .m3d-dock-bascule span { display: none; }
.m3d-dock .m3d-dock-bascule svg { width: 18px; height: 18px; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.m3d-dock.m3d-dock-ferme .m3d-dock-bascule { right: 14px; padding: 0 15px 0 10px; }
.m3d-dock.m3d-dock-ferme .m3d-dock-bascule span { display: inline; }
.m3d-dock.m3d-dock-ferme .m3d-dock-bascule svg { transform: rotate(180deg); }
[data-m3d-etat="repli"] .m3d-dock-bascule, [data-m3d-etat="charge"] .m3d-dock-bascule { display: none; }
/* écran peu haut (portable) : le titre du chapitre s'efface, les réglages remontent */
@media (max-height: 820px) { .m3d-dock .m3d-tete h3 { display: none; } }
.m3d-grille:fullscreen { background: var(--m3d-fond); }
.m3d-grille:fullscreen .m3d-scene { height: 100vh; border-radius: 0; }
/* présentation des couches : le bouton devient le témoin de la lecture */
.m3d .m3d-bouton.m3d-visite { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; }
.m3d-visite svg { flex: none; width: 15px; height: 15px; fill: currentColor; stroke: none; }
.m3d .m3d-bouton.m3d-visite.m3d-en-cours { background: var(--m3d-encre); border-color: var(--m3d-encre); color: #fff; }
.m3d-jauge-visite { height: 4px; }
.m3d-jauge-visite[hidden] { display: none; }
.m3d-jauge-visite i { transform: scaleX(.02); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
/* bloc d'explication repliable (ouvert d'office hors du mode « réglages dans la scène ») */
.m3d-pli > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.m3d-pli > summary::-webkit-details-marker { display: none; }
.m3d-pli > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--m3d-acc); border-bottom: 2px solid var(--m3d-acc); transform: rotate(45deg); transition: transform .25s; }
.m3d-pli[open] > summary::after { transform: rotate(-135deg); }
/* version sans animation, à la demande (?reduit) */
.m3d-reduit *, .m3d-reduit *::before, .m3d-reduit *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }

/* ——— explications sous la maquette : quatre compositions différentes, jamais deux fois le même bloc */
.m3d-bande { padding: clamp(52px, 6.4vw, 96px) 0; }
.m3d-etiquette { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--acc, #D9621F); }
.m3d-etiquette::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.m3d-h2 { margin: 0; font-family: var(--f-display, inherit); font-weight: 600; font-size: clamp(27px, 3.1vw, 40px); line-height: 1.1; letter-spacing: -.02em; color: var(--titre, #16181D); text-wrap: balance; }
.m3d-h2 em { font-style: italic; color: var(--acc, #D9621F); }
.m3d-h2-grand { font-size: clamp(30px, 3.9vw, 52px); line-height: 1.05; letter-spacing: -.028em; }
.m3d-chapo { margin: 16px 0 0; max-width: 62ch; font-size: clamp(15.5px, 1.25vw, 17.5px); line-height: 1.7; color: var(--t2, #5b5f66); }
.m3d-bande-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 28px 0 0; }
.m3d-voir { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--titre, #16181D); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--acc, #D9621F) 55%, transparent); text-underline-offset: 5px; }
.m3d-voir[hidden] { display: none; }
.m3d-voir svg { width: 21px; height: 21px; color: var(--acc, #D9621F); transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.m3d-voir:hover svg { transform: rotate(-14deg) scale(1.12); }
.m3d-voir:focus-visible { outline: 2px solid var(--acc, #D9621F); outline-offset: 4px; border-radius: 6px; }

/* 1 · les saisons : une frise, quatre repères sur une même ligne */
.m3d-bande-frise { background: var(--teinte, #eef2fb); }
.m3d-bande-tete { max-width: 780px; }
.m3d-frise { position: relative; list-style: none; margin: clamp(34px, 4vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(18px, 2.6vw, 40px); }
.m3d-frise::before { content: ""; position: absolute; left: 28px; right: 28px; top: 27px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #5a9d55, #dc9a1a 36%, #bd6a37 66%, #5b8cc9); transform-origin: left center; }
.m3d-frise li { position: relative; display: grid; align-content: start; justify-items: start; }
.m3d-frise-pt { position: relative; width: 56px; height: 56px; margin-bottom: 20px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--c); box-shadow: 0 0 0 7px var(--teinte, #eef2fb), 0 16px 28px -16px color-mix(in srgb, var(--c) 75%, #000); transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.m3d-frise li:hover .m3d-frise-pt { transform: translateY(-4px) scale(1.06); }
.m3d-frise li:nth-child(4n+1) { --c: #4c9247; --cn: #d18f0c; } .m3d-frise li:nth-child(4n+2) { --c: #d18f0c; --cn: #b9602c; } .m3d-frise li:nth-child(4n+3) { --c: #b9602c; --cn: #4a7fc2; } .m3d-frise li:nth-child(4n+4) { --c: #4a7fc2; --cn: #4c9247; }
.m3d-frise-pt svg { width: 26px; height: 26px; }
.m3d-saison-1 svg { animation: m3d-pousse 5s ease-in-out infinite; transform-origin: 50% 90%; }
.m3d-saison-2 svg { animation: m3d-tour 26s linear infinite; }
.m3d-saison-3 svg { animation: m3d-balance 5.5s ease-in-out infinite; transform-origin: 20% 80%; }
.m3d-saison-4 svg { animation: m3d-tour 34s linear infinite reverse; }
@keyframes m3d-pousse { 50% { transform: scale(1.09) rotate(-3deg); } }
@keyframes m3d-balance { 50% { transform: rotate(9deg); } }
.m3d-frise b { font-family: var(--f-display, inherit); font-size: 18px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--titre, #16181D); }
.m3d-frise p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.62; color: var(--t2, #5b5f66); }

/* 2 · l'entretien : le titre reste en vue à gauche, le pas à pas défile à droite */
.m3d-duo { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 88px); align-items: start; }
.m3d-duo-tete { position: sticky; top: 124px; }
.m3d-pas { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.m3d-pas li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 0 18px; align-items: start; padding: 24px 26px 24px 16px; border-radius: 22px; background: color-mix(in srgb, var(--acc, #D9621F) 5%, #fff); }
.m3d-pas-n { font-family: var(--f-display, inherit); font-size: 60px; line-height: .86; font-weight: 600; letter-spacing: -.04em; text-align: center; color: transparent; -webkit-text-stroke: 1.5px var(--acc, #D9621F); transition: color .35s, transform .35s cubic-bezier(.2, .7, .2, 1); }
.m3d-pas li:hover .m3d-pas-n { color: var(--acc, #D9621F); transform: translateY(-3px); }
.m3d-pas b { display: block; margin-top: 3px; font-family: var(--f-display, inherit); font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -.012em; color: var(--titre, #16181D); }
.m3d-pas p { margin: 7px 0 0; font-size: 15px; line-height: 1.64; color: var(--t2, #5b5f66); }

/* 3 · l'hydrofuge : un panneau sombre, centré, où la pluie file */
.m3d-bande-nuit { padding: clamp(14px, 2vw, 28px) 0; }
.m3d-nuit { position: relative; overflow: hidden; padding: clamp(44px, 6vw, 88px) clamp(20px, 5vw, 76px); border-radius: clamp(24px, 3vw, 40px); text-align: center; color: #fff; background: radial-gradient(110% 80% at 88% -10%, color-mix(in srgb, var(--titre, #16233f) 62%, #7fb2ff) 0, transparent 62%), linear-gradient(158deg, color-mix(in srgb, var(--titre, #16233f) 90%, #000), color-mix(in srgb, var(--titre, #16233f) 68%, #000)); }
.m3d-nuit > * { position: relative; }
.m3d-nuit-gouttes { position: absolute; inset: 0; pointer-events: none; }
.m3d-nuit-gouttes i { position: absolute; top: -90px; width: 2px; height: 74px; border-radius: 2px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .2)); transform: rotate(9deg); animation: m3d-goutte 4.2s linear infinite; }
.m3d-nuit-gouttes i:nth-child(1) { left: 7%; animation-delay: -.4s; } .m3d-nuit-gouttes i:nth-child(2) { left: 24%; animation-delay: -2.6s; animation-duration: 5s; }
.m3d-nuit-gouttes i:nth-child(3) { left: 58%; animation-delay: -1.5s; animation-duration: 3.7s; } .m3d-nuit-gouttes i:nth-child(4) { left: 78%; animation-delay: -3.3s; } .m3d-nuit-gouttes i:nth-child(5) { left: 93%; animation-delay: -1s; animation-duration: 5.4s; }
@keyframes m3d-goutte { to { translate: -150px 1100px; } }
.m3d-nuit-tete { max-width: 800px; margin: 0 auto; }
.m3d-nuit .m3d-etiquette { color: color-mix(in srgb, var(--acc, #D9621F) 78%, #fff); }
.m3d-nuit .m3d-etiquette::after { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.m3d-nuit .m3d-h2 { color: #fff; font-size: clamp(29px, 3.6vw, 48px); }
.m3d-nuit .m3d-h2 em { color: color-mix(in srgb, var(--acc, #D9621F) 80%, #fff); }
.m3d-nuit .m3d-chapo { margin-inline: auto; color: rgba(255, 255, 255, .8); }
.m3d-nuit-points { list-style: none; margin: clamp(30px, 4vw, 52px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; text-align: left; }
.m3d-nuit-points li { padding: 24px 22px 26px; border-radius: 20px; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13); transition: transform .35s cubic-bezier(.2, .7, .2, 1), background .3s; }
.m3d-nuit-points li:hover { transform: translateY(-5px); background: rgba(255, 255, 255, .12); }
.m3d-nuit-points svg { display: block; width: 30px; height: 30px; margin-bottom: 14px; color: color-mix(in srgb, var(--acc, #D9621F) 78%, #fff); }
.m3d-nuit-points b { display: block; font-family: var(--f-display, inherit); font-size: 18px; font-weight: 600; line-height: 1.25; color: #fff; }
.m3d-nuit-points p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.64; color: rgba(255, 255, 255, .78); }
.m3d-nuit .m3d-bande-actions { justify-content: center; margin-top: clamp(26px, 3vw, 38px); }
.m3d-nuit .m3d-voir { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); }
.m3d-nuit .m3d-voir svg { color: #fff; }

/* 4 · la réparation : des signes à déplier, un par un */
.m3d-bande-signes { background: color-mix(in srgb, var(--acc, #D9621F) 5%, #fff); }
.m3d-signes-tete { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px clamp(28px, 5vw, 88px); align-items: end; }
.m3d-signes-tete .m3d-chapo { margin: 0 0 4px; }
.m3d-signes { margin-top: clamp(28px, 3.6vw, 48px); display: grid; gap: 10px; }
.m3d-signe { border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--acc, #D9621F) 14%, #fff), 0 18px 40px -34px rgba(20, 18, 15, .5); }
.m3d-signe h3 { margin: 0; font: inherit; }
.m3d-signe button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) 40px; gap: 16px; align-items: center; padding: 19px 22px; border-radius: 20px; cursor: pointer; }
.m3d-signe button:focus-visible { outline: 2px solid var(--acc, #D9621F); outline-offset: 2px; }
.m3d-signe-n { font-family: var(--f-display, inherit); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--acc, #D9621F); }
.m3d-signe-t { font-family: var(--f-display, inherit); font-size: clamp(17px, 1.6vw, 21px); font-weight: 600; line-height: 1.25; letter-spacing: -.012em; color: var(--titre, #16181D); transition: color .25s; }
.m3d-signe button:hover .m3d-signe-t { color: var(--acc, #D9621F); }
.m3d-signe i { position: relative; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--acc, #D9621F) 12%, #fff); transition: transform .4s cubic-bezier(.2, .7, .2, 1), background .3s; }
.m3d-signe i::before, .m3d-signe i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; margin: -1px 0 0 -7px; border-radius: 2px; background: var(--acc, #D9621F); transition: transform .4s cubic-bezier(.2, .7, .2, 1), background .3s; }
.m3d-signe i::after { transform: rotate(90deg); }
.m3d-signe.ouvert i { background: var(--acc, #D9621F); transform: rotate(180deg); }
.m3d-signe.ouvert i::before, .m3d-signe.ouvert i::after { background: #fff; }
.m3d-signe.ouvert i::after { transform: rotate(0deg); }
.m3d-signe-corps { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s cubic-bezier(.2, .7, .2, 1); }
.m3d-signe-corps > div { min-height: 0; overflow: hidden; }
.m3d-signe-corps p { margin: 0; padding: 0 78px 24px 72px; max-width: 86ch; font-size: 15.5px; line-height: 1.7; color: var(--t2, #5b5f66); }
.m3d-anime .m3d-signe:not(.ouvert) .m3d-signe-corps { grid-template-rows: 0fr; }

/* apparitions au défilement (posées par le script : sans lui, tout est visible) */
.m3d-anime [data-m3d-app] { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 110ms); }
.m3d-anime [data-m3d-app].vu { opacity: 1; transform: none; }
.m3d-anime .m3d-frise[data-m3d-app] { opacity: 1; transform: none; }
.m3d-anime .m3d-frise[data-m3d-app]::before { transform: scaleX(0); transition: transform 1.5s cubic-bezier(.3, .7, .2, 1) .1s; }
.m3d-anime .m3d-frise[data-m3d-app].vu::before { transform: none; }
.m3d-anime .m3d-frise[data-m3d-app] li { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 260ms + 150ms); }
.m3d-anime .m3d-frise[data-m3d-app].vu li { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .m3d-frise { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  /* à la verticale, la ligne relie chaque repère au suivant et s'arrête au dernier */
  .m3d-frise::before { display: none; }
  .m3d-frise li:not(:last-child)::after { content: ""; position: absolute; left: 27px; top: 56px; bottom: -28px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--c), var(--cn)); transform-origin: center top; }
  .m3d-anime .m3d-frise[data-m3d-app] li::after { transform: scaleY(0); transition: transform .7s cubic-bezier(.3, .7, .2, 1); transition-delay: calc(var(--i, 0) * 260ms + 420ms); }
  .m3d-anime .m3d-frise[data-m3d-app].vu li::after { transform: none; }
  .m3d-frise li { grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; align-items: start; }
  .m3d-frise-pt { grid-row: 1 / span 2; margin-bottom: 0; }
  .m3d-frise b { align-self: end; padding-top: 4px; }
  .m3d-frise p { grid-column: 2; margin-top: 6px; }
  .m3d-duo { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .m3d-duo-tete { position: static; }
  .m3d-signes-tete { grid-template-columns: minmax(0, 1fr); align-items: start; }
  /* trois cartes : côte à côte ou empilées, jamais deux puis une */
  .m3d-nuit-points { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .m3d-anime [data-m3d-app], .m3d-anime .m3d-frise[data-m3d-app] li { opacity: 1 !important; transform: none !important; }
  .m3d-anime .m3d-signe:not(.ouvert) .m3d-signe-corps { grid-template-rows: 1fr; }
}
@media (max-width: 560px) {
  .m3d-bande { padding: 46px 0; }
  .m3d-bande-nuit { padding: 10px 0; }
  .m3d-pas li { grid-template-columns: 52px minmax(0, 1fr); gap: 0 12px; padding: 20px 18px 20px 10px; border-radius: 18px; }
  .m3d-pas-n { font-size: 46px; }
  .m3d-nuit { text-align: left; }
  .m3d-nuit .m3d-etiquette::after { display: none; }
  .m3d-nuit .m3d-bande-actions { justify-content: flex-start; }
  .m3d-signe button { grid-template-columns: 26px minmax(0, 1fr) 36px; gap: 10px; padding: 16px 14px; }
  .m3d-signe i { width: 36px; height: 36px; }
  .m3d-signe-corps p { padding: 0 16px 20px 50px; font-size: 15px; }
  .m3d-bande-actions .btn { width: 100%; justify-content: center; text-align: center; }
  .m3d-suivant:has(> span) { grid-template-columns: minmax(0, 1fr); }
  .m3d-suivant > span { display: none; }
}