/* ============ La Légenderie — design system « Golden Hour » ============ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Nunito+Sans:opsz,wght@6..12,400;6..12,700;6..12,800&display=swap');

@font-face { font-family: 'Bebas Neue'; src: url('../fonts/BebasNeue-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-Variable.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('../fonts/PlayfairDisplay-Variable.ttf') format('truetype'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Bangers'; src: url('../fonts/Bangers-Regular.ttf') format('truetype'); font-display: swap; }

:root {
  --primary: #e86a33;        /* corail coucher de soleil */
  --primary-dark: #c2521f;
  --secondary: #f4a950;      /* ambre doré */
  --rose: #c94f6d;           /* rose crépuscule */
  --plum: #2d1b3d;           /* nuit qui arrive */
  --cta: #e86a33;
  --bg: #fff6e9;             /* crème chaude */
  --surface: #ffffff;
  --ink: #41282f;            /* brun profond */
  --ink-soft: #7a6055;
  --ok: #3e7d5a;
  --err: #c0392b;
  --radius: 20px;
  --radius-sm: 14px;
  --border: 1px solid rgba(65, 40, 47, 0.12);
  --shadow: 0 14px 34px rgba(65, 40, 47, 0.16);
  --shadow-lift: 0 24px 50px rgba(65, 40, 47, 0.24);
  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  --z-nav: 50;
  --z-modal: 60;
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[data-visibility='hidden'] { display: none !important; }
/* Navigation de l'aperçu brouillon admin, jamais présente hors URL signée. */
html[data-draft-preview-step='1'] .wizard-panel:not([data-panel='1']),
html[data-draft-preview-step='2'] .wizard-panel:not([data-panel='2']),
html[data-draft-preview-step='4'] .wizard-panel:not([data-panel='4']) { display: none !important; }
html[data-draft-preview-step='1'] .wizard-panel[data-panel='1'],
html[data-draft-preview-step='2'] .wizard-panel[data-panel='2'],
html[data-draft-preview-step='3'] .wizard-panel[data-panel='2'],
html[data-draft-preview-step='4'] .wizard-panel[data-panel='4'] { display: block !important; }
html[data-draft-preview-step='1'] #uploadPreview { display: flex !important; }
html[data-draft-preview-step='2'] #historique:not([data-visibility='hidden']),
html[data-draft-preview-step='3'] #inlineProduct { display: block !important; }
html[data-draft-preview-step='2'] #titreBloc:not([data-visibility='hidden']),
html[data-draft-preview-step='2'] #styleBrief { display: block !important; }
.orientation-pick { border: 0; padding: 0; margin: 0 0 24px; }
.orientation-pick legend { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.orientation-pick .muted { margin-bottom: 12px; }
.orientation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.orientation-card { display: grid; gap: 5px; text-align: left; padding: 16px; border: 2px solid rgba(65,40,47,.16); border-radius: 14px; background: var(--surface); color: var(--ink); cursor: pointer; }
.orientation-card span { color: var(--ink-soft); font-size: .9rem; }
.orientation-card.selected { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(65,40,47,.12); }
@media (max-width: 520px) { .orientation-grid { grid-template-columns: 1fr; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 88% -80px, rgba(244, 169, 80, 0.22), transparent 60%),
    radial-gradient(800px 480px at -120px 45%, rgba(201, 79, 109, 0.10), transparent 60%),
    var(--bg);
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
section { padding: 72px 0; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============ Boutons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-weight: 800; font-size: 1.02rem;
  padding: 14px 30px; min-height: 48px;
  border-radius: 999px; border: none;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-cta {
  background: linear-gradient(135deg, var(--primary), var(--rose));
  color: #fff; box-shadow: 0 12px 28px rgba(232, 106, 51, 0.35);
}
.btn-cta:hover { filter: brightness(1.06); box-shadow: 0 16px 34px rgba(232, 106, 51, 0.42); }
.btn-primary { background: var(--rose); color: #fff; box-shadow: 0 10px 24px rgba(201, 79, 109, 0.32); }
.btn-primary:hover { background: #b34460; }
.btn-ghost {
  background: var(--surface); color: var(--ink);
  border: 1.5px solid rgba(65, 40, 47, 0.22); box-shadow: 0 6px 16px rgba(65, 40, 47, 0.08);
}
.btn-ghost:hover { background: #fff3e2; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-lg { font-size: 1.15rem; padding: 18px 38px; }

/* ============ Navbar ============ */
.nav {
  position: sticky; top: 12px; z-index: var(--z-nav);
  margin: 12px auto 0; max-width: 1120px; padding: 0 20px;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255, 252, 245, 0.9); backdrop-filter: blur(10px);
  border: var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(65, 40, 47, 0.12); padding: 12px 22px;
}
.logo {
  font-family: var(--font-head); font-weight: 700; font-size: 1.45rem;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px;
}
.logo svg { flex: none; }
.nav-links { display: flex; gap: 24px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 800; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }
.nav-links a.btn { color: #fff; }
.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; left: 20px; right: 20px; top: 78px;
    background: var(--surface); border: var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lift); padding: 22px;
  }
  .nav-burger { display: block; }
}

/* ============ Hero ============ */
.hero { padding: 64px 0 48px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; right: -110px; top: -50px;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffd9a0, var(--secondary) 55%, rgba(244, 169, 80, 0) 72%);
  filter: blur(2px); opacity: 0.85; pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero .kicker {
  display: inline-block; color: var(--rose);
  font-weight: 800; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 18px;
}
.hero .accent {
  background: linear-gradient(90deg, var(--primary), var(--rose));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.hero-proof { margin-top: 22px; font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; }

/* Mur de posters */
.poster-wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.poster {
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-lift);
  transform: rotate(-3deg);
  transition: transform 0.25s ease;
}
.poster:hover { transform: rotate(-3deg) translateY(-5px); }
.poster:nth-child(2) { transform: rotate(3deg) translateY(16px); }
.poster:nth-child(2):hover { transform: rotate(3deg) translateY(11px); }
.poster .art { aspect-ratio: 3/4; display: grid; place-items: center; position: relative; }
.poster .label {
  font-family: var(--font-head); font-weight: 600; font-size: 0.85rem;
  padding: 10px 14px; background: var(--surface);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.poster .label .tag { background: #fff3e2; color: var(--primary-dark); border-radius: 999px; padding: 1px 10px; font-size: 0.72rem; font-family: var(--font-body); font-weight: 800; letter-spacing: 0.04em; }

/* ============ Bandeau défilant ============ */
.marquee {
  background: linear-gradient(90deg, var(--plum), #7a2e4d 55%, #a4404a);
  color: #ffe8c7; padding: 13px 0; overflow: hidden; white-space: nowrap;
}
.marquee-track { display: inline-block; animation: scroll 28s linear infinite; }
.marquee span { font-family: var(--font-head); font-weight: 600; margin: 0 28px; }
.marquee .dot { color: var(--secondary); font-style: normal; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============ Cartes / grilles ============ */
.cards { display: grid; gap: 24px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .cards-3, .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards-3, .cards-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px;
}
.card .icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; margin-bottom: 16px; color: #fff;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

/* Cartes de style (landing + wizard) */
.style-card {
  cursor: pointer; overflow: hidden; padding: 0; text-align: left;
  background: var(--surface); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-body); font-size: inherit; color: inherit; width: 100%;
}
.style-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.style-card .swatch { aspect-ratio: 16/10; position: relative; overflow: hidden; }
.style-card .swatch img { width: 100%; height: 100%; object-fit: cover; }
.style-card .body { padding: 16px 18px 18px; }
.style-card .tagline { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.style-card.selected { outline: 3px solid var(--primary); outline-offset: -3px; }
.style-card.selected .body::after {
  content: 'Sélectionné ✓'; display: inline-block; margin-top: 8px;
  background: linear-gradient(135deg, var(--primary), var(--rose)); color: #fff;
  font-weight: 800; font-size: 0.8rem; padding: 2px 12px; border-radius: 999px;
}

/* Étapes "comment ça marche" */
.step-num {
  font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  box-shadow: 0 10px 22px rgba(232, 106, 51, 0.3); margin-bottom: 16px;
}

/* Formats & prix */
.format-card { text-align: center; position: relative; }
.format-card .dims { color: var(--ink-soft); font-weight: 700; font-size: 0.9rem; }
.format-card .prix { font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; color: var(--primary); }
.format-card .badge {
  position: absolute; top: -14px; right: 14px;
  background: var(--rose); color: #fff;
  font-weight: 800; font-size: 0.78rem; padding: 4px 14px; border-radius: 999px;
  box-shadow: 0 6px 14px rgba(201, 79, 109, 0.35); transform: rotate(3deg);
}
.paper-stack { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 12px 0 6px; }
.paper-stack .sheet { background: #fff3e2; border: 1.5px solid #d9b98c; border-radius: 4px; }

/* Témoignages */
.quote-card .stars { color: #d97c1e; font-size: 1.1rem; letter-spacing: 2px; margin-bottom: 10px; }
.quote-card footer { font-weight: 800; margin-top: 12px; }
.quote-card footer .muted { font-weight: 600; }

/* ============ Wizard (creer.html) ============ */
.wizard-steps {
  display: flex; gap: 8px; justify-content: center; margin: 32px 0 40px; flex-wrap: wrap;
}
.wizard-steps .wstep {
  display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.9rem;
  padding: 8px 18px; border-radius: 999px; border: 1.5px solid rgba(65, 40, 47, 0.18);
  background: var(--surface); color: var(--ink-soft);
}
.wizard-steps .wstep.active {
  background: linear-gradient(135deg, var(--primary), var(--rose));
  color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(232, 106, 51, 0.3);
}
.wizard-steps .wstep.done { background: var(--ok); color: #fff; border-color: transparent; }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wizard-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; flex-wrap: wrap; }

/* Zone d'upload */
.dropzone {
  border: 2px dashed rgba(232, 106, 51, 0.6); border-radius: var(--radius);
  background: var(--surface); padding: 56px 24px; text-align: center;
  cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
.dropzone:hover, .dropzone.dragover { background: #fff3e2; border-color: var(--rose); }
.dropzone svg { margin: 0 auto 16px; color: var(--primary); }
.upload-preview { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }
@media (max-width: 700px) { .upload-preview { grid-template-columns: 1fr; } }
.upload-preview .frame {
  border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-lift);
  background: var(--surface); padding: 8px;
}
.upload-preview .frame img { border-radius: 8px; }

/* Aperçu transformation */
.preview-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 780px) { .preview-stage { grid-template-columns: 1fr; } }
.preview-frame {
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lift); background: #fff; position: relative;
}
.preview-frame img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
/* Filigrane unique et centré : un aperçu quadrillé de texte est illisible, donc
   invendable. Un médaillon central protège autant et laisse juger l'affiche. */
.preview-watermark {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  pointer-events: none; user-select: none;
}
.preview-watermark span,
.preview-watermark em {
  display: block; text-align: center; color: #fff;
  text-shadow: 0 2px 10px rgba(45, 27, 61, 0.75), 0 0 2px rgba(45, 27, 61, 0.9);
}
.preview-watermark span {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.05rem, 5.2cqw, 2.1rem); letter-spacing: 0.02em; line-height: 1.1;
}
.preview-watermark em {
  font-style: normal; font-family: var(--font-body); font-weight: 700;
  font-size: clamp(0.6rem, 2.2cqw, 0.9rem); letter-spacing: 0.42em;
  text-transform: uppercase; margin-top: 6px; opacity: 0.95;
}
/* Le cercle est dessiné en ::before pour rester purement décoratif. */
.preview-watermark::before {
  content: ''; position: absolute; width: min(56%, 46cqw); aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.8); border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 24px rgba(45, 27, 61, 0.35), inset 0 0 0 6px rgba(255, 255, 255, 0.14);
}
/* inline-size, PAS size : `container-type: size` confine les deux axes, la hauteur
   des enfants ne remonte plus au parent et le cadre s'écrase à 0. Le filigrane
   n'a besoin que de la largeur du conteneur. */
.preview-frame { container-type: inline-size; }


.loader {
  display: none; position: absolute; inset: 0; background: rgba(255, 246, 233, 0.93);
  z-index: 5; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  font-weight: 800; text-align: center; padding: 20px;
}
.loader.on { display: flex; }
.spinner {
  width: 56px; height: 56px; border-radius: 50%;
  border: 6px solid var(--secondary); border-top-color: var(--rose);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Formats dans le wizard */
.format-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .format-pick { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .format-pick { grid-template-columns: 1fr; } }
.format-pick .fcard {
  cursor: pointer; background: var(--surface); border: var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  font-family: var(--font-body); font-size: inherit; color: inherit;
}
.format-pick .fcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.format-pick .fcard.selected { outline: 3px solid var(--primary); outline-offset: -3px; background: #fff3e2; }
.format-live-preview { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 28px; align-items: center; margin: 30px 0 0; padding: 18px; border: var(--border); border-radius: var(--radius); background: rgba(255,255,255,.72); }
.format-room-scene { position: relative; min-height: 340px; overflow: hidden; border-radius: 18px; background: linear-gradient(135deg, #f9ecda 0%, #f4dfc3 72%, #dbc19f 72%, #c49f7d 100%); box-shadow: inset 0 0 0 1px rgba(85,52,39,.08), var(--shadow); isolation: isolate; }
.format-room-scene::before { content: ''; position: absolute; inset: 0 0 93px; background: linear-gradient(110deg, transparent 0 15%, rgba(255,255,255,.38) 15% 30%, transparent 30% 100%); opacity: .8; }
.format-room-scene__sun { position: absolute; top: 34px; right: 34px; width: 62px; height: 62px; border-radius: 50%; background: #f5bb67; box-shadow: 0 0 0 16px rgba(245,187,103,.12); }
.format-room-poster { position: absolute; z-index: 2; left: 50%; bottom: 122px; width: 96px; height: 128px; transform: translateX(-50%); overflow: hidden; border: 7px solid #2b1e22; border-radius: 3px; box-sizing: content-box; background: linear-gradient(145deg, #db8f56, #7d3553 48%, #251b31); background-size: cover; background-position: center; box-shadow: 0 12px 20px rgba(62,36,31,.28), 0 3px 0 #9f7044; transition: width .32s ease, height .32s ease, bottom .32s ease; }
.format-room-poster::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(255,255,255,.45); pointer-events: none; }
.format-room-poster__watermark { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.94); font: 900 clamp(.52rem, 2.1vw, .92rem)/1 var(--font-body); letter-spacing: .12em; text-shadow: 0 1px 3px rgba(25,15,24,.9); background: rgba(40,24,41,.3); transform: rotate(-27deg) scale(1.35); pointer-events: none; }
.format-room-sofa { position: absolute; z-index: 3; left: 10%; right: 10%; bottom: 44px; height: 72px; border-radius: 28px 28px 12px 12px; background: linear-gradient(150deg, #b26354, #6e3446); box-shadow: 0 14px 0 #4d2634, 0 20px 24px rgba(55,34,35,.25); }
.format-room-sofa::before, .format-room-sofa::after { content: ''; position: absolute; bottom: -28px; width: 14px; height: 34px; background: #56332f; border-radius: 0 0 6px 6px; }
.format-room-sofa::before { left: 28px; } .format-room-sofa::after { right: 28px; }
.format-room-sofa span { position: absolute; inset: 12px 12px auto; height: 38px; border-radius: 20px; background: linear-gradient(150deg, #d78d70, #9e4f55); box-shadow: inset 0 -5px rgba(74,32,45,.16); }
.format-room-scene__floor { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 93px; background: repeating-linear-gradient(90deg, rgba(115,72,49,.14) 0 1px, transparent 1px 52px), linear-gradient(#d1ae87, #bd936d); }
.format-room-kicker { margin: 0 0 8px; color: var(--primary); font-weight: 800; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.format-preview-note { font-size: .86rem; }
.digital-option { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; padding: 18px 20px; border: 2px solid rgba(232, 106, 51, .42); border-radius: var(--radius); background: #fff7ec; cursor: pointer; }
.digital-option input { width: 21px; height: 21px; margin-top: 2px; accent-color: var(--primary); flex: 0 0 auto; }
.digital-option strong, .digital-option small { display: block; }
.digital-option small { margin-top: 4px; color: var(--muted); }
.digital-option--unavailable { opacity: .72; cursor: not-allowed; border-style: dashed; }
.digital-option--unavailable em { font-size: .78rem; font-style: normal; color: var(--primary); }
@media (max-width: 620px) { .format-live-preview { grid-template-columns: 1fr; } }

/* Panier / récap */
.cart-line {
  display: flex; align-items: center; gap: 16px; padding: 14px 0;
  border-bottom: 2px dashed rgba(65, 40, 47, 0.18);
}
.cart-line img { width: 56px; height: 74px; object-fit: cover; border-radius: 8px; box-shadow: 0 6px 14px rgba(65, 40, 47, 0.2); }
.cart-line .grow { flex: 1; }
.cart-line .price { font-family: var(--font-head); font-weight: 700; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.3rem; font-weight: 800; padding-top: 18px; }

/* ============ Formulaires ============ */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 800; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 16px; border: 1.5px solid #e3cdb4; border-radius: var(--radius-sm);
  background: #fff; min-height: 48px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--secondary); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-msg { font-weight: 800; margin-top: 12px; display: none; }
.form-msg.err { display: block; color: var(--err); }
.form-msg.ok { display: block; color: var(--ok); }

/* ============ FAQ ============ */
details.faq-item {
  background: var(--surface); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 4px 24px; margin-bottom: 16px;
}
details.faq-item summary {
  font-family: var(--font-head); font-weight: 600; font-size: 1.1rem;
  padding: 16px 0; cursor: pointer; list-style: none; position: relative; padding-right: 40px;
}
details.faq-item summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.6rem; color: var(--primary); transition: transform 0.2s;
}
details.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details.faq-item .answer { padding-bottom: 18px; color: var(--ink-soft); }

/* ============ CTA final & footer ============ */
.big-cta {
  background: linear-gradient(160deg, var(--plum), #7a2e4d 50%, #d4573b);
  color: #fff; border-radius: 28px;
  box-shadow: var(--shadow-lift); padding: 60px 32px; text-align: center; position: relative; overflow: hidden;
}
.big-cta::before {
  content: ''; position: absolute; left: 50%; bottom: -180px; transform: translateX(-50%);
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 169, 80, 0.35), transparent 65%);
  pointer-events: none;
}
.big-cta h2 { color: #ffe8c7; }
.big-cta p { color: #f2d8c2; }
.big-cta > * { position: relative; }
footer.site {
  background: var(--plum); color: #d9c2ce; padding: 48px 0 32px; margin-top: 80px;
}
footer.site a { color: #ffe8c7; text-decoration: none; }
footer.site a:hover { text-decoration: underline; }
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 700px) { footer.site .cols { grid-template-columns: 1fr; } }
footer.site .legal { margin-top: 32px; font-size: 0.85rem; color: #a583a0; }
footer.site p[style*='font-weight:800'] { color: #ffe8c7; }

/* ============ Tableau admin ============ */
table.admin { width: 100%; border-collapse: collapse; background: #fff; border: var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.admin th, table.admin td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f3e3cc; font-size: 0.95rem; }
table.admin th { background: #fdf0dd; font-family: var(--font-head); }
.status-pill { padding: 3px 12px; border-radius: 999px; font-weight: 800; font-size: 0.8rem; border: 1.5px solid rgba(65, 40, 47, 0.25); }
.status-nouvelle { background: #fdeccd; }
.status-en_production { background: #fde0d3; }
.status-expediee { background: #ddedd9; }
.status-annulee { background: #f6d7d2; }

/* Notice mode démo */
.demo-note {
  background: #fff3e2; border: 2px dashed var(--secondary); border-radius: var(--radius-sm);
  padding: 12px 18px; font-weight: 700; font-size: 0.92rem; margin: 18px 0;
}
.system-status { margin: 0 0 24px; padding: 14px 16px; border: 1px solid #d99a83; border-left: 4px solid #b94835; border-radius: 12px; background: #fff0eb; color: #7d2e25; line-height: 1.5; }

/* ---------- Groupes de styles & fiche pré-génération ---------- */
/* Le client doit savoir ce que le style modifie AVANT de lancer une génération. */

.style-group { margin-bottom: 36px; }
.style-group:last-child { margin-bottom: 0; }

.style-group-head {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(41, 50, 65, 0.12);
}
.style-group-head h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin-bottom: 2px;
}
.style-group-head p { font-size: 0.92rem; margin: 0; }

.style-brief {
  margin-top: 14px;
}
.style-info-bubbles {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}
.info-bubble {
  position: relative;
}
.info-bubble summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1.5px solid rgba(232, 106, 51, 0.30);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 4px 12px rgba(65, 40, 47, 0.07);
}
.info-bubble summary::-webkit-details-marker { display: none; }
.info-bubble summary::after {
  content: '+';
  margin-left: auto;
  color: var(--primary-dark);
  font-size: 1.15rem;
  line-height: 1;
}
.info-bubble[open] summary {
  background: #fff3e2;
  border-radius: 16px 16px 0 0;
  border-bottom-color: transparent;
}
.info-bubble[open] summary::after { content: '−'; }
.info-bubble-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 800;
}
.info-bubble-icon--tips { background: #3d805f; }
.info-bubble-content {
  padding: 12px 15px 14px;
  border: 1.5px solid rgba(232, 106, 51, 0.30);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: rgba(255, 248, 239, 0.98);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}
.info-bubble-content p { margin: 0; }
.style-brief-line {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.style-brief-line:last-child { margin-bottom: 0; }
.style-brief-line strong {
  display: block;
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.style-brief-warn strong { color: #a1502a; }
.style-brief > .btn { margin-top: 2px; width: 100%; }

@media (prefers-reduced-motion: no-preference) {
  .info-bubble-content { animation: info-bubble-in 0.16s ease-out; }
}
@keyframes info-bubble-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Comparateur avant/après ---------- */
.ba { margin: 0 0 18px; }
.ba-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: none;
  background: rgba(41, 50, 65, 0.06);
  user-select: none;
}
.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
/* Le volet « avant » est découpé par clip-path plutôt que par une largeur de conteneur :
   l'image garde ainsi les dimensions du cadre à toutes les tailles d'écran, au lieu
   de se comprimer au fur et à mesure du glissement. */
.ba-clip { position: absolute; inset: 0; }
.ba-clip .ba-img { clip-path: inset(0 50% 0 0); }
.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(41, 50, 65, 0.25);
  pointer-events: none;
}
.ba-range { width: 100%; max-width: 320px; margin-top: 10px; display: block; }
.ba-legend { font-size: 0.82rem; margin-top: 4px; }

@media (max-width: 549px) {
  .ba-frame { max-width: 100%; }
  .ba-clip .ba-img { width: 100vw; }
  .ba-range { max-width: 100%; }
}

/* ---------- Atelier de l'étape 2 ---------- */

.studio {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 20px;
  align-items: start;
}

.studio-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.studio-photo {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(41, 50, 65, 0.05);
}
.studio-photo img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  background: rgba(41, 50, 65, 0.08);
}
.studio-photo p { margin: 0 0 4px; font-size: 0.82rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.studio-tabs { display: flex; gap: 6px; }
.studio-tab {
  flex: 1;
  border: 1px solid rgba(41, 50, 65, 0.18);
  background: transparent;
  border-radius: 999px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1.25;
}
.studio-tab.active {
  background: var(--primary, #ffb86f);
  border-color: transparent;
  font-weight: 700;
}
.studio-promesse { font-size: 0.82rem; margin: 0; }

/* Tous les styles sont visibles ensemble : aucune réglette interne à faire défiler. */
.style-rail {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  overflow: visible;
}

.style-chip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(41, 50, 65, 0.04);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.style-chip.selected {
  border-color: var(--primary, #ffb86f);
  background: rgba(255, 184, 111, 0.16);
}
.style-chip-art { display: block; width: 100%; height: 62px; object-fit: cover; border-radius: 8px; }
.style-chip-nom { font-size: 0.82rem; font-weight: 700; line-height: 1.2; }

.studio-main {
  display: grid;
  grid-template-columns: minmax(0, 320px) 1fr;
  gap: 20px;
  align-items: start;
  min-width: 0;
}
.studio-visual { min-width: 0; }
.studio-preview { position: relative; }
.studio-brief { min-width: 0; }
.studio-brief h3 { margin-bottom: 4px; }
.studio-brief .studio-photo { margin: 6px 0 12px; }
.studio-brief .style-brief { margin-top: 12px; }
#styleCost { font-size: 0.82rem; margin-top: 8px; }

/* Tablette : l'aperçu passe sous les styles, on garde deux colonnes utiles. */
@media (max-width: 949px) {
  .studio { grid-template-columns: 1fr; }
  .style-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Mobile : une colonne, réglette horizontale, visuel contenu pour éviter
   le défilement de page sur le choix du style. */
@media (max-width: 640px) {
  .studio-main { grid-template-columns: 1fr; gap: 14px; }
  .ba-frame { max-width: 100%; margin: 0 auto; }
  .studio-visual .ba-frame { max-height: 42vh; aspect-ratio: 3 / 4; }
  .studio-photo img { width: 44px; height: 44px; }
  .studio-tab { font-size: 0.8rem; padding: 7px 8px; }
}

/* Mobile : tout l'atelier doit tenir sans défilement de page. La contrainte vient
   de la hauteur, pas de la largeur — on dimensionne donc le visuel par sa hauteur
   et on laisse la largeur en découler, au lieu de l'inverse. */
@media (max-width: 640px) {
  .creator-shell { padding-top: 8px; }
  .wizard-steps { gap: 4px; margin-bottom: 10px; }
  .wizard-steps .wstep { font-size: 0.72rem; padding: 6px 9px; }

  .studio { gap: 12px; }
  .studio-side { gap: 8px; }
  .studio-photo { padding: 7px; gap: 8px; }
  .studio-promesse { font-size: 0.76rem; line-height: 1.35; }
  .style-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .style-chip { padding: 6px; }
  .style-chip-art { height: 48px; }
  .style-chip-nom { font-size: 0.74rem; }

  .studio-visual .ba-frame {
    height: min(32vh, 300px);
    width: auto;
    max-width: 100%;
    aspect-ratio: 3 / 4;
    margin: 0 auto;
  }
  .ba-range { max-width: 240px; margin: 8px auto 0; }
  .ba-legend { text-align: center; margin-top: 2px; }

  /* Redondant avec la fiche du style juste en dessous : on le retire sur mobile. */
  .studio-brief > #previewDesc { display: none; }
  .studio-brief h3 { font-size: 1.05rem; margin-bottom: 6px; }
  .studio-brief .style-brief { margin-top: 8px; padding: 0; }
  .style-brief-line { font-size: 0.86rem; margin-bottom: 8px; }
  .style-brief-line strong { font-size: 0.74rem; }
  .style-brief .btn { width: 100%; padding: 12px 20px; min-height: 44px; }
  #styleCost { font-size: 0.74rem; margin-top: 6px; }
  .wizard-nav { margin-top: 12px; gap: 8px; }
}

/* Passe finale mobile : on coupe le redondant, jamais l'information dont le client a
   besoin avant de dépenser un crédit (recommandation, disclaimer, bouton). */
@media (max-width: 640px) {
  .wizard-steps { margin-bottom: 8px; }
  .wizard-steps .wstep { font-size: 0.68rem; padding: 5px 8px; }

  /* La promesse du groupe est déjà portée par le libellé de l'onglet actif. */
  .studio-promesse { display: none; }

  .studio-photo { padding: 6px; }
  .studio-photo img { width: 40px; height: 40px; }
  .studio-photo p { display: none; }
  .studio-photo .btn-sm { padding: 5px 10px; font-size: 0.78rem; min-height: 34px; }

  .studio-visual .ba-frame { height: min(26vh, 240px); }
  .ba-legend { font-size: 0.72rem; }

  .studio-brief h3 { font-size: 1rem; margin-bottom: 2px; }
  .studio-brief .style-brief { padding: 0; }
  .style-brief-line { font-size: 0.8rem; line-height: 1.4; margin-bottom: 6px; }
  .style-brief-line strong { font-size: 0.68rem; margin-bottom: 0; }

  /* Deux boutons côte à côte plutôt qu'empilés : 60 px regagnés. */
  .wizard-nav { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-top: 10px; }
  .wizard-nav .btn { flex: 1; padding: 10px 12px; min-height: 42px; font-size: 0.88rem; }
}

@media (max-width: 640px) {
  .creator-shell { padding-top: 4px; padding-bottom: 8px; }
  /* Le nom du style est déjà lisible sur la vignette sélectionnée et dans l'onglet. */
  .studio-brief > h3 { display: none; }
  /* Le bouton dit déjà ce qu'il fait. */
  #styleCost { display: none; }
  .studio-visual .ba-frame { height: min(24vh, 220px); }
  .studio-main { gap: 10px; }
  .studio { gap: 10px; }
}

/* Le sélecteur générique `section { padding: 72px 0 }` ajoutait 144 px de vide autour
   du panneau. Inutile dans le tunnel de création, où chaque pixel vertical compte. */
.wizard-panel { padding-top: 0; padding-bottom: 0; }
@media (max-width: 640px) {
  .wizard-steps { margin-top: 10px; }
}

/* ---------- Historique des générations ---------- */
.historique { margin-top: 10px; }
.historique-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.historique-titre { font-family: var(--font-head); font-weight: 700; font-size: 0.9rem; }
.historique-head .muted { font-size: 0.76rem; margin-left: auto; }
.historique-head .btn-sm { padding: 4px 10px; font-size: 0.74rem; min-height: 30px; }

.histo-bande {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
}
.histo-vignette {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: center;
}
.histo-vignette img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(65, 40, 47, 0.08);
}
.histo-vignette span {
  display: block;
  font-size: 0.66rem;
  line-height: 1.15;
  margin-top: 3px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.histo-vignette:hover { border-color: var(--secondary); }
.histo-item { position: relative; min-width: 0; }
.histo-delete {
  position: absolute;
  top: -6px;
  right: -5px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #9c3d35;
  color: #fff;
  font: 800 1rem/1 sans-serif;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(65, 40, 47, 0.24);
}
.histo-delete:hover,
.histo-delete:focus-visible { background: #742a25; transform: scale(1.06); }

@media (max-width: 640px) {
  .histo-bande { grid-auto-columns: 52px; gap: 6px; }
  .historique { margin-top: 8px; }
  .historique-titre { font-size: 0.82rem; }
}


/* Aperçus : ni sélection, ni glisser. Dissuasion, pas protection absolue. */
#previewImg, .ba-img, .histo-vignette img {
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

/* Bandeau de session exploitant */
.admin-bandeau {
  margin: 8px 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(45, 27, 61, 0.9); color: #fff;
  font-size: 0.82rem; font-weight: 700; text-align: center;
}
#adminDownload { margin-top: 10px; }

/* Badge d'usage sur une vignette (ex. « Portraits uniquement ») */
.style-chip-badge {
  display: block; margin-top: 2px;
  font-size: 0.62rem; font-weight: 700; line-height: 1.15;
  color: var(--rose); text-transform: uppercase; letter-spacing: 0.04em;
}

/* ---------- Titre sur l'affiche ---------- */
/* Calque HTML par-dessus l'aperçu : le client voit son titre sans consommer de crédit.
   À l'impression, le serveur produit le même titre dans un PNG transparent séparé. */
.titre-calque {
  position: absolute; left: 6%; right: 6%; z-index: 4;
  text-align: center; font-weight: 700; line-height: 1.15;
  font-size: clamp(0.85rem, 6.5cqw, 2.4rem);
  text-shadow: 0 2px 8px rgba(27, 16, 22, 0.7), 0 0 2px rgba(27, 16, 22, 0.85);
  pointer-events: none; user-select: none; overflow-wrap: break-word;
  padding: 0.12em 0.3em;
  box-sizing: border-box;
}
.titre-calque[data-bandeau='true'] {
  left: 0;
  right: 0;
  width: 100%;
  padding: 0.35em 6%;
  background: #fff;
}
.titre-calque[data-position='haut'] { top: 5.5%; }
.titre-calque[data-position='bas'] { bottom: 5.5%; }
.titre-calque[data-bandeau='true'][data-position='haut'] { top: 0; }
.titre-calque[data-bandeau='true'][data-position='bas'] { bottom: 0; }

.titre-bloc {
  margin-top: 12px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid rgba(65, 40, 47, 0.16);
  background: rgba(255, 255, 255, 0.5);
}
.titre-bloc label { display: block; font-weight: 700; font-size: 0.86rem; margin-bottom: 4px; }
.titre-bloc input[type='text'] {
  width: 100%; box-sizing: border-box; padding: 9px 12px;
  border: 1px solid rgba(65, 40, 47, 0.22); border-radius: 10px;
  font: inherit; font-size: 0.92rem; background: #fff;
}
.titre-pos { border: 0; padding: 0; margin: 8px 0 0; display: flex; gap: 16px; }
.titre-pos label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: 0.86rem; margin: 0; }
.titre-polices,
.titre-couleurs { border: 0; padding: 0; margin: 9px 0 0; }
.titre-polices legend,
.titre-couleurs legend { font-size: 0.76rem; font-weight: 800; margin-bottom: 5px; }
.titre-polices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.titre-polices legend { grid-column: 1 / -1; }
.titre-police,
.titre-couleurs label,
.titre-bandeau {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
}
.titre-police { min-height: 34px; padding: 5px 8px; border: 1px solid rgba(65,40,47,.16); border-radius: 8px; background: rgba(255,255,255,.72); }
.titre-police--bebas { font-family: 'Bebas Neue', sans-serif; font-size: 0.95rem !important; }
.titre-police--montserrat { font-family: 'Montserrat', sans-serif; }
.titre-police--playfair { font-family: 'Playfair Display', serif; }
.titre-police--bangers { font-family: 'Bangers', sans-serif; font-size: 0.92rem !important; }
.titre-couleurs { display: flex; flex-wrap: wrap; gap: 14px; }
.titre-couleurs legend { width: 100%; }
.titre-bandeau { margin-top: 9px !important; }
.titre-couleurs input:disabled + span { opacity: .5; }

@media (max-width: 640px) {
  .titre-bloc { margin-top: 8px; padding: 10px 12px; }
  .titre-bloc input[type='text'] { padding: 8px 10px; }
  .titre-polices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .titre-police { justify-content: flex-start; padding: 5px 7px; }
}

/* ---------- Aperçu généré : l'élément principal de l'étape 2 ----------
   Il est dimensionné par sa HAUTEUR, la largeur en découle : c'est la hauteur
   d'écran qui est rare, pas la largeur. Un aperçu large mais coupé en bas ne sert
   à rien pour juger une affiche. */
.studio-main { grid-template-columns: minmax(0, 1fr) minmax(250px, 0.8fr); }

.studio-preview {
  height: min(58vh, 560px);
  width: auto;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  margin: 0 auto;
}
.studio-preview img { height: 100%; width: 100%; object-fit: cover; }

/* Le comparateur d'exemple reste plus modeste : c'est une vignette de démonstration,
   pas le rendu que le client doit juger. */
.studio-visual .ba-frame { height: min(42vh, 400px); width: auto; max-width: 100%; margin: 0 auto; }
.ba-range { max-width: 300px; margin-left: auto; margin-right: auto; }

@media (max-width: 949px) {
  .studio-main { grid-template-columns: 1fr; }
  .studio-preview { height: min(54vh, 480px); }
}

/* Mobile : l'aperçu prime sur le reste. Un rendu qu'on ne peut pas juger ne se vend
   pas — on accepte ici un défilement court, contrairement à l'écran de choix. */
@media (max-width: 640px) {
  .studio-preview { height: min(52vh, 440px); }
  .studio-visual .ba-frame { height: min(30vh, 260px); }
}

/* Chrome du tunnel resserré : chaque pixel repris ici agrandit l'aperçu, qui est
   dimensionné par la hauteur d'écran restante. */
.creator-shell { padding-top: 12px; padding-bottom: 16px; }
.wizard-steps { margin-top: 8px; margin-bottom: 16px; }
.wizard-nav { margin-top: 16px; }
.studio-main { grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr); }
.studio-preview { height: min(66vh, 620px); }
@media (max-width: 949px) { .studio-preview { height: min(56vh, 520px); } }
@media (max-width: 640px) {
  .studio-preview { height: min(54vh, 460px); }
  .wizard-steps { margin-top: 6px; margin-bottom: 10px; }
  .wizard-nav { margin-top: 10px; }
}

/* 66vh faisait apparaître 19 px de défilement une fois le bloc titre ouvert. */
.studio-preview { height: min(63vh, 600px); }
.titre-bloc { margin-top: 8px; padding: 10px 12px; }
.titre-note { display: none; }

/* Le filigrane de page empile deux éléments : sans `align-content`, la grille crée
   deux rangées pleine hauteur et le texte se retrouve écartelé haut/bas. */
.preview-watermark { grid-auto-flow: row; align-content: center; justify-items: center; }

/* `[hidden]` ne pose que `display:none` dans la feuille du navigateur : toute règle
   d'auteur qui fixe un `display` la bat silencieusement. C'est ce qui laissait le
   filigrane de page superposé au filigrane gravé. */
[hidden] { display: none !important; }

/* L'historique vit dans la colonne des styles : sur ordinateur elle a de la place
   libre, alors que la colonne centrale est entièrement occupée par l'aperçu. */
.studio-side .historique { margin-top: 4px; }
.studio-side .histo-bande { grid-auto-columns: 54px; }
@media (max-width: 640px) {
  .histo-bande { grid-auto-columns: 44px; gap: 5px; }
  .historique-titre { font-size: 0.78rem; }
  .historique-head { gap: 6px; margin-bottom: 4px; }
  .historique-head .muted { font-size: 0.68rem; }
  .historique-head .btn-sm { padding: 3px 8px; font-size: 0.68rem; min-height: 26px; }
  .histo-vignette span { display: none; }
}

/* Vignettes d'historique : hauteur explicite. En `aspect-ratio` dans une grille à
   défilement horizontal, la rangée se dimensionnait sur le contenu et le bloc
   atteignait 270 px — plus que l'aperçu lui-même. */
.studio-side .histo-vignette img { height: 62px; aspect-ratio: auto; }
.studio-side .histo-vignette span { font-size: 0.6rem; }
.studio-side .historique-head { margin-bottom: 4px; }
.studio-side .historique-titre { font-size: 0.82rem; }

/* Colonne des styles resserrée pour ne jamais dépasser la hauteur de l'aperçu. */
.studio-side { gap: 8px; }
.studio-photo { padding: 7px; }
.studio-photo img { width: 44px; height: 44px; }
.studio-tabs .studio-tab { padding: 6px 8px; font-size: 0.8rem; }
.studio-promesse { font-size: 0.76rem; line-height: 1.3; }

@media (max-width: 640px) {
  .studio-side .histo-vignette img { height: 46px; }
}

/* `<section class="historique">` héritait de `section { padding: 72px 0 }` : 144 px
   de vide invisible, plus haut que le bloc lui-même. Même piège que pour les panneaux. */
.historique { padding: 0; }
.studio-preview { height: min(68vh, 620px); }
@media (max-width: 949px) { .studio-preview { height: min(58vh, 540px); } }
@media (max-width: 640px) { .studio-preview { height: min(56vh, 470px); } }

/* La grille deux colonnes de `.studio-main` a été ajoutée plus haut SANS media query :
   placée après la règle mobile, elle la battait et réduisait l'aperçu à 85 px de large
   sur téléphone (le minimum de 240 px de la colonne droite mangeait tout l'espace).
   On rétablit explicitement la colonne unique en dessous de 950 px. */
@media (max-width: 949px) {
  .studio-main { grid-template-columns: minmax(0, 1fr) !important; }
  .studio-preview { width: auto; max-width: 100%; margin: 0 auto; }
}

/* Mobile : on resserre tout SAUF l'aperçu, qui est ce que le client vient juger. */
@media (max-width: 640px) {
  .wizard-steps { flex-wrap: wrap; row-gap: 4px; }
  .wizard-steps .wstep { font-size: 0.66rem; padding: 4px 7px; }
  .studio-photo { padding: 5px; }
  .studio-photo img { width: 38px; height: 38px; }
  .titre-bloc { margin-top: 6px; padding: 8px 10px; }
  .titre-bloc label { font-size: 0.8rem; margin-bottom: 3px; }
  .titre-bloc input[type='text'] { padding: 7px 10px; font-size: 0.88rem; }
  .titre-pos { margin-top: 6px; gap: 14px; }
  .style-brief { padding: 0; }
  .style-brief .btn { padding: 10px 16px; min-height: 40px; font-size: 0.92rem; }
  .style-brief-line { margin-bottom: 5px; }
  .studio-brief .style-brief { margin-top: 6px; }
}

/* Le fil d'étapes passait sur deux lignes en mobile : 150 px de chrome avant même
   la première commande utile. Une seule ligne, qui défile si nécessaire. */
@media (max-width: 640px) {
  .wizard-steps {
    flex-wrap: nowrap; overflow-x: auto; gap: 5px;
    margin-top: 4px; margin-bottom: 8px; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .wizard-steps::-webkit-scrollbar { display: none; }
  .wizard-steps .wstep { flex: 0 0 auto; font-size: 0.68rem; padding: 4px 9px; white-space: nowrap; }
}

/* ---------- Cadre d'aperçu piloté par l'orientation de la photo ----------
   `--ratio-affiche` et `--ratio-num` sont posés par js/orientation.js dès l'upload.
   La largeur est calculée à partir de la hauteur cible, puis bornée par la colonne :
   quand elle est bornée, `height: auto` recalcule la hauteur via `aspect-ratio`, donc
   le ratio est conservé au lieu d'être écrasé. C'est ce qui permet au même cadre de
   servir en portrait comme en paysage, à toutes les tailles d'écran. */
.studio-preview {
  --h-apercu: min(68vh, 620px);
  aspect-ratio: var(--ratio-affiche, 3 / 4);
  width: min(100%, calc(var(--h-apercu) * var(--ratio-num, 0.75)));
  height: auto;
  max-width: 100%;
  margin: 0 auto;
}
.studio-preview img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 949px) { .studio-preview { --h-apercu: min(58vh, 540px); } }
@media (max-width: 640px) { .studio-preview { --h-apercu: min(56vh, 470px); } }

/* En paysage l'aperçu est contraint par la largeur, pas par la hauteur : on
   rééquilibre les colonnes pour qu'il reste l'élément dominant. */
@media (min-width: 950px) {
  :root[data-orientation='paysage'] .studio-main {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.8fr);
  }
}

/* ---------- Étape 2 : priorité aux images ----------
   Les anciennes vignettes étaient des timbres-poste. La photo source, les cartes de
   styles et les rendus de l'historique doivent être identifiables au premier regard. */
@media (min-width: 950px) {
  .studio { grid-template-columns: minmax(300px, 350px) 1fr; }
}
.studio-photo img { width: 76px; height: 76px; border-radius: 12px; }
.style-rail { max-height: none; gap: 8px; }
.style-chip { padding: 8px; gap: 6px; }
.style-chip-art {
  width: 100%; height: 62px; object-fit: cover; object-position: center;
  border-radius: 10px; background: rgba(41, 50, 65, 0.08);
}
.style-chip-nom { font-size: 0.88rem; }
.histo-bande { grid-auto-columns: 92px; gap: 10px; }
.histo-vignette span { font-size: 0.74rem; }


@media (max-width: 949px) {
  .style-rail { grid-auto-columns: unset; }
}
@media (max-width: 640px) {
  .studio-photo img { width: 60px; height: 60px; }
  .style-rail { grid-auto-columns: unset; gap: 6px; }
  .style-chip { padding: 6px; }
  .style-chip-art { height: 48px; }
  .style-chip-nom { font-size: 0.76rem; }
  .histo-bande { grid-auto-columns: 78px; gap: 8px; }
}

/* Le comparateur suit le choix Portrait/Paysage, comme le rendu généré. */
.ba-frame,
.studio-visual .ba-frame {
  aspect-ratio: var(--ratio-affiche, 3 / 4);
}

/* Dimensionnement réel du comparateur : jamais de hauteur portrait conservée
   quand l'utilisateur passe en paysage. La largeur découle du ratio sélectionné. */
.studio-visual .ba-frame {
  --h-exemple: min(52vh, 520px);
  width: min(100%, calc(var(--h-exemple) * var(--ratio-num, 0.75)));
  height: auto !important;
  max-width: 100%;
  max-height: none;
}
.ba-clip .ba-img { width: 100%; }

@media (max-width: 949px) {
  .studio-visual .ba-frame { --h-exemple: min(46vh, 440px); }
}
@media (max-width: 640px) {
  .studio-visual .ba-frame {
    --h-exemple: min(48vh, 400px);
    width: min(100%, calc(var(--h-exemple) * var(--ratio-num, 0.75)));
    height: auto !important;
    max-height: none;
  }
}


/* === Responsive hardening 2026-08-29 ===
   Correctifs ciblés pour le tunnel /creer et le header très petit mobile. */
@media (max-width: 640px) {
  .wizard-steps {
    justify-content: flex-start !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 4px 4px;
    scroll-padding-inline: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .wizard-steps .wstep {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .studio-visual,
  .studio-visual .ba,
  .studio-visual .ba-frame {
    max-width: 100%;
    min-width: 0;
  }
  .studio-visual .ba {
    overflow: hidden;
  }
  .studio-visual .ba-frame {
    width: min(100%, 300px) !important;
    height: auto !important;
    aspect-ratio: var(--ratio-affiche, 3 / 4) !important;
    max-height: none !important;
    margin-left: auto;
    margin-right: auto;
  }
  .ba-img,
  .ba-clip .ba-img,
  .studio-visual .ba-img,
  .studio-visual .ba-clip .ba-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }
  .studio-visual .ba-range {
    width: min(100%, 300px);
    max-width: 300px;
  }
  .ba-legend {
    text-align: center;
    line-height: 1.35;
  }
}

@media (max-width: 360px) {
  .wizard-steps { gap: 3px; padding-left: 0; padding-right: 0; }
  .wizard-steps .wstep { font-size: 0.6rem; padding: 4px 5px; }
  .nav { padding: 0 12px; }
  .nav-inner { padding: 10px 14px; gap: 10px; }
  .logo { font-size: 1.22rem; gap: 8px; line-height: 1.1; }
  .logo svg { width: 34px; height: 34px; }
  .nav-burger { width: 44px; height: 44px; padding: 8px; flex: 0 0 auto; }
  .hero h1 { font-size: clamp(2.2rem, 13vw, 3rem); }
  .btn-lg { width: 100%; justify-content: center; padding-left: 22px; padding-right: 22px; }
  .poster .label { padding: 8px 9px; gap: 5px; }
  .poster .label .tag { font-size: 0.62rem; padding: 1px 7px; letter-spacing: 0; }
}

