/* Ajustements mobiles et centrage demandé pour le formulaire sur ordinateur. */
.audit__cta { justify-content: center; text-align: center; }
.audit__note { text-align: center; }
#quartier-liste-bouton { display: none; }
.mobile-copy { display: none; }

@media (max-width: 768px) {
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }
  .result__cta {
    display: block; margin-top: 14px; padding: 16px;
    border: 1px solid var(--color-border); border-top: 3px solid var(--color-accent);
    border-radius: var(--radius); background: var(--color-white);
    box-shadow: var(--shadow-soft);
  }
  .result__cta .result__cta-title {
    display: block; font-family: var(--font-serif); font-size: 19px;
    font-weight: 700; line-height: 1.22; color: var(--color-ink);
  }
  .result__cta .result__cta-copy {
    display: block; margin-top: 9px; font-size: 14px;
    line-height: 1.35; color: var(--color-ink-soft);
  }
  .result__cta .btn { margin-top: 16px; }
  .result__cta .result__cta-note {
    display: block; margin-top: 9px; font-size: 12px;
    line-height: 1.35; color: var(--color-ink-soft);
  }
  html.is-map-step, body.is-map-step { overflow: hidden; overscroll-behavior: none; }
  body.is-map-step { touch-action: none; }
  body.is-map-step .site-header {
    position: fixed; inset: 0 0 auto; z-index: 110;
    padding-top: env(safe-area-inset-top);
  }
  body.is-map-step .site-header .nav { padding-block: 0.2rem; }
  body.is-map-step .site-header .nav__logo img { height: 36px; }

  body.is-map-step .estim-hero {
    position: fixed; inset: calc(54px + env(safe-area-inset-top)) 0 0;
    z-index: 5; height: calc(100vh - 54px - env(safe-area-inset-top));
    height: calc(100svh - 54px - env(safe-area-inset-top));
    height: calc(100dvh - 54px - env(safe-area-inset-top));
    padding: 0; overflow: hidden;
  }
  body.is-map-step .estim-hero > .estim-layout {
    width: 100%; height: 100%; max-width: none; padding: 0; display: block;
  }
  body.is-map-step .estim-layout__intro,
  body.is-map-step .estim__nav { animation: appear .35s ease-out both; }
  @keyframes appear { from { opacity: 0; transform: translateY(6px); } }
  body.is-map-step .estim-layout__intro {
    position: absolute; z-index: 9; top: 12px; left: 12px;
    width: min(300px, calc(100% - 76px)); padding: 9px 11px;
    border: 1px solid var(--color-border); border-radius: 13px;
    background: rgba(250,249,246,.94); box-shadow: var(--shadow-soft);
  }
  body.is-map-step .estim-layout__intro .section__eyebrow { margin: 0; font-size: 11px; }
  body.is-map-step .estim-layout__intro h1 { margin: 2px 0; font-size: 17px; line-height: 1.12; }
  body.is-map-step .estim-layout__intro-text > p:last-child { display: none; }
  body.is-map-step ul.estim-atouts {
    margin: 5px 0 0; gap: 0 6px; flex-wrap: nowrap; overflow: hidden;
    white-space: nowrap; font-size: 10px; font-weight: 600;
  }
  body.is-map-step ul.estim-atouts li::before { display: none; }
  body.is-map-step ul.estim-atouts li + li::before {
    content: '·'; display: inline; margin-right: 6px; color: var(--color-accent-text);
  }

  body.is-map-step .estim { height: 100%; background: transparent; border: 0; box-shadow: none; }
  body.is-map-step .estim__topbar { position: absolute; z-index: 12; inset: 0 0 auto; padding: 0; }
  body.is-map-step .estim__meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body.is-map-step .estim__progress { height: 3px; margin: 0; border-radius: 0; }
  body.is-map-step .estim__body { padding: 0; height: 100%; }
  body.is-map-step #estim-parcours { height: 100%; }
  body.is-map-step [data-etape="1"] { display: block; height: 100%; }
  body.is-map-step .locanova-map-stage { height: 100%; padding: 0; }
  body.is-map-step .locanova-map-stage__map, body.is-map-step .qmap { height: 100%; }
  body.is-map-step .locanova-map-stage .qmap__frame {
    height: 100%; min-height: 0; max-height: none;
  }
  /* Le viewBox et la transformation d'origine ne sont jamais redéfinis. */
  body.is-map-step .locanova-map-stage .qmap__svg { width: 100%; height: 100%; max-height: none; touch-action: none !important; }
  body.is-map-step .locanova-map-stage .qmap__zone.is-selected,
  body.is-map-step .locanova-map-stage .qmap__commune.is-selected { animation: selectionFlash .28s ease-out; }
  @keyframes selectionFlash { 45% { opacity: .65; } }
  body.is-map-step .qmap__hint {
    position: absolute; z-index: 7; top: 148px; left: 12px;
    max-width: 215px; margin: 0; padding: 5px 8px; border-radius: 9px;
    background: rgba(250,249,246,.89); font-size: 11px;
    transition: opacity .2s ease;
  }
  body.is-map-step #estimation.is-map-used .qmap__hint { opacity: 0; pointer-events: none; }
  body.is-map-step .qmap__hint--pointeur { display: none; }
  body.is-map-step .qmap__hint--tactile { display: inline; }
  body.is-map-step .qmap__etat { display: none; }
  body.is-map-step .locanova-map-stage__panel { display: contents; }
  body.is-map-step .locanova-map-stage__panel .estim__head { position: absolute; z-index: 8; top: 101px; left: 12px; right: 70px; padding: 0; pointer-events: none; }
  body.is-map-step .estim__head .estim__numero, body.is-map-step .estim__head .estim__intro { display: none; }
  body.is-map-step .estim__head .estim__titre {
    display: inline-block; padding: 6px 9px; border-radius: 9px;
    background: rgba(250,249,246,.93); font-size: 14px; line-height: 1.15;
  }
  body.is-map-step .locanova-map-stage .qmap__controls { right: 12px; bottom: 44%; gap: 8px; }
  body.is-map-step .locanova-map-stage .qmap__btn {
    width: 48px; height: 48px; border-radius: 12px;
  }
  body.is-map-step .locanova-map-stage .qmap__readout {
    position: fixed; z-index: 16; left: 9px; right: 9px;
    bottom: calc(75px + env(safe-area-inset-bottom));
    min-height: 0; margin: 0; padding: 13px 14px 2px;
    border-radius: 16px 16px 0 0; background: rgba(250,249,246,.98);
    box-shadow: 0 -10px 28px -18px rgba(36,30,24,.55);
  }
  body.is-map-step .qmap__readout-value { font-size: 16px; }
  body.is-map-step .qmap__fallback { position: fixed; z-index: 17; left: 22px; bottom: calc(78px + env(safe-area-inset-bottom)); margin: 0; }
  body.is-map-step .qmap__fallback label, body.is-map-step .qmap__select { display: none; }
  body.is-map-step #quartier-liste-bouton {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
    border: 1px solid var(--color-border); border-radius: 999px;
    color: var(--color-ink); background: var(--color-white); font-size: 12px; font-weight: 700;
  }
  body.is-map-step .estim__nav {
    position: fixed; z-index: 15; bottom: env(safe-area-inset-bottom); left: 9px; right: 9px;
    min-height: 78px; margin: 0; padding: 10px 12px;
    border: 0; border-radius: 0 0 16px 16px;
    background: rgba(250,249,246,.98);
  }
  body.is-map-step .estim__nav .btn { min-height: 48px; margin-left: auto; padding: 8px 22px; }
  body.is-map-step .estim__hint { flex: 1 1 100%; font-size: 12px; line-height: 1.2; }
  body.is-map-step .estim__hint:empty { display: none; }

  .estim__step, .result__hero { scroll-margin-top: 80px; }
  .estim__head .estim__titre { scroll-margin-top: 80px; }
  .estim__hint.is-alert { color: #713d21; font-weight: 700; animation: alertMove .35s ease-out; }
  .estim__surface.is-missing { border: 2px solid #a35336; animation: alertMove .35s ease-out; }
  @keyframes alertMove { 25%, 75% { transform: translateX(3px); } 50% { transform: translateX(-3px); } }

  [data-etape="2"] { gap: 10px; }
  [data-etape="2"] .estim__intro { font-size: 14px; line-height: 1.3; }
  [data-etape="2"] .estim__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  [data-etape="2"] .option-card { min-height: 48px; padding: 10px 9px; }
  [data-etape="2"] .option-card__label { font-size: 16px; }
  [data-etape="2"] .estim__surface { padding: 10px 12px; gap: 8px; }
  [data-etape="2"] .estim__surface input { width: 82px; font-size: 16px; }
  [data-etape="2"] .estim__surface label { font-size: 16px; }
  [data-etape="2"] .estim__nav { margin-top: 8px; }

  #estim-resultat .estim__body { padding-top: 12px; }
  #estim-resultat .result__hero { gap: 10px; padding: 10px 12px; }
  #estim-resultat .result__dial { width: 78px; height: 78px; }
  #estim-resultat .result__score { font-size: 25px; }
  #estim-resultat .result__niveau { font-size: 20px; }
  #estim-resultat .result__cols { grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
  #estim-resultat .insight { padding: 9px; }
  #estim-resultat .insight__title { font-size: 14px; line-height: 1.2; }
  #estim-resultat .insight li { font-size: 12px; line-height: 1.25; }
  #estim-resultat .result__cta { margin-top: 10px; }
  #estim-resultat .result__cta .btn { min-height: 48px; padding: 8px 12px; font-size: 14px; line-height: 1.2; }
  #estim-resultat .result__audit { margin-top: 14px; }

  .quartier-dialogue {
    width: min(100%, 520px); max-height: min(82dvh, 730px); border: 0;
    margin: auto auto 0; padding: 16px; border-radius: 18px 18px 0 0;
    color: var(--color-ink); background: var(--color-bg); box-shadow: var(--shadow-soft);
  }
  .quartier-dialogue::backdrop { background: rgba(36,30,24,.55); }
  .quartier-dialogue { touch-action: auto; }
  .quartier-dialogue__entete { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .quartier-dialogue__entete h2 { margin: 0; font-size: 20px; }
  #quartier-dialogue-fermer { flex: 0 0 44px; min-height: 44px; border: 1px solid var(--color-border); border-radius: 50%; background: white; font-size: 26px; }
  .quartier-dialogue__choix { display: grid; gap: 7px; max-height: calc(82dvh - 98px); overflow-y: auto; overscroll-behavior: contain; padding-block: 12px env(safe-area-inset-bottom); }
  .quartier-dialogue__choix button { min-height: 48px; padding: 10px; border: 1px solid var(--color-border); border-radius: 10px; background: white; text-align: left; }
  .audit { max-height: calc(100dvh - 20px); }
  .audit__form { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .audit input:focus { scroll-margin-bottom: 22px; }
}

@media (max-width: 768px) and (max-height: 640px) {
  body.is-map-step .estim-layout__intro { top: 7px; padding: 6px 9px; }
  body.is-map-step .estim-layout__intro h1 { font-size: 15px; }
  body.is-map-step .locanova-map-stage__panel .estim__head { top: 80px; }
  body.is-map-step .estim__head .estim__titre { font-size: 13px; }
}

@media (max-width: 768px) and (orientation: landscape) {
  body.is-map-step .estim-layout__intro { width: 230px; }
  body.is-map-step .estim-layout__intro h1 { font-size: 14px; }
  body.is-map-step .locanova-map-stage__panel .estim__head { top: 78px; }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .estim__hint.is-alert, .estim__surface.is-missing,
  body.is-map-step .estim-layout__intro, body.is-map-step .estim__nav,
  body.is-map-step .locanova-map-stage .qmap__zone.is-selected,
  body.is-map-step .locanova-map-stage .qmap__commune.is-selected { animation: none; }
}

/* Révision après les captures iPhone : titres, progression et panneau sans recouvrement. */
@media (max-width: 768px) {
  html { scroll-behavior: auto; }
  .estim { overflow-anchor: none; }
  body:not(.is-map-step) .estim__topbar {
    position: relative; z-index: 2;
    padding: 9px 16px 8px; background: rgba(250,249,246,.97);
    border-bottom: 1px solid var(--color-border);
  }
  body:not(.is-map-step) .estim__progress { margin-top: 6px; height: 4px; }
  body:not(.is-map-step) .estim__compteur { margin: 0; }
  body.is-map-step .estim__topbar { z-index: 20; }
  body.is-map-step .estim__meta {
    position: absolute; top: 6px; left: 12px; width: auto; height: auto;
    overflow: visible; clip-path: none;
  }
  body.is-map-step .estim__compteur {
    margin: 0; padding: 4px 8px; border-radius: 8px;
    background: rgba(250,249,246,.94); color: var(--color-accent-text);
    font-size: 11px; letter-spacing: .06em;
  }
  body.is-map-step .estim-layout__intro {
    top: 39px; width: min(308px, calc(100% - 24px)); padding: 9px 11px;
  }
  body.is-map-step .estim-layout__intro h1 { font-size: 17px; line-height: 1.12; }
  body.is-map-step .locanova-map-stage__panel .estim__head { top: 140px; left: 12px; right: 12px; }
  body.is-map-step .estim__head .estim__titre {
    padding: 7px 10px; font-size: 16px; line-height: 1.22;
    background: rgba(250,249,246,.96);
  }
  body.is-map-step .qmap__hint { top: 185px; }
  body.is-map-step .locanova-map-stage .qmap__controls {
    bottom: calc(160px + env(safe-area-inset-bottom));
  }

  body.is-map-step .estim__nav {
    z-index: 30; left: 10px; right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 0; display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px; align-items: center;
    padding: 11px 12px 12px;
    border: 1px solid var(--color-border); border-radius: 16px;
    box-shadow: 0 -10px 30px -18px rgba(36,30,24,.45);
  }
  body.is-map-step .estim__nav .qmap__readout {
    position: static; grid-column: 1 / -1; grid-row: 1;
    display: grid; gap: 2px; min-height: 0; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
  }
  body.is-map-step .estim__nav .qmap__readout-label {
    font-size: 11px; font-weight: 700; letter-spacing: .08em;
  }
  body.is-map-step .estim__nav .qmap__readout-value {
    font-size: 18px; line-height: 1.15; white-space: normal;
  }
  body.is-map-step .estim__nav .qmap__fallback {
    position: static; z-index: auto; grid-column: 1; grid-row: 3;
    min-width: 0; margin: 0;
  }
  body.is-map-step .estim__nav #quartier-liste-bouton {
    justify-content: center; width: 100%; min-height: 46px;
    padding: 7px 8px; font-size: 13px;
  }
  body.is-map-step .estim__nav #estim-suivant {
    grid-column: 2; grid-row: 3; min-height: 46px;
    margin: 0; padding: 7px 18px; white-space: nowrap;
  }
  body.is-map-step .estim__nav .estim__hint {
    grid-column: 1 / -1; grid-row: 2; margin: 0;
    font-size: 12px; line-height: 1.25;
  }

  [data-etape="2"] { gap: 14px; }
  [data-etape="2"] .estim__titre { font-size: 24px; }
  [data-etape="2"] .estim__intro { font-size: 16px; line-height: 1.38; }
  [data-etape="2"] .estim__grid { gap: 11px; }
  [data-etape="2"] .option-card { min-height: 58px; padding: 11px 12px; }
  [data-etape="2"] .estim__surface { min-height: 72px; padding: 12px; }

  [data-etape="3"] { gap: 12px; }
  [data-etape="3"] .estim__titre { font-size: 23px; line-height: 1.15; }
  [data-etape="3"] .estim__intro { font-size: 15px; line-height: 1.3; }
  [data-etape="3"] .estim__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  }
  [data-etape="3"] .option-card--count {
    min-height: 65px; padding: 9px; gap: 0; align-content: center;
  }
  [data-etape="3"] .option-card--count:last-child { grid-column: 1 / -1; }
  [data-etape="3"] .option-card__nombre { font-size: 25px; line-height: 1; }
  [data-etape="3"] .option-card__unite { font-size: 14px; line-height: 1.2; }

  [data-etape="4"] { gap: 12px; }
  [data-etape="4"] .estim__titre { font-size: 24px; line-height: 1.16; }
  [data-etape="4"] .estim__intro { font-size: 16px; line-height: 1.35; }
  [data-etape="4"] .estim__grid { gap: 9px; }
  [data-etape="4"] .pick { padding: 11px 13px; gap: 11px; align-items: center; }
  [data-etape="4"] .pick__input { width: 19px; height: 19px; margin: 0; }
  [data-etape="4"] .pick__title { font-size: 16px; line-height: 1.25; }
  [data-etape="4"] .pick__desc { margin-top: 2px; font-size: 13px; line-height: 1.3; }

  #estim-resultat .estim__body { padding-top: 14px; display: flex; flex-direction: column; }
  #estim-resultat .result__hero {
    display: flex; flex-direction: column;
    gap: 9px; align-items: center; text-align: center; padding: 20px 16px;
  }
  #estim-resultat .result__dial { width: 158px; height: 158px; }
  #estim-resultat .result__score { font-size: 52px; line-height: 1; }
  #estim-resultat .result__score-sur { font-size: 17px; }
  #estim-resultat .result__eyebrow { font-size: 12px; line-height: 1.2; }
  #estim-resultat .result__niveau { margin-top: 5px; font-size: 24px; line-height: 1.2; }
  #estim-resultat .result__recap { font-size: 14px; line-height: 1.35; }
  #estim-resultat .result__cta { padding: 16px; order: 1; }
  #estim-resultat .result__cta .btn { min-height: 52px; padding: 10px 12px; font-size: 15px; }
  #estim-resultat .result__cta .result__cta-note { font-size: 12px; }
  #estim-resultat .result__cols {
    grid-template-columns: 1fr; gap: 10px; margin-top: 13px; order: 2;
  }
  #estim-resultat .result__audit { order: 3; }
  #estim-resultat .result__note { order: 4; }
  #estim-resultat .insight { padding: 13px 14px; }
  #estim-resultat .insight__title { font-size: 16px; }
  #estim-resultat .insight li { font-size: 14px; line-height: 1.4; }
}

@media (max-width: 768px) and (max-height: 640px) {
  body.is-map-step .estim-layout__intro { top: 35px; padding: 6px 9px; }
  body.is-map-step .estim-layout__intro h1 { font-size: 15px; }
  body.is-map-step .locanova-map-stage__panel .estim__head { top: 124px; }
  body.is-map-step .qmap__hint { display: none; }
  [data-etape="3"] .option-card--count { min-height: 58px; }
}
