/* Carte postale de ressources.online : aperçu à gauche (il reste en vue), réglages à droite ; l'un sous l'autre sur téléphone. */
.atelier {
  margin: 28px auto 0; max-width: 1180px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 22px; box-shadow: var(--ombre); padding: 20px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 26px; align-items: start;
}
.vue { position: sticky; top: 84px; }
.vue-cadre { position: relative; border-radius: 14px; background: var(--surface-2); padding: 14px; display: grid; gap: 12px; justify-items: center; }
.vue-cadre canvas { display: block; max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 14px 34px rgba(0, 0, 0, .16); background: #fff; }
#recto.cadrable { cursor: grab; touch-action: none; }   /* sans photo, le doigt fait défiler la page */
#recto.saisie { cursor: grabbing; }
.pas, .suivant { display: none; }   /* les onglets des étapes : sur téléphone seulement */
.vue-cadre.portrait canvas { max-height: 62vh; width: auto; }
.vue-cadre.survol { outline: 3px dashed var(--orange); outline-offset: -3px; }
.vue-aide { margin: 10px 0 0; text-align: center; color: var(--doux); font-size: .86rem; }
.envoi { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.envoi .btn { min-height: 46px; padding: 0 18px; }
.envoi .btn svg { flex: none; }
.envoi-plus { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; margin-top: 8px; }
.envoi-plus button { font: inherit; font-size: .9rem; background: none; border: 0; color: var(--doux); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 2px; display: inline-flex; align-items: center; gap: 6px; }
.envoi-plus button:hover { color: var(--orange); }
.prive { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: .88rem; color: var(--doux); }
.prive svg { flex: none; color: var(--vert); margin-top: 2px; }

.reglages { display: grid; gap: 18px; min-width: 0; }
.etape { min-width: 0; }
.etape > h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; font-size: 1rem; }
.etape > h2 b { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #21160a; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rang { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rang .btn { min-height: 44px; padding: 0 16px; }
.mini { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--ligne); background: var(--surface); color: var(--texte); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.mini:hover { border-color: var(--orange); }
.glisse { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-top: 10px; font-size: .9rem; color: var(--doux); }
.glisse input[type="range"] { width: 100%; accent-color: var(--orange); min-height: 30px; }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.segments button { font: inherit; font-size: .9rem; font-weight: 600; border: 0; background: transparent; color: var(--doux); border-radius: 10px; padding: 8px 6px; min-height: 42px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; }
.segments button[aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: 0 1px 4px rgba(1, 18, 61, .14); }
.segments button[aria-pressed="true"] svg { color: var(--orange); }
.modeles-carte { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.modeles-carte button { display: grid; gap: 5px; padding: 5px 5px 7px; border-radius: 12px; border: 2px solid var(--ligne); background: var(--surface); color: var(--texte); cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; text-align: center; min-width: 0; }
.modeles-carte button:hover { border-color: color-mix(in srgb, var(--orange) 55%, var(--ligne)); }
.modeles-carte button[aria-pressed="true"] { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 9%, var(--surface)); }
.modeles-carte canvas { width: 100%; height: auto; display: block; border-radius: 6px; }
.champ { display: grid; gap: 6px; margin-bottom: 12px; }
.champ > span { font-weight: 600; font-size: .92rem; }
.champ small { color: var(--doux); font-size: .82rem; }
.champ input[type="text"], .champ select, .champ textarea {
  font: inherit; font-size: 16px; color: var(--texte); background: var(--surface); border: 2px solid var(--ligne); border-radius: 12px; min-height: 48px; padding: 0 14px; width: 100%;
}
.champ textarea { padding: 10px 14px; min-height: 104px; resize: vertical; line-height: 1.45; }
.champ input:focus, .champ select:focus, .champ textarea:focus { border-color: var(--orange); outline: none; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.teintes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.teintes button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--ligne); cursor: pointer; padding: 0; }
.teintes button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--orange); }
.teintes input[type="color"] { width: 40px; height: 36px; border: 1px solid var(--ligne); border-radius: 10px; background: var(--surface); padding: 2px; cursor: pointer; }
.case { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 12px; font-size: .95rem; cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--orange); flex: none; }
/* la carte animée : réglages, puis la fenêtre où la vidéo est filmée et relue */
.film-intro { margin: 0 0 12px; color: var(--doux); font-size: .92rem; line-height: 1.5; }
#apercu-film[aria-pressed="true"], #ecouter[aria-pressed="true"] { border-color: var(--orange); color: var(--orange); }
.musique { margin: -4px 0 12px; }
.musique .rang { flex-wrap: nowrap; }
.musique .champ { flex: 1 1 auto; margin: 0; min-width: 0; }
.musique .mini { width: 48px; height: 48px; }
.musique .mini:disabled { opacity: .45; cursor: default; }
#morceau-zone { margin-top: 10px; }
#morceau-zone .film-intro { margin: 8px 0 0; overflow-wrap: anywhere; }
.film-boutons { margin-top: 4px; }
.film { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid var(--ligne); border-radius: 20px; background: var(--surface); color: var(--texte); padding: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); }
.film::backdrop { background: rgba(6, 12, 30, .66); }
.film h2 { margin: 0 44px 14px 0; font-size: 1.15rem; }
.film-fermer { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--ligne); background: var(--surface); color: var(--texte); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.film-fermer:hover { border-color: var(--orange); }
.film-scene { display: grid; justify-items: center; background: var(--surface-2); border-radius: 12px; padding: 10px; }
.film-scene canvas, .film-scene video { display: block; max-width: 100%; max-height: 56dvh; width: auto; height: auto; border-radius: 4px; background: #141b2d; }
.film-barre { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.film-barre i { display: block; height: 100%; width: 0; background: var(--orange); border-radius: 8px; }
.film-texte { margin: 12px 0 0; text-align: center; font-weight: 600; }
.film-note { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--doux); font-size: .9rem; line-height: 1.45; }
.film [hidden] { display: none !important; }

.atouts { list-style: none; max-width: 1180px; margin: 34px auto 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.atouts li { background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px; padding: 18px; }
.atouts svg { color: var(--orange); }
.atouts strong { display: block; margin: 8px 0 4px; }
.atouts span { color: var(--doux); font-size: .92rem; line-height: 1.5; display: block; }

/* Téléphone : l'aperçu reste collé sous l'en-tête avec les onglets des étapes, une seule étape s'affiche, l'envoi vient ensuite. */
@media (max-width: 900px) {
  .atelier { display: flex; flex-direction: column; padding: 0 14px 14px; gap: 0; }
  .vue { display: contents; }
  .vue-cadre {
    order: 0; align-self: stretch; position: sticky; top: var(--entete, 86px); z-index: 5; margin: 0 -14px; padding: 10px 14px 0; gap: 8px;   /* toute la largeur, même avec un aperçu étroit : rien ne dépasse à côté */
    border-radius: 21px 21px 0 0; background: var(--surface); box-shadow: 0 12px 16px -14px rgba(1, 18, 61, .45);
  }
  .vue-cadre canvas, .vue-cadre.portrait canvas { max-height: 30dvh; width: auto; max-width: 100%; transition: max-height .18s ease; }
  .vue-cadre.cote-dos #recto, .vue-cadre:not(.cote-dos) #verso { display: none; }
  .vue-cadre.compact canvas { max-height: 16dvh; }
  .vue-cadre.compact .pas { display: none; }
  .vue-cadre.compact { padding-bottom: 10px; }
  .pas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; border-top: 1px solid var(--ligne); margin-top: 2px; }
  .pas button {
    font: inherit; font-size: .74rem; font-weight: 700; line-height: 1.1; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--doux);
    min-height: 54px; padding: 7px 2px 5px; display: grid; justify-items: center; align-content: center; gap: 3px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .pas button[aria-selected="true"] { color: var(--texte); border-bottom-color: var(--orange); }
  .pas button[aria-selected="true"] svg { color: var(--orange); }
  .vue-aide { order: 1; margin: 10px 0 0; font-size: .82rem; }
  .atelier:not([data-etape="0"]) .vue-aide { display: none; }   /* le conseil de cadrage : à l'étape de la photo seulement */
  .reglages { order: 2; display: block; padding-top: 12px; }
  .reglages > .etape { display: none; }
  .reglages > .etape.active { display: block; }
  .reglages input, .reglages textarea, .reglages select { scroll-margin-top: 46dvh; }
  .suivant { display: flex; width: 100%; justify-content: center; margin-top: 16px; min-height: 48px; }
  .rang > .btn { flex: 1 1 0; min-width: 0; justify-content: center; min-height: 48px; padding: 0 12px; }
  .rang { flex-wrap: nowrap; }
  .film-boutons { flex-wrap: wrap; }
  .film-boutons > .btn { flex: 1 1 100%; }
  .teintes { gap: 10px; }
  .teintes button { width: 40px; height: 40px; }
  .teintes input[type="color"] { width: 46px; height: 42px; }
  .modeles-carte { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .envoi { order: 3; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ligne); }
  .envoi .btn { flex: 1 1 150px; justify-content: center; min-height: 50px; }
  .envoi-plus { order: 4; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  .envoi-plus button { justify-content: center; min-height: 46px; padding: 6px 8px; border: 1px solid var(--ligne); border-radius: 12px; background: var(--surface); color: var(--texte); text-decoration: none; font-weight: 600; font-size: .86rem; }
  .prive { order: 5; }
  .film { padding: 16px; }
  .film .envoi { order: 0; margin-top: 12px; padding-top: 0; border-top: 0; }
}
@media (max-width: 420px) { .deux { grid-template-columns: 1fr; } }
