/* MyCarreau — l'atelier. L'interface reste calme et claire : ce sont les carreaux qui ont la couleur. */
:root {
  --lin: #f1ebe1;
  --lin-fonce: #e6ddcf;
  --papier: #fffdf9;
  --encre: #1c2233;
  --gris: #6e6a63;
  --gris-clair: #a39d93;
  --trait: #e4dccf;
  --bleu: #1b3da6;
  --bleu-vif: #2b55d4;
  --bleu-doux: #e9eefb;
  --guide: #ff2fa0;
  --ombre: 60, 42, 22;
  --rayon: 12px;
  --rail: 76px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.4 'Archivo', system-ui, sans-serif;
  color: var(--encre);
  background: var(--lin);
  display: grid;
  grid-template-columns: var(--rail) 328px minmax(0, 1fr) 304px;
  grid-template-rows: 60px minmax(0, 1fr);
  grid-template-areas: 'barre barre barre barre' 'rail volet scene droite';
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h2, h3 { margin: 0; font-weight: 650; }
svg { display: block; }

/* ───────────── barre du haut ───────────── */
.barre {
  grid-area: barre;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px 0 14px;
  background: var(--papier);
  border-bottom: 1px solid var(--trait);
  z-index: 5;
}
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; font-stretch: 108%; }
.marque svg { width: 30px; height: 30px; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.marque:hover svg { transform: rotate(90deg); }
.barre-milieu { display: flex; align-items: center; gap: 4px; margin-left: 18px; flex: 1; min-width: 0; }
.barre-fin { display: flex; align-items: center; gap: 14px; }
.separateur { width: 1px; height: 24px; background: var(--trait); margin: 0 8px; }
.outil {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; min-width: 38px; padding: 0 9px;
  border: 0; border-radius: 10px; background: transparent; color: var(--encre);
  transition: background .15s, transform .15s;
}
.outil:hover { background: var(--lin); }
.outil:active { transform: scale(.94); }
.outil:disabled { opacity: .3; cursor: default; }
.outil svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.outil.texte { padding: 0 12px; font-weight: 550; }
.choix-format { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 6px 0 10px; border-radius: 10px; }
.choix-format:hover { background: var(--lin); }
.choix-format svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.choix-format select { border: 0; background: transparent; font-weight: 550; padding: 6px 2px; outline: none; cursor: pointer; }
.prix { text-align: right; line-height: 1.15; }
.prix b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prix small { display: block; font-size: 11.5px; color: var(--gris); }
.prix .remise { color: #0e7a4d; font-weight: 600; }
.bouton {
  height: 42px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--encre);
  background: transparent; font-weight: 650; white-space: nowrap;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.bouton:hover { transform: translateY(-1px); }
.bouton:active { transform: translateY(0) scale(.97); }
.bouton.plein { background: var(--bleu); border-color: var(--bleu); color: #fff; box-shadow: 0 6px 16px -8px rgba(27, 61, 166, .7); }
.bouton.plein:hover { background: var(--bleu-vif); box-shadow: 0 10px 22px -8px rgba(27, 61, 166, .8); }
.bouton.petit { height: 34px; padding: 0 14px; font-size: 13px; }
.bouton .court { display: none; }
.bouton.doux { border-color: var(--trait); background: var(--papier); }

/* ───────────── rail d'outils ───────────── */
.rail {
  grid-area: rail;
  background: var(--papier);
  border-right: 1px solid var(--trait);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 0;
  overflow: auto;
  scrollbar-width: none;
}
.rail button {
  width: 64px; padding: 9px 0 7px; border: 0; background: transparent; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 550; color: var(--gris);
  transition: background .15s, color .15s;
  flex: none;
}
.rail button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.2, .9, .3, 1.4); }
.rail button:hover { color: var(--encre); background: var(--lin); }
.rail button:hover svg { transform: translateY(-2px); }
.rail button[aria-selected='true'] { color: var(--bleu); background: var(--bleu-doux); }
.rail .mobile { display: none; }

/* ───────────── volet (contenu de l'onglet) ───────────── */
.volet {
  grid-area: volet;
  background: var(--papier);
  border-right: 1px solid var(--trait);
  overflow: auto;
  padding: 18px 16px 30px;
  scrollbar-width: thin;
}
.volet > * { animation: entree .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } }
.volet.calme > * { animation: none; }
.volet h2 { font-size: 18px; letter-spacing: -0.01em; }
.volet .intro { margin: 4px 0 14px; color: var(--gris); font-size: 13px; }
.volet h3 { font-size: 13px; margin: 20px 0 9px; color: var(--encre); }
.volet h3:first-child { margin-top: 0; }

