:root{--ink:#1b3541;--muted:#657781;--blue:#579dd1;--blue-dark:#357eaf;--pale:#edf7fd;--line:#dfebf0;--bg:#f8fafb;--white:#fff;--red:#b82936;--red-bg:#fff0f0;--ok:#14725d;--ok-bg:#e9f8f2}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--bg);font-size:15px;line-height:1.55}
button,input{font:inherit}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
.wrap{width:min(1130px,calc(100% - 42px));margin:0 auto}
.hidden{display:none!important}
.topbar{background:#fff;border-bottom:1px solid #ecf1f4}
.topbar-inner{min-height:82px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand{display:inline-flex;align-items:center;gap:12px;font-size:20px;font-weight:850;letter-spacing:1.7px;line-height:1}
.brand small{font-size:9px;letter-spacing:1.5px;display:block;margin-top:6px;font-weight:700;color:var(--blue)}
.brand-symbol{background:var(--blue);width:39px;height:39px;display:grid;grid-template-columns:repeat(2,9px);grid-template-rows:repeat(2,9px);align-content:center;justify-content:center;gap:3px;border-radius:10px;transform:rotate(-6deg)}
.brand-symbol i{display:block;background:white;opacity:.92;border-radius:1px}.brand-symbol i:nth-child(2){opacity:.55}.brand-symbol i:nth-child(3){opacity:.7}
.topbar nav{display:flex;align-items:center;gap:25px;font-size:13px;font-weight:700}
.nav-create{color:var(--blue-dark)}
.hero{background:linear-gradient(117deg,#f0f8fd 0%,#e5f2fa 55%,#f4f8fa 100%);overflow:hidden}
.hero-grid{display:grid;grid-template-columns:1.12fr .88fr;align-items:center;min-height:480px;gap:50px;padding:62px 0}
.eyebrow{font-size:12px;font-weight:800;letter-spacing:1.4px;text-transform:uppercase;color:var(--blue-dark)}
h1,h2,h3,p{margin-top:0}
h1{font-size:clamp(36px,4.2vw,56px);line-height:1.11;letter-spacing:-2px;font-weight:780;max-width:650px;margin:20px 0}
h1 span{color:var(--blue-dark)}
.hero p:not(.hero-note){font-size:17px;color:#546b77;max-width:550px;line-height:1.65;margin-bottom:27px}
.primary-button,.secondary-button,.outline-button{display:inline-flex;justify-content:center;align-items:center;gap:10px;min-height:49px;padding:12px 23px;border-radius:10px;font-weight:750;border:1px solid transparent;transition:background-color .15s,transform .15s}
.primary-button{color:white;background:var(--blue-dark);box-shadow:0 7px 17px #3b89bd26}
.primary-button:not(:disabled):hover{background:#246894;transform:translateY(-1px)}
.primary-button:disabled{background:#b8c6ce;color:white;cursor:not-allowed;box-shadow:none}
.secondary-button{background:var(--blue-dark);color:white;cursor:pointer}
.secondary-button:hover{background:#246894}
.outline-button{border-color:#ccdfe7;background:#fff;color:var(--ink)}
.outline-button:hover{background:#f0f7fc}
.hero-note{font-size:12px;color:#78909a;margin:17px 0 0}
.hero-visual{position:relative;display:flex;justify-content:center;align-items:center;min-height:345px}
/* L'en-tête utilise les deux photographies authentiques fournies par MyPixs. */
.hero-example-photo,.hero-example-plan{margin:0;background:white;border:7px solid white;border-radius:14px;box-shadow:0 18px 40px #2a597025;position:relative;flex:0 0 auto;padding-bottom:20px;overflow:hidden}
.hero-example-photo{width:43%;transform:rotate(-5deg);z-index:1}
.hero-example-plan{width:54%;transform:rotate(5deg);z-index:2}
.hero-example-photo img,.hero-example-plan img{width:100%;height:auto;aspect-ratio:1/1;object-fit:contain;display:block}
.hero-example-photo figcaption,.hero-example-plan figcaption{text-align:center;font-size:9px;font-weight:800;color:#547b90;letter-spacing:1.3px;padding-top:7px}
.hero-conversion-arrow{position:absolute;left:41%;top:46%;z-index:3;display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:50%;background:white;color:var(--blue-dark);font-size:29px;box-shadow:0 5px 18px #1c496a24}
.hero-sticker{position:absolute;background:#fff;padding:12px 14px;box-shadow:0 9px 24px #517a912c;border-radius:10px;font-size:13px;font-weight:800}
.sticker-top{top:6%;right:0;transform:rotate(8deg)}.sticker-bottom{bottom:9%;left:2%;transform:rotate(-7deg)}
.builder-section{padding:70px 0 82px}
.section-heading{text-align:center;margin-bottom:36px}
.section-heading h2{font-size:clamp(28px,3vw,37px);letter-spacing:-1.2px;line-height:1.2;margin:11px auto}
.section-heading p{color:var(--muted);margin:0}
.step-panel{background:white;border:1px solid #e3edf1;border-radius:18px;box-shadow:0 6px 25px #1e425809;padding:31px;margin:0 auto 23px}
.step-header{display:flex;align-items:flex-start;gap:16px;margin-bottom:26px}
.step-number{background:var(--pale);color:var(--blue-dark);width:42px;height:42px;border-radius:13px;display:flex;align-items:center;justify-content:center;flex:none;font-weight:850;font-size:20px}
.step-header h3{font-size:20px;margin:0 0 4px;font-weight:800;letter-spacing:-.4px}
.step-header p{color:var(--muted);margin:0;font-size:13px}
.format-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.format-option{min-height:180px;padding:18px 12px 16px;background:#fff;border:1.5px solid #dfe8ed;border-radius:12px;display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--ink);transition:all .15s}
.format-option:hover{border-color:var(--blue)}
.format-option.selected{border:2px solid var(--blue-dark);background:#eff8fe;box-shadow:0 0 0 2px #549ed114}
.format-option strong{font-size:15px;margin-top:7px}.format-option span:not(.format-mini){font-size:13px}.format-option small{font-size:11px;color:var(--muted)}
.format-mini{display:block;height:48px;width:48px;background-color:#d8e8f1;border:3px solid #86a9bc;outline:1px solid #fff;box-shadow:0 0 0 4px #d8e8f1;border-radius:2px;background-image:linear-gradient(#9bb8c780 1px,transparent 1px),linear-gradient(90deg,#9bb8c780 1px,transparent 1px);background-size:8px 8px}
.format-mini.landscape{width:83px;height:42px;margin:3px 0}.format-mini.panorama{width:99px;height:34px;margin:7px 0}.format-mini.large-square{width:56px;height:56px;margin:-4px 0}
.upload-area{background:#f9fcfe;border:2px dashed #b9d6e5;border-radius:15px;text-align:center;padding:33px 16px 39px;transition:background .15s}
.upload-area.dragover{background:#e8f5fd;border-color:var(--blue)}
.upload-icon{margin:0 auto 12px;background:#e4f3fc;color:var(--blue-dark);width:52px;height:52px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:30px;font-weight:600}
.upload-heading{font-weight:750;font-size:16px;margin-bottom:4px}
.upload-area p:not(.upload-heading){font-size:12px;color:var(--muted);margin-bottom:19px}
#photoInput,#replacePhotoInput{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip-path:inset(50%)}
.editor-block{margin-top:0}
.editor-title-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding-bottom:17px}
.editor-title-row>div{display:flex;flex-direction:column}.editor-title-row small{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.text-action{cursor:pointer;font-weight:750;font-size:13px;color:var(--blue-dark);white-space:nowrap}
.text-action:hover{text-decoration:underline}
.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 240px;align-items:start;gap:28px}
.crop-stage{min-width:0;display:flex;justify-content:center;background:#eaf0f3;border-radius:12px;padding:16px;overflow:hidden}
#cropCanvas{touch-action:none;cursor:grab;display:block;width:100%;height:auto;max-width:720px;box-shadow:0 4px 15px #253c4d23;background:#d7dfe5}
#cropCanvas:active{cursor:grabbing}
.crop-tools{padding:16px 2px}.crop-tools label{display:block;font-weight:760;margin-bottom:12px}
.slider-line{display:flex;align-items:center;gap:12px}.slider-line span{font-size:21px;color:var(--muted)}
#zoomSlider{width:100%;accent-color:var(--blue-dark)}
.crop-tools p{font-size:13px;color:var(--muted);margin:22px 0}
.crop-tools .outline-button{font-size:12px;min-height:42px;padding:10px 12px}
.crop-info{border-top:1px solid var(--line);padding-top:20px;margin-top:22px;color:var(--muted);font-size:13px}
.crop-info strong{color:var(--ink)}
.generate-row{display:flex;justify-content:flex-end;align-items:center;gap:18px;margin-top:24px}
.loading-text{color:var(--blue-dark);font-size:13px;margin:0}
.error-line{background:var(--red-bg);color:var(--red);border-radius:8px;padding:11px 14px;margin:18px 0 0}
.waiting-result{border-radius:12px;text-align:center;background:#f7fafb;padding:52px 15px;color:#97aab3;font-size:14px;border:1px dashed #e1e9ec}
.result-status{margin-bottom:20px;border-radius:11px;padding:15px 18px;font-weight:650;display:flex;align-items:flex-start;gap:12px;line-height:1.55}
.result-status::before{content:'✓';font-weight:850;font-size:17px}
.result-status.ok{background:var(--ok-bg);color:var(--ok)}
.result-status.invalid{background:var(--red-bg);color:var(--red)}
.result-status.invalid::before{content:'!';border:2px solid currentColor;border-radius:50%;height:19px;min-width:19px;font-size:13px;display:grid;place-items:center;margin-top:1px}
.result-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(270px,.8fr);gap:22px;align-items:start}
.plan-preview{background:#f7fafb;border:1px solid #edf0f2;border-radius:12px;padding:16px;text-align:center;min-width:0}
.result-label{display:block;font-size:12px;font-weight:750;text-align:left;color:var(--muted);margin-bottom:14px}
#planImg{width:100%;height:auto;max-height:540px;object-fit:contain;background:#fff;border:1px solid #e9eef1}
.image-help{color:var(--muted);font-size:11px;margin:12px 0 0}
.counts-card{border:1px solid #e2ebef;border-radius:12px;padding:20px}
.counts-header{display:flex;justify-content:space-between;align-items:start;gap:8px;margin-bottom:14px}
.counts-header strong{font-size:17px}.counts-header p{font-size:12px;color:var(--muted);margin:3px 0 0}
.total-pieces{padding:5px 8px;background:#eef5f9;border-radius:6px;font-size:11px;font-weight:700;white-space:nowrap}
.counts-list{border-top:1px solid #e8edef}
.count-row{display:flex;align-items:center;justify-content:space-between;padding:11px 9px;border-bottom:1px solid #e9edef;gap:12px;font-size:13px}
.count-row.exceeds{background:var(--red-bg);color:var(--red);font-weight:750;border-radius:6px}
.color-info{display:flex;align-items:center;gap:10px}
.color-swatch{width:21px;height:21px;border:1px solid #cad2d7;border-radius:5px;flex:none}
.color-count{font-variant-numeric:tabular-nums;white-space:nowrap}
.counts-note{font-size:12px;color:var(--muted);margin:15px 0 19px}
.download-button,.retry-button{width:100%;font-size:13px}.retry-button{margin-top:10px}
.tips-section{background:#eff6fa;padding:65px 0 78px}
.tips-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.tip-card{background:white;border-radius:15px;padding:28px 25px;box-shadow:0 5px 20px #2751710a}
.tip-icon{height:44px;width:44px;background:#eaf4fc;border-radius:11px;color:var(--blue-dark);display:flex;align-items:center;justify-content:center;font-size:26px;margin-bottom:16px}
.tip-card h3{font-size:16px;margin:0 0 9px}.tip-card p{font-size:13px;color:var(--muted);margin:0;line-height:1.6}
.site-footer{background:#1a3847;color:#e8f3f8;padding:26px 0;font-size:12px}.site-footer .wrap{display:flex;justify-content:space-between;gap:15px}.site-footer .wrap>span:first-child{font-weight:850;letter-spacing:1px}.site-footer small{opacity:.65;font-size:9px}
:focus-visible{outline:3px solid #e4b651;outline-offset:3px}
@media(max-width:850px){.hero-grid{gap:20px}.format-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-layout,.result-grid{grid-template-columns:1fr}.crop-tools{display:flex;flex-wrap:wrap;gap:12px;align-items:center}.crop-tools label{margin:0}.crop-tools .slider-line{min-width:200px;flex:1}.crop-tools p{flex-basis:100%;margin:0}.crop-info{flex:1;margin:0;padding:10px;border:0}.crop-stage{max-height:760px}}
@media(max-width:620px){.wrap{width:min(100% - 28px,1130px)}.topbar-inner{min-height:70px}.brand{font-size:16px}.brand-symbol{height:33px;width:33px}.topbar nav{gap:10px;font-size:11px}.hero-grid{grid-template-columns:1fr;gap:8px;min-height:auto;padding:45px 0 38px}.hero-visual{display:none}h1{font-size:39px;letter-spacing:-1.3px}.hero p:not(.hero-note){font-size:15px}.builder-section{padding:45px 0}.step-panel{padding:20px 15px;border-radius:14px}.section-heading{margin-bottom:25px}.step-header{gap:12px}.step-header h3{font-size:17px}.step-header p{font-size:12px}.step-number{height:36px;width:36px;font-size:17px}.format-grid{gap:9px}.format-option{min-height:159px;padding:14px 4px}.format-option strong{font-size:13px}.format-option span:not(.format-mini){font-size:12px}.format-option small{font-size:10px}.generate-row{display:flex;flex-direction:column}.generate-row .primary-button{width:100%}.tips-grid{grid-template-columns:1fr}.tips-section{padding:48px 0}.site-footer .wrap{flex-direction:column;gap:6px}.crop-stage{padding:8px}.crop-tools{gap:12px}.crop-tools p{flex-basis:100%}}

/* V2 : démonstration calculée par le vrai moteur et conseils illustrés */
.example-section {padding-top:64px;padding-bottom:70px}
.example-layout {display:grid;grid-template-columns:minmax(0,1fr) 42px minmax(0,1.4fr) minmax(210px,0.95fr);gap:18px;align-items:center;background:#fff;border:1px solid #dfe9f0;border-radius:20px;padding:24px;box-shadow:0 8px 30px rgba(21,55,86,.06)}
.example-layout figure {margin:0;min-width:0;text-align:center}
.example-layout img {width:100%;max-height:370px;object-fit:contain;border-radius:10px}
.example-layout figcaption {margin-top:9px;font-size:13px;color:#54687a}
.example-arrow {font-size:36px;color:#147cc3;text-align:center}
.example-counts {background:#f6f9fc;border-radius:15px;padding:20px;color:#203a50}
.example-counts h3 {margin:0 0 5px;font-size:19px}.example-total {font-size:13px;color:#657b8c;margin:0 0 14px}
.example-counts>div {display:flex;gap:10px;align-items:center;border-bottom:1px solid #dfe7ed;padding:9px 0;font-size:14px}
.example-counts i {width:20px;height:20px;border:1px solid #aebbc6;border-radius:4px;flex-shrink:0}.example-counts strong {margin-left:auto}
.example-valid {font-size:13px;color:#16754a;font-weight:700;line-height:1.45}
.photo-advice {display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:25px 0}
.advice-card {border-radius:18px;padding:22px}.advice-good {background:#eaf7ef}.advice-bad {background:#fff0f0}
.advice-card h3 {margin:0 0 14px}.advice-pictures {display:grid;grid-template-columns:1fr 1fr;gap:15px}.advice-pictures figure {margin:0;text-align:center}
.advice-pictures img {width:100%;max-width:180px;aspect-ratio:1;object-fit:cover;border-radius:12px}.advice-pictures figcaption {font-size:13px;font-weight:600;margin-top:7px}
@media(max-width:850px){.example-layout{grid-template-columns:1fr 1fr}.example-arrow{display:none}.example-counts{grid-column:1/-1}}
@media(max-width:560px){.example-layout{grid-template-columns:1fr}.example-counts{grid-column:auto}.photo-advice{grid-template-columns:1fr}}

/* V3 : tous les exemples et les conseils reprennent les photos choisies. */
.example-photo img,.example-plan img{display:block;aspect-ratio:1/1;object-fit:contain;background:#fff}
.example-plan img{background:#000}
.advice-high-contrast{filter:contrast(1.32) saturate(.9)}
.advice-blur{filter:blur(3.5px)}
.advice-low-contrast{filter:contrast(.4) brightness(1.18) saturate(.45)}
@media(max-width:620px){.hero-visual{display:flex;min-height:215px;max-width:440px;width:100%;margin:16px auto 0;gap:0}.hero-example-photo{width:43%}.hero-example-plan{width:52%}.hero-sticker{padding:6px 9px;font-size:10px}}


/* V4 — priorité mobile, numérotation lisible et aperçu zoomable */
.plan-preview-bar{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:12px}
.plan-preview-bar .result-label{margin-bottom:0}
.zoom-plan-button{font-size:12px;min-height:44px;padding:8px 13px;flex:none}
.plan-scroll{overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;border-radius:8px;background:#101010;max-height:590px;scrollbar-width:thin;text-align:center}
#planImg{width:100%;max-height:540px;height:auto;display:block;border:0;object-fit:contain;margin:0 auto}
.plan-scroll.is-zoomed{text-align:left;max-height:580px}
.plan-scroll.is-zoomed #planImg{width:auto;max-width:none;max-height:none;height:auto;margin:0}
.image-help{font-size:12px;line-height:1.5}
.legend-hint{font-weight:700;font-size:12px;background:#f2f7fa;border-radius:8px;padding:10px;line-height:1.65}
.full-plan-link{display:block;color:var(--blue-dark);font-weight:750;text-decoration:underline;margin:8px auto}
.primary-button,.secondary-button,.outline-button,.text-action,.format-option{touch-action:manipulation}
#zoomSlider{min-height:44px}
@media(max-width:620px){
  body{overflow-x:clip}
  .topbar-inner{gap:8px}
  .topbar nav{gap:0}
  .topbar nav a:not(.nav-create){display:none}
  .topbar nav .nav-create{display:flex;align-items:center;min-height:44px;padding:8px 11px;border-radius:9px;background:#eaf5fc;font-size:12px}
  h1{font-size:clamp(30px,9vw,39px);letter-spacing:-1px}
  .hero-grid{padding-top:34px;padding-bottom:34px}
  .hero-cta{width:100%}
  .hero-visual{min-height:0}
  .step-panel{margin-bottom:15px}
  .format-option{min-height:159px;min-width:0}
  .editor-title-row{align-items:flex-start;flex-wrap:wrap}
  .crop-stage{padding:6px}
  .crop-tools{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .crop-tools label{grid-column:1/-1}
  .crop-tools .slider-line{grid-column:1/-1;min-width:0}
  .crop-tools p{grid-column:1/-1;margin:3px 0}
  .crop-tools .outline-button{grid-column:1/-1;min-height:44px;width:100%}
  .crop-info{grid-column:1/-1;flex:none;padding:8px 0;margin:0}
  .result-panel .step-header{margin-bottom:15px}
  .result-grid{gap:14px}
  .plan-preview{padding:10px}
  .plan-scroll{max-height:390px}
  .plan-scroll.is-zoomed{max-height:440px}
  .counts-card{padding:15px}
  .counts-header{flex-wrap:wrap}
  .count-row{font-size:13px;padding:12px 6px}
  .color-info{gap:7px}
  .image-help{margin:10px 2px 0}
  .example-section{padding-top:35px;padding-bottom:45px}
  .example-layout{padding:14px;gap:14px}
  .example-layout figcaption{font-size:13px}
  .advice-card{padding:16px}
  .advice-pictures{gap:10px}
  .advice-pictures figcaption{font-size:12px}
}
@media(max-width:360px){
  .wrap{width:calc(100% - 22px)}
  .brand{font-size:14px;gap:7px;letter-spacing:1px}
  .brand-symbol{width:29px;height:29px;gap:2px;grid-template-columns:repeat(2,7px);grid-template-rows:repeat(2,7px)}
  .topbar nav .nav-create{font-size:11px;padding:8px}
  .format-option span:not(.format-mini){font-size:11px}
  .format-option small{font-size:9px}
  .plan-preview-bar{flex-wrap:wrap}
  .zoom-plan-button{width:100%}
  .counts-header strong{font-size:15px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition:none!important}}


/* V6 — ergonomie mobile : pincement, zoom précis et téléchargement robuste. */
.zoom-icon-button{
  display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:44px;
  padding:0;border:1px solid #bbd6e5;border-radius:10px;background:#fff;
  font-size:25px;font-weight:700;color:var(--blue-dark);touch-action:manipulation;
}
.zoom-icon-button:disabled{opacity:.4;cursor:default}
.slider-line{gap:8px;flex-wrap:wrap}
.slider-line span{display:none}
.slider-line #zoomSlider{min-width:70px;flex:1;width:unset}
#cropZoomValue{font-size:12px;color:var(--blue-dark);font-weight:800;min-width:50px;text-align:right}
.plan-preview-bar{align-items:flex-start}
.plan-zoom-controls{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.plan-zoom-controls output{font-size:12px;font-variant-numeric:tabular-nums;font-weight:800;min-width:48px}
.fit-plan-button{min-height:44px;padding:8px 11px;font-size:12px}
#planImg{max-height:none;max-width:none;touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-user-drag:none}
.plan-scroll.is-zoomed #planImg{touch-action:none;cursor:grab}
.plan-scroll.is-zoomed #planImg:active{cursor:grabbing}
.mobile-save-button{width:100%;min-height:46px;font-size:13px;text-align:center;margin-top:10px}
.mobile-download-help{font-size:12px;color:var(--muted);line-height:1.55;margin:12px 0 3px}
@media(max-width:620px){
  .plan-preview-bar{flex-direction:column;align-items:stretch;gap:8px}
  .plan-zoom-controls{justify-content:flex-start}
  .plan-zoom-controls output{text-align:center;flex:1}
  .crop-tools .slider-line{gap:6px}
  .crop-tools .slider-line #zoomSlider{min-width:65px}
  .mobile-save-button{font-size:12px}
}
