.c27-editor-shell {
	max-width: 720px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.c27-notice {
	background: #fff4d6;
	color: #8a5b00;
	border-radius: 6px;
	padding: 12px 14px;
}

.c27-step {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/*
 * Même bug de spécificité CSS que `.c27-lightbox` (voir plus bas) : une règle
 * auteur `display` l'emporte toujours sur `[hidden] { display: none }` de
 * l'agent utilisateur, quelle que soit la spécificité comparée. Sans cette
 * règle, l'étape recadrage, l'étape papier et le formulaire panier — qui
 * portent tous l'attribut `hidden` avant qu'une photo soit choisie — étaient
 * déjà visibles en permanence dès le chargement de la page, avant même le
 * premier upload.
 */
.c27-step[hidden] {
	display: none;
}

/* Étape 1 — upload */

.c27-dropzone {
	border: 2px dashed #c3c4c7;
	border-radius: 10px;
	padding: 32px 16px;
	text-align: center;
	background: #fafafa;
}

.c27-thumbnails {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
}

.c27-thumbnail {
	position: relative;
	width: 90px;
	height: 90px;
	border-radius: 8px;
	overflow: hidden;
	border: 2px solid transparent;
	background: #eee;
	cursor: pointer;
}

.c27-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.c27-thumbnail-uploading {
	opacity: 0.6;
}

.c27-thumbnail-done {
	opacity: 1;
}

.c27-thumbnail-selected {
	border-color: #1b6dc1;
}

.c27-thumbnail-error {
	border-color: #b42318;
	opacity: 1;
}

.c27-thumbnail-label {
	position: absolute;
	inset: auto 0 0 0;
	font-size: 11px;
	padding: 2px 4px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.c27-thumbnail-progress {
	position: absolute;
	inset: auto 0 0 0;
	height: 4px;
	background: #1b6dc1;
	width: 0;
}

/* Étape 2 — recadrage */

.c27-editor-canvas {
	max-height: 480px;
	overflow: hidden;
	background: #111;
	border-radius: 8px;
}

.c27-editor-canvas img {
	display: block;
	max-width: 100%;
}

.c27-editor-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.c27-quality-line {
	display: flex;
	align-items: center;
	gap: 8px;
}

.c27-quality {
	display: inline-block;
	padding: 6px 10px;
	border-radius: 999px;
	font-weight: 700;
}

.c27-good {
	background: #dff6e8;
	color: #1f7a3d;
}

.c27-warning {
	background: #fff4d6;
	color: #8a5b00;
}

.c27-bad {
	background: #fce2e2;
	color: #b42318;
}

.c27-quality-message {
	font-size: 13px;
	color: #50575e;
}

/* Étape 3 — papier : bouton info + lightbox (Phase 6) */

.c27-paper-info-button {
	margin-top: 6px;
	font-size: 12px;
	background: none;
	border: 1px solid #c3c4c7;
	border-radius: 999px;
	padding: 4px 10px;
	cursor: pointer;
}

.c27-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

/*
 * Bug corrigé : `.c27-lightbox { display: flex }` est une règle auteur, qui
 * l'emporte toujours sur la règle `[hidden] { display: none }` de la feuille
 * de style du navigateur (même spécificité, mais l'auteur passe après l'UA
 * dans la cascade). Résultat : la modale restait visible en permanence,
 * attribut `hidden` ou pas — donc le bouton de fermeture semblait ne rien
 * faire. Un sélecteur combiné avec l'attribut a une spécificité supérieure
 * et referme réellement la modale.
 */
.c27-lightbox[hidden] {
	display: none;
}

.c27-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

.c27-lightbox-content {
	position: relative;
	background: #fff;
	border-radius: 10px;
	padding: 24px;
	max-width: 560px;
	width: calc(100% - 32px);
	max-height: 85vh;
	overflow-y: auto;
}

.c27-lightbox-close {
	position: absolute;
	top: 10px;
	right: 10px;
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.c27-lightbox-images {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.c27-lightbox-images img {
	width: 100%;
	border-radius: 8px;
	object-fit: cover;
	max-height: 260px;
}

.c27-lightbox-fiche {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 12px;
	margin: 0;
}

.c27-lightbox-fiche dt {
	font-weight: 600;
}

.c27-lightbox-fiche dd {
	margin: 0;
}

.c27-lightbox-caveat {
	margin-top: 16px;
	font-size: 12px;
	color: #757575;
	font-style: italic;
}

/* Étape 4 — panier */

.c27-step-cart {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.c27-step-cart input[type="number"] {
	width: 70px;
}

.c27-cart-error {
	color: #b42318;
	font-weight: 600;
	margin: 0;
	flex-basis: 100%;
}