.jetons { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.jetons.serres { gap: 4px; margin: 0; }
.jetons.serres .jeton { min-width: 30px; padding-left: 8px; padding-right: 8px; text-align: center; }
/* les univers : une rangée d'onglets au-dessus des collections */
.univers { display: flex; gap: 18px; margin: 2px -16px 12px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--trait); }
.univers::-webkit-scrollbar { display: none; }
.univers button { flex: none; border: 0; background: none; padding: 8px 0 9px; font: 600 13.5px 'Archivo', sans-serif; color: var(--gris); white-space: nowrap; border-bottom: 2.5px solid transparent; margin-bottom: -1px; cursor: pointer; transition: color .15s, border-color .15s; }
.univers button:hover { color: var(--encre); }
.univers button[aria-pressed='true'] { color: var(--encre); border-bottom-color: var(--bleu); }
.jeton {
  border: 1px solid var(--trait); background: var(--papier); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 550; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.jeton:hover { border-color: var(--encre); }
.jeton[aria-pressed='true'] { background: var(--encre); border-color: var(--encre); color: #fff; }

.grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grille.trois { grid-template-columns: repeat(3, 1fr); gap: 9px; }
.grille.quatre { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grille.cinq { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.grille.cinq .motif-case { padding: 4px; border-radius: 8px; }
.grille.cinq .motif-case svg { width: 80%; height: 80%; }
.vignette {
  position: relative; padding: 0; border: 0; background: none; border-radius: 6px; display: block; width: 100%;
  aspect-ratio: 1; transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.vignette > svg { width: 100%; height: 100%; border-radius: 4.5%; box-shadow: 0 1px 2px rgba(var(--ombre), .22), 0 8px 14px -8px rgba(var(--ombre), .4); transition: box-shadow .22s; }
.vignette:hover { transform: translateY(-3px) rotate(-1deg); z-index: 1; }
.vignette:hover > svg { box-shadow: 0 2px 3px rgba(var(--ombre), .22), 0 16px 22px -10px rgba(var(--ombre), .5); }
.vignette:nth-child(even):hover { transform: translateY(-3px) rotate(1deg); }
.vignette.choisie > svg { outline: 2.5px solid var(--bleu); outline-offset: 3px; }
.vignette .legende { display: block; margin-top: 6px; font-size: 12px; font-weight: 550; color: var(--gris); text-align: center; }
.vignette.haute { aspect-ratio: auto; }
.vignette.haute > svg { height: auto; aspect-ratio: 1; }

/* nuanciers */
.nuancier { display: flex; flex-wrap: wrap; gap: 7px; }
.pastille {
  width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  transition: transform .15s cubic-bezier(.2, .9, .3, 1.5);
}
.pastille:hover { transform: scale(1.14); }
.pastille.choisie::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--bleu); }
.pastille.libre { background: conic-gradient(#ff5a5a, #ffd23d, #4cd97b, #3db8ff, #a45cff, #ff5ab1, #ff5a5a); overflow: hidden; }
.pastille.libre input { position: absolute; inset: -6px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }
.pastille.aucune { background: linear-gradient(135deg, #fff 46%, #e0352b 47%, #e0352b 53%, #fff 54%); }

.encres { display: grid; gap: 7px; }
.encre-ligne {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--trait); background: var(--papier); border-radius: 10px; padding: 7px 10px;
  text-align: left; font-weight: 550; font-size: 13px;
  transition: border-color .15s, transform .15s;
}
.encre-ligne:hover { border-color: var(--encre); transform: translateX(2px); }
.encre-ligne.choisie { border-color: var(--bleu); box-shadow: inset 0 0 0 1px var(--bleu); }
.encre-ligne .bandes { display: flex; width: 84px; height: 22px; border-radius: 6px; overflow: hidden; flex: none; }
.encre-ligne .bandes i { flex: 1; }

/* champs de réglage */
.champ { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 8px 10px; margin: 0 0 11px; }
.champ > label, .champ > .etiquette { font-size: 12.5px; color: var(--gris); }
.champ.plein { grid-template-columns: 1fr; }
.curseur { display: flex; align-items: center; gap: 8px; }
.curseur output { width: 38px; text-align: right; font-size: 12px; color: var(--gris); font-variant-numeric: tabular-nums; }
input[type='range'] {
  -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 22px; background: transparent; margin: 0;
}
input[type='range']::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--lin-fonce); }
input[type='range']::-moz-range-track { height: 4px; border-radius: 2px; background: var(--lin-fonce); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--bleu); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .12s; }
input[type='range']::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2px solid var(--bleu); }
input[type='range']:active::-webkit-slider-thumb { transform: scale(1.2); }
textarea, input[type='text'], input[type='search'] {
  width: 100%; border: 1px solid var(--trait); border-radius: 10px; background: #fff; padding: 9px 11px; outline: none; resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input[type='text']:focus, input[type='search']:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px var(--bleu-doux); }
.segments { display: inline-flex; flex-wrap: wrap; background: var(--lin); border-radius: 9px; padding: 3px; gap: 2px; max-width: 100%; }
.segments button { border: 0; background: transparent; border-radius: 7px; padding: 5px 10px; font-size: 12.5px; font-weight: 550; min-width: 34px; color: var(--gris); transition: background .15s, color .15s; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.segments button { white-space: nowrap; }
.segments button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.segments button[aria-pressed='true'] { background: #fff; color: var(--encre); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.bascule { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; position: relative; }
/* la case cachée reste DANS son étiquette. Laissée libre, elle se posait là où serait l'interrupteur si le panneau
   n'avait pas défilé, donc parfois sous l'écran : au clic, le navigateur remontait tout l'atelier pour la montrer. */
.bascule input { position: absolute; left: 0; top: 0; width: 36px; height: 21px; margin: 0; opacity: 0; pointer-events: none; }
.bascule i { width: 36px; height: 21px; border-radius: 11px; background: var(--lin-fonce); position: relative; transition: background .2s; flex: none; }
.bascule i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .22s cubic-bezier(.2, .9, .3, 1.4); }
.bascule input:checked + i { background: var(--bleu); }
.bascule input:checked + i::after { transform: translateX(15px); }
.bascule input:focus-visible + i { outline: 2px solid var(--bleu); outline-offset: 2px; }

.polices { position: relative; display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.polices button { flex: none; border: 1px solid var(--trait); background: #fff; border-radius: 10px; padding: 6px 12px 4px; text-align: center; min-width: 74px; scroll-snap-align: center; transition: border-color .15s, transform .15s; }
.polices button b { display: block; font-size: 21px; line-height: 1.25; font-weight: inherit; white-space: nowrap; }
.polices button small { font: 500 10.5px 'Archivo', sans-serif; color: var(--gris-clair); }
.polices button:hover { border-color: var(--encre); transform: translateY(-1px); }
.polices button[aria-pressed='true'] { border-color: var(--bleu); box-shadow: inset 0 0 0 1px var(--bleu); }

/* bibliothèque de motifs */
.motif-case {
  aspect-ratio: 1; border: 1px solid var(--trait); background: #fff; border-radius: 10px; padding: 9px;
  display: grid; place-items: center; position: relative; overflow: hidden;
  transition: border-color .15s, transform .2s cubic-bezier(.2, .9, .3, 1.3), background .15s;
}
.motif-case:hover { border-color: var(--bleu); transform: scale(1.05); background: #fbfcff; z-index: 1; }
.motif-case .teinte { width: 100%; height: 100%; background: var(--encre-courante, var(--bleu)); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.motif-case img { max-width: 100%; max-height: 100%; }
.motif-case svg { width: 62%; height: 62%; }
.motif-case.grand { padding: 6px; }
.motif-case.grand svg { width: 88%; height: 88%; }
.motif-case.choisie { border-color: var(--bleu); box-shadow: inset 0 0 0 1px var(--bleu); }
.vide { color: var(--gris); font-size: 13px; padding: 14px 0; }

.depot {
  border: 1.5px dashed var(--gris-clair); border-radius: 14px; padding: 26px 16px; text-align: center; color: var(--gris);
  transition: border-color .2s, background .2s, transform .2s; width: 100%; background: transparent; display: block;
}
.depot:hover, .depot.survol { border-color: var(--bleu); background: var(--bleu-doux); color: var(--encre); transform: scale(1.01); }
.depot svg { width: 30px; height: 30px; margin: 0 auto 8px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.depot b { display: block; color: var(--encre); font-size: 14px; }
.astuce { font-size: 12.5px; color: var(--gris); background: var(--lin); border-radius: 10px; padding: 10px 12px; margin-top: 14px; }
.liste-idees { display: grid; gap: 6px; }
.liste-idees button { text-align: left; border: 1px solid var(--trait); background: #fff; border-radius: 10px; padding: 8px 11px; font-size: 13px; transition: border-color .15s, transform .15s; }
.liste-idees button:hover { border-color: var(--encre); transform: translateX(2px); }
.pile { display: grid; gap: 8px; }
.pile .bouton { width: 100%; }

/* ───────────── scène ───────────── */
.scene {
  grid-area: scene; position: relative; min-width: 0; min-height: 0;
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto; justify-items: center; align-items: center;
  padding: 26px 20px 12px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, #fbf8f2 0%, rgba(251, 248, 242, 0) 70%),
    repeating-linear-gradient(45deg, rgba(120, 96, 60, .035) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(120, 96, 60, .035) 0 2px, transparent 2px 6px),
    var(--lin);
  overflow: hidden;
}
.plateau { position: relative; width: var(--cote, 480px); height: var(--cote, 480px); touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform; }
.carreau { position: absolute; inset: 0; filter: drop-shadow(0 2px 2px rgba(var(--ombre), .28)) drop-shadow(0 22px 26px rgba(var(--ombre), .26)); }
.carreau > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.carreau .mc-calque { cursor: grab; }
.carreau .mc-calque:active { cursor: grabbing; }
.carreau .sortant { animation: sortie .32s ease both; pointer-events: none; }
@keyframes sortie { to { opacity: 0; } }
.poignees { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.poignees [data-poignee] { pointer-events: all; cursor: nwse-resize; }
.poignees [data-poignee='tourner'] { cursor: grab; }
.poignees .cadre-sel { fill: none; stroke: var(--bleu-vif); }
.poignees .poignee { fill: #fff; stroke: var(--bleu-vif); }
.poignees .guide { stroke: var(--guide); }
.poignees .apparait { animation: poindre .2s cubic-bezier(.2, .9, .3, 1.5) both; transform-box: fill-box; transform-origin: center; }
@keyframes poindre { from { opacity: 0; transform: scale(.4); } }
.bulle-angle { position: absolute; padding: 3px 8px; border-radius: 6px; background: var(--encre); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; transform: translate(-50%, -140%); }

.actions { display: flex; align-items: center; gap: 2px; min-height: 46px; margin-top: 14px; padding: 4px; border-radius: 14px; background: var(--papier); box-shadow: 0 1px 2px rgba(var(--ombre), .12), 0 10px 20px -12px rgba(var(--ombre), .35); transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1); }
.actions.vide { opacity: 0; transform: translateY(8px); pointer-events: none; }
.actions .outil { height: 38px; }
.actions .outil.danger:hover { background: #fdeceb; color: #c0281c; }
.actions .nom { padding: 0 12px 0 10px; font-weight: 600; font-size: 13px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.film { display: flex; align-items: center; gap: 10px; padding: 12px 6px 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.film .case { position: relative; flex: none; width: 58px; height: 58px; padding: 0; border: 0; background: none; border-radius: 5px; transition: transform .2s cubic-bezier(.2, .9, .3, 1.4); }
.film .case svg { width: 100%; height: 100%; border-radius: 4.5%; box-shadow: 0 1px 2px rgba(var(--ombre), .25), 0 6px 10px -6px rgba(var(--ombre), .4); }
.film .case:hover { transform: translateY(-3px); }
.film .case.active { transform: translateY(-5px) scale(1.06); }
.film .case.active svg { outline: 2.5px solid var(--bleu); outline-offset: 3px; }
.film .case .oter { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--encre); color: #fff; font-size: 13px; line-height: 20px; padding: 0; opacity: 0; transition: opacity .15s; }
.film .case:hover .oter, .film .case.active .oter { opacity: 1; }
.film .plus { flex: none; width: 58px; height: 58px; border-radius: 8px; border: 1.5px dashed var(--gris-clair); background: transparent; color: var(--gris); font-size: 24px; line-height: 1; transition: border-color .15s, color .15s, transform .2s; }
.film .plus:hover { border-color: var(--bleu); color: var(--bleu); transform: rotate(90deg); }
.film .note { font-size: 12.5px; color: var(--gris); margin-left: 6px; white-space: nowrap; }
.film .note b { color: #0e7a4d; }

/* ───────────── colonne de droite ───────────── */
.droite { grid-area: droite; background: var(--papier); border-left: 1px solid var(--trait); display: flex; flex-direction: column; min-height: 0; }
.bloc { padding: 16px 14px; min-height: 0; }
.bloc h2 { font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
#bloc-calques { border-bottom: 1px solid var(--trait); flex: none; max-height: 44%; overflow: auto; }
#bloc-props { flex: 1; overflow: auto; }
.calques { display: grid; gap: 3px; position: relative; }
.calque {
  display: grid; grid-template-columns: 18px 30px minmax(0, 1fr) 26px 26px; align-items: center; gap: 6px;
  height: 42px; padding: 0 4px 0 2px; border-radius: 9px; border: 1px solid transparent; background: transparent; cursor: pointer;
  transition: background .12s, border-color .12s, transform .18s;
}
.calque:hover { background: var(--lin); }
.calque.choisi { background: var(--bleu-doux); border-color: #c9d6f7; }
.calque.fixe { grid-template-columns: 18px 30px minmax(0, 1fr); color: var(--gris); }
.calque.cache .nom, .calque.cache .apercu { opacity: .35; }
.calque.glisse { background: #fff; box-shadow: 0 8px 18px -8px rgba(var(--ombre), .5); z-index: 3; position: relative; transition: none; }
.calque .prise { cursor: grab; color: var(--gris-clair); display: grid; place-items: center; height: 100%; touch-action: none; }
.calque .prise svg { width: 12px; height: 16px; fill: currentColor; }
.calque .apercu { width: 30px; height: 30px; border-radius: 6px; background: var(--lin); display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 14px; color: var(--encre); }
.calque .apercu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.calque .apercu .teinte { width: 22px; height: 22px; background: var(--c, var(--bleu)); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.calque .apercu img { max-width: 24px; max-height: 24px; }
.calque .nom { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calque .mini { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 6px; color: var(--gris-clair); display: grid; place-items: center; padding: 0; }
.calque .mini:hover { background: #fff; color: var(--encre); }
.calque .mini.actif { color: var(--bleu); }
.calque .mini svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.props .rien { color: var(--gris); font-size: 13px; }
.props .rien b { color: var(--encre); display: block; margin-bottom: 4px; }
.props hr { border: 0; border-top: 1px solid var(--trait); margin: 14px 0; }
.props .rangee { display: flex; gap: 6px; flex-wrap: wrap; }

/* ───────────── fenêtres (aperçu, panier) ───────────── */
.voile { position: fixed; inset: 0; z-index: 20; background: rgba(28, 34, 51, .46); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: voile .25s ease both; }
.voile[hidden] { display: none; }
@keyframes voile { from { opacity: 0; } }
.fenetre { background: var(--papier); border-radius: 22px; width: min(1040px, 100%); max-height: min(92dvh, 860px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(10, 16, 40, .6); animation: fenetre .38s cubic-bezier(.2, .9, .25, 1.05) both; }
@keyframes fenetre { from { opacity: 0; transform: translateY(26px) scale(.96); } }
.fenetre header { display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--trait); }
.fenetre header h2 { font-size: 17px; flex: none; }
.fenetre header .segments { margin: 0 auto; }
.fenetre .fermer { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--lin); font-size: 20px; line-height: 1; transition: transform .2s, background .15s; flex: none; }
.fenetre .fermer:hover { transform: rotate(90deg); background: var(--lin-fonce); }
.fenetre .corps { flex: 1; min-height: 0; overflow: auto; }

/* aperçu « en main » */
.vue { height: min(66dvh, 640px); position: relative; display: grid; place-items: center; overflow: hidden; }
.vue-main { background: radial-gradient(ellipse at 50% 30%, #fdfaf4, #e7dece); perspective: 1300px; cursor: grab; touch-action: none; }
.vue-main .objet { width: min(46dvh, 420px, 70vw); aspect-ratio: 1; position: relative; transform-style: preserve-3d; transition: transform .12s ease-out; animation: balance 7s ease-in-out infinite; }
.vue-main .objet.tenu { animation: none; }
@keyframes balance { 0%, 100% { transform: rotateX(8deg) rotateY(-16deg); } 50% { transform: rotateX(-5deg) rotateY(16deg); } }
.vue-main .objet > * { position: absolute; inset: 0; border-radius: 2.4%; }
.vue-main .objet svg { width: 100%; height: 100%; }
.vue-main .tranche { background: #d9cfc0; }
.vue-main .tranche.dos { background: #b9ab97; box-shadow: 0 40px 60px -6px rgba(var(--ombre), .45); }
.vue-main .reflet { pointer-events: none; mix-blend-mode: soft-light; background: radial-gradient(circle at var(--rx, 30%) var(--ry, 20%), rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 46%); transform: translateZ(.6px); }
.vue-main .reflet.vif { mix-blend-mode: normal; opacity: .32; background: radial-gradient(circle at var(--rx, 30%) var(--ry, 20%), rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 30%); }
.vue .consigne { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 12.5px; color: var(--gris); pointer-events: none; }

/* aperçu « éclaté » */
.vue-eclate { background: radial-gradient(ellipse at 50% 60%, #f7f9ff, #dfe6f6); perspective: 1700px; cursor: grab; touch-action: none; }
.vue-eclate .pile3d { width: min(34dvh, 300px, 56vw); aspect-ratio: 1; position: relative; transform-style: preserve-3d; transform: translateY(8%) rotateX(var(--ax, 58deg)) rotateZ(var(--az, -38deg)); }
.vue-eclate .plan { position: absolute; inset: 0; transform: translateZ(calc(var(--i) * var(--ecart, 0px))); transform-style: preserve-3d; }
.vue-eclate .plan svg { width: 100%; height: 100%; border-radius: 2.4%; }
.vue-eclate .plan:not(.socle) svg { outline: 1.5px dashed rgba(27, 61, 166, .38); outline-offset: -1px; background: rgba(255, 255, 255, .1); }
.vue-eclate .plan.socle svg { box-shadow: 0 0 0 1px rgba(var(--ombre), .2), 26px 26px 50px rgba(var(--ombre), .35); }
.vue-eclate .etiquette3d { position: absolute; left: 104%; top: 4%; white-space: nowrap; font-size: 12.5px; font-weight: 650; color: var(--bleu); background: rgba(255, 255, 255, .9); padding: 3px 9px; border-radius: 999px; transform: rotateZ(calc(var(--az, -38deg) * -1)) rotateX(calc(var(--ax, 58deg) * -1)); transform-origin: left center; opacity: var(--op, 1); }
.vue-eclate .reglage { position: absolute; top: 14px; right: 16px; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .85); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; }
.vue-eclate .reglage input { width: 130px; }

/* aperçu « au mur » */
.vue-mur { background: var(--mur, #e9e2d3); transition: background .4s; align-content: center; gap: 0; padding: 26px 20px 70px; }
.vue-mur .etagere { display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 2vw, 22px); padding: 0 34px; position: relative; margin-top: 30px; }
.vue-mur .etagere::after { content: ''; position: absolute; left: 0; right: 0; bottom: -13px; height: 13px; border-radius: 2px; background: linear-gradient(#fbf9f5, #e3dccf); box-shadow: 0 12px 16px -6px rgba(0, 0, 0, .28), 0 1px 0 rgba(255, 255, 255, .8) inset; }
.vue-mur .pose { width: clamp(64px, 12dvh, 118px); aspect-ratio: 1; transform-origin: 50% 100%; transform: perspective(700px) rotateX(5deg); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .22)); animation: pose .7s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(var(--n) * 70ms); }
.vue-mur .pose svg { width: 100%; height: 100%; border-radius: 3%; }
@keyframes pose { from { opacity: 0; transform: perspective(700px) translateY(-46px) rotateX(-24deg); } }
.vue-mur .murs { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.vue-mur .accrochage { display: grid; grid-template-columns: repeat(var(--cols), auto); gap: clamp(7px, 1.5dvh, 16px); justify-content: center; }
.vue-mur.accroche .pose { width: min(128px, calc((100dvh - 330px) / var(--rangs)), calc((100vw - 90px) / var(--cols))); transform: none; filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .24)); animation-name: accroche; animation-delay: calc(var(--n) * 45ms); }
@keyframes accroche { from { opacity: 0; transform: translateY(-14px) rotate(-3deg) scale(.9); } to { opacity: 1; transform: none; } }
.vue-mur .choix-mur { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: center; }
.vue-mur .choix-mur .segments { background: rgba(255, 255, 255, .7); }
.vue-mur .seul { text-align: center; color: rgba(0, 0, 0, .55); font-size: 13px; margin-top: 34px; }

/* panier */
.panier { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 0; }
.panier .cote-g { padding: 22px; background: var(--lin); display: flex; flex-wrap: wrap; gap: 14px; align-content: flex-start; justify-content: center; }
.panier .cote-g svg { width: 132px; height: 132px; border-radius: 3%; box-shadow: 0 2px 3px rgba(var(--ombre), .22), 0 14px 20px -10px rgba(var(--ombre), .45); animation: pose2 .5s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--n) * 60ms); }
@keyframes pose2 { from { opacity: 0; transform: translateY(14px) scale(.9); } }
.panier .cote-d { padding: 22px 24px; }
.panier .ligne { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--trait); font-size: 13.5px; }
.panier .ligne.total { border: 0; font-size: 19px; font-weight: 700; padding-top: 14px; }
.panier .ligne .moins { color: #0e7a4d; font-weight: 600; }
.panier .options { display: grid; gap: 8px; margin: 14px 0; }
.panier .mention { font-size: 12px; color: var(--gris); margin-top: 12px; }
.panier .pile { margin-top: 16px; }
.fabrication { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.fabrication figure { margin: 0; }
.fabrication canvas, .fabrication img { width: 100%; aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--trait); background: #fff; display: block; }
.fabrication figcaption { font-size: 12px; color: var(--gris); margin-top: 5px; }

.toast { position: fixed; left: 50%; top: 74px; max-width: calc(100vw - 24px); z-index: 40; transform: translateX(-50%); background: var(--encre); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 550; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5); animation: toast .35s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, -14px); } }

/* sur ordinateur, l'atelier est une page qui ne défile jamais : rien ne peut la pousser, pas même un champ qui prend le focus
   (« clip » pour les navigateurs qui le connaissent, « hidden » pour les autres ; le téléphone garde son réglage, à cause du clavier) */
@media (min-width: 901px) {
  html { overflow: hidden; }
  body { overflow: hidden; overflow: clip; }
}

/* ───────────── téléphone et tablette ───────────── */
@media (max-width: 1180px) {
  body { grid-template-columns: var(--rail) 300px minmax(0, 1fr) 272px; }
  .outil.texte span { display: none; }
}
@media (max-width: 900px) {
  body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 54px minmax(0, 1fr) auto calc(62px + env(safe-area-inset-bottom));
    grid-template-areas: 'barre' 'scene' 'feuille' 'rail';
  }
  .barre { padding: 0 10px; gap: 6px; }
  .marque span { display: none; }
  .barre-milieu { margin-left: 2px; gap: 0; }
  .separateur, .choix-format svg { display: none; }
  .choix-format { padding: 0 2px; }
  .prix small { display: none; }
  .prix b { font-size: 16px; }
  .barre-fin { gap: 8px; }
  .bouton.plein { height: 38px; padding: 0 14px; font-size: 13px; }
  .barre .prix, #btn-surprise { display: none; }
  .barre .bouton .long { display: none; }
  .barre .bouton .court { display: inline; }
  .barre-milieu { overflow: hidden; }
  .rail { -webkit-mask: linear-gradient(90deg, #000 86%, transparent); mask: linear-gradient(90deg, #000 86%, transparent); }
  .rail { flex-direction: row; justify-content: flex-start; border-right: 0; border-top: 1px solid var(--trait); padding: 4px 6px env(safe-area-inset-bottom); gap: 0; }
  .rail button { width: auto; min-width: 62px; padding: 7px 8px 5px; }
  .rail .mobile { display: flex; }
  .volet, .droite { grid-area: feuille; border: 0; border-top: 1px solid var(--trait); max-height: 42dvh; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 24px -16px rgba(var(--ombre), .4); z-index: 4; }
  .volet { padding: 16px 14px 20px; }
  body[data-feuille='fermee'] .volet, body[data-feuille='fermee'] .droite { display: none; }
  body:not([data-onglet='calques']):not([data-onglet='props']) .droite { display: none; }
  body[data-onglet='calques'] .volet, body[data-onglet='props'] .volet { display: none; }
  body[data-onglet='calques'] #bloc-props, body[data-onglet='props'] #bloc-calques { display: none; }
  #bloc-calques { max-height: none; border: 0; }
  .scene { padding: 12px 10px 6px; }
  .actions { margin-top: 8px; }
  .actions .nom { display: none; }
  .film { padding-top: 8px; }
  .film .case, .film .plus { width: 46px; height: 46px; }
  .film .note { display: none; }
  .grille { grid-template-columns: repeat(3, 1fr); }
  .grille.trois { grid-template-columns: repeat(4, 1fr); }
  .grille.quatre { grid-template-columns: repeat(5, 1fr); }
  .panier { grid-template-columns: 1fr; }
  .panier .cote-g svg { width: 92px; height: 92px; }
  .fenetre header:has(.segments) h2 { display: none; }
  .fenetre header { padding: 12px 12px 12px 16px; gap: 10px; }
  /* iOS agrandit toute la page dès qu'un champ fait moins de 16 px */
  textarea, input[type='text'], input[type='search'], select { font-size: 16px; }
  .vue-eclate .pile3d { width: min(24dvh, 46vw); transform: translateY(14%) rotateX(var(--ax, 58deg)) rotateZ(var(--az, -38deg)); }
  .vue-eclate .etiquette3d { font-size: 11.5px; padding: 2px 8px; }
  .vue-eclate .reglage { top: auto; bottom: 56px; right: 50%; transform: translateX(50%); }
  .vue-eclate .reglage input { width: 150px; }
  .vue .consigne { padding: 0 14px; }
  /* clavier ouvert : le carreau d'abord, le champ de texte juste dessous */
  body.clavier { grid-template-rows: 46px minmax(0, 1fr) auto 0; }
  body.clavier .rail, body.clavier .film, body.clavier .actions { display: none; }
  body.clavier .volet, body.clavier .droite { max-height: 150px; }
  body.clavier .scene { padding: 8px; }
  body.clavier .barre { border-bottom: 0; }
  .voile { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* collections du soir : le mois de naissance, les boutons « mur » */
.jetons.serres.mois { display: grid; grid-template-columns: repeat(6, 1fr); }
.jetons.serres.mois .jeton { min-width: 0; padding-left: 2px; padding-right: 2px; font-size: 12px; }
.rangee-mur { display: flex; gap: 8px; margin: 0 0 6px; }
.rangee-mur .bouton { flex: 1; }
.bouton.plein-large { width: 100%; }

/* le guide d'un souvenir : un fil d'étapes, une étape à l'écran, « Suivant » en bas */
.rail .souvenir { display: none; }
body[data-souvenir] .rail .souvenir { display: flex; color: var(--bleu); }
.etapes { display: flex; gap: 6px; margin: 4px 0 14px; }
.etapes button { flex: 1 1 0; min-width: 0; border: 0; background: var(--lin); border-radius: 12px; padding: 8px 4px 7px; display: grid; justify-items: center; gap: 4px; font: 600 11.5px/1.15 'Archivo', sans-serif; color: var(--gris); cursor: pointer; }
.etapes button i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; background: var(--papier); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--gris); }
.etapes button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.etapes button.faite i { background: var(--bleu-doux); color: var(--bleu); }
.etapes button.active { background: var(--bleu-doux); color: var(--bleu); }
.etapes button.active i { background: var(--bleu); color: #fff; }
.etape-corps { display: grid; gap: 12px; }
.etape-corps input[type='text'] { width: 100%; font: 500 16px/1.3 'Archivo', sans-serif; color: var(--encre); background: var(--papier); border: 1.5px solid var(--trait); border-radius: 12px; padding: 10px 13px; outline: none; }
.etape-corps input[type='text']:focus { border-color: var(--bleu); }
.etape-pied { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--trait); }
.etape-pied .bouton.plein { flex: 1; max-width: 260px; margin-left: auto; }

/* la fenêtre qui demande le lieu, la date ou le son d'un souvenir, avec le carreau qui se redessine à côté */
.fenetre.etroite { width: min(880px, 100%); }
.demande-souvenir { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 26px; padding: 22px; overflow: auto; align-items: start; }
.demande-vue svg { width: 100%; height: auto; display: block; border-radius: 4.5%; box-shadow: 0 18px 34px -18px rgba(var(--ombre), .6); }
.demande-champs { display: grid; gap: 12px; align-content: start; min-width: 0; }
.demande-champs .intro { margin: 0 0 2px; font-size: 15px; line-height: 1.45; }
.demande-champs .etape-pied { margin-top: 8px; }
@media (max-width: 900px) {
  .demande-souvenir { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .demande-vue { width: min(54vw, 230px); margin: 0 auto; }
}
