/* Générateur de motifs CSS : styles propres à l'outil. L'aperçu et les vignettes sont colorés par le motif choisi (voulu). */
.o-motif-css [hidden] { display: none !important; }
.o-motif-css .mc-apercu {
  box-sizing: border-box; width: 100%; max-width: 100%; height: 320px; min-height: 120px; min-width: 120px;
  border: 1px solid var(--bord); border-radius: var(--rayon-petit); resize: both; overflow: hidden;
}
.o-motif-css .mc-apercu:fullscreen { width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; resize: none; }
.o-motif-css .mc-sous-apercu { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 6px; }
.o-motif-css .mc-sous-apercu .mc-aide { margin: 0; }
.o-motif-css .mc-aide { margin: 8px 0 10px; font-size: .9rem; color: var(--texte-2); }
.o-motif-css .mc-aide:empty { display: none; }
.o-motif-css .mc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.o-motif-css .mc-actions .btn, .o-motif-css .mc-sous-apercu .btn { min-height: 42px; }
.atelier .o-motif-css .btn[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); color: var(--sur-marque); }
.o-motif-css .btn:focus-visible, .o-motif-css input:focus-visible, .o-motif-css .mc-motifs button:focus-visible { outline: 3px solid var(--marque); outline-offset: 2px; }
.o-motif-css .tirage-message { margin-top: 8px; color: var(--texte); font-size: .95rem; overflow-wrap: anywhere; }
.o-motif-css .mc-contraste { margin: 10px 0 4px; padding: 8px 12px; border-radius: var(--rayon-petit); background: var(--surface-2); color: var(--texte); font-weight: 600; }
.o-motif-css .mc-contraste[data-niveau="ok"] { background: var(--ok-fond); color: var(--ok-texte); }
.o-motif-css .mc-contraste[data-niveau="faible"] { background: var(--erreur-fond); color: var(--erreur-texte); }

.o-motif-css .mc-bloc { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--bord); }
.o-motif-css .mc-bloc h2 { margin: 0 0 8px; font-size: 1.15rem; }

/* Choix du motif */
.o-motif-css .mc-motifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.o-motif-css .mc-motifs button {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px; min-height: 44px; cursor: pointer;
  border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte); font: inherit; font-size: .88rem; text-align: center;
}
.o-motif-css .mc-motifs button i { display: block; height: 48px; border-radius: calc(var(--rayon-petit) - 2px); border: 1px solid var(--bord); }
.o-motif-css .mc-motifs button[aria-pressed="true"] { border-color: var(--marque); box-shadow: 0 0 0 2px var(--marque); font-weight: 700; }

/* Réglages */
.o-motif-css .mc-couleurs input[type="color"], .o-motif-css .mc-trois input[type="color"] {
  width: 100%; max-width: 160px; height: 40px; padding: 3px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface); cursor: pointer;
}
.o-motif-css .mc-trois { display: flex; flex-direction: column; gap: 4px; }
.o-motif-css .mc-trois input[type="color"]:disabled { opacity: .4; cursor: not-allowed; }
.o-motif-css label.case { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.o-motif-css label.case input { width: 20px; height: 20px; accent-color: var(--marque); }
.o-motif-css .mc-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 20px; margin: 8px 0; }
.o-motif-css .mc-param { display: grid; grid-template-columns: minmax(0, 1fr) 80px; align-items: end; gap: 8px; }
.o-motif-css .mc-param label { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; color: var(--texte-2); }
.o-motif-css .mc-param input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--marque); }
.o-motif-css .mc-param input[type="number"] { min-height: 40px; padding-inline: 8px; width: 100%; box-sizing: border-box; }

/* Code */
.o-motif-css .mc-code {
  display: block; margin: 8px 0 0; padding: 14px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface-2); color: var(--texte);
  font: .9rem/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
}

@media (max-width: 640px) {
  .o-motif-css .mc-apercu { height: 240px; }
  .o-motif-css .mc-motifs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .o-motif-css .mc-params { grid-template-columns: 1fr; }
}
