/*
 * Page Studio « /personnalisation/ » — styles PROPRES à la page (chargés uniquement sur elle).
 * Mobile-first, jetons --cmb-* de main.css (palette, typographie, espacements, rayons).
 * Le canevas de l'étiquette est celui du moteur cmb-core : aucun style ne modifie son contenu
 * (l'ombre est un filtre CSS d'affichage, jamais dans l'export).
 *
 * Sommaire : 1. Intro · 2. Studio (grille, état) · 3. Aperçu · 4. Onglets et panneaux ·
 * 5. Champs · 6. Parfums · 7. Étiquettes · 8. Textes · 9. Photo · 10. Récapitulatif ·
 * 11. Fenêtres · 12. Bureau · 13. Mouvement réduit
 *
 * 0.2.1 (thème 0.12.7) : contour de focus clavier rétabli sur la zone d'édition ; curseurs : défilement
 * vertical de la page laissé au navigateur (touch-action), la valeur ne change qu'en saisissant la poignée
 * (personnalisation-0.2.1.js).
 */

/* 1. Intro ---------------------------------------------------------------------------------- */

/* Intro COURTE : sur mobile, l'aperçu doit arriver dans le premier écran. */
.cmb-studio-intro {
	padding-block: var(--cmb-space-m) var(--cmb-space-s);
}

.cmb-studio-intro .cmb-eyebrow {
	margin-bottom: var(--cmb-space-3xs);
}

.cmb-studio-intro__title {
	max-width: 30ch;
	margin-bottom: var(--cmb-space-2xs);
	font-size: clamp(1.75rem, 1.4rem + 1.6vw, 3rem);
}

.cmb-studio-intro__lead {
	max-width: 40rem;
	margin-bottom: var(--cmb-space-xs);
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-base);
	line-height: var(--cmb-leading-snug);
}

.cmb-studio-intro__facts {
	display: flex;
	flex-wrap: wrap;
	gap: var(--cmb-space-3xs) var(--cmb-space-2xs);
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-xs);
}

.cmb-studio-intro__facts li {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.2rem 0.65rem;
	background: var(--cmb-color-linen);
	border-radius: var(--cmb-radius-pill);
}

.cmb-studio-intro__facts strong {
	color: var(--cmb-color-accent-strong);
	font-weight: var(--cmb-weight-semibold);
}

/* 2. Studio ---------------------------------------------------------------------------------- */

.cmb-studio {
	padding-bottom: var(--cmb-space-xl);
}

.cmb-studio__status {
	display: grid;
	justify-items: start;
	gap: var(--cmb-space-s);
	padding: var(--cmb-space-l);
	background: var(--cmb-color-surface);
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-l);
}

.cmb-studio__status[hidden] {
	display: none;
}

.cmb-studio__status-title {
	margin: 0;
	font-family: var(--cmb-font-heading);
	font-size: var(--cmb-text-xl);
	line-height: var(--cmb-leading-snug);
}

.cmb-studio__status[data-state="loading"] .cmb-studio__status-title::before {
	content: "";
	display: inline-block;
	width: 0.9em;
	height: 0.9em;
	margin-right: 0.6em;
	vertical-align: -0.1em;
	border: 2px solid var(--cmb-color-beige);
	border-top-color: var(--cmb-color-accent);
	border-radius: 50%;
	animation: cmb-studio-spin 0.9s linear infinite;
}

@keyframes cmb-studio-spin {
	to { transform: rotate(360deg); }
}

.cmb-studio__app {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--cmb-space-m);
}

.cmb-studio__app[hidden],
.cmb-studio-summary[hidden] {
	display: none;
}

/* 3. Aperçu ---------------------------------------------------------------------------------- */

.cmb-studio__preview-card {
	padding: var(--cmb-space-3xs) var(--cmb-space-2xs) var(--cmb-space-xs);
	background: var(--cmb-color-linen);
	border-radius: var(--cmb-radius-l);
}

.cmb-studio__preview-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--cmb-space-s);
	padding-inline: var(--cmb-space-2xs);
}

.cmb-studio__preview-card > .cmb-studio__help,
.cmb-studio__messages {
	padding-inline: var(--cmb-space-2xs);
}

.cmb-studio__preview-label {
	margin: 0;
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-sm);
}

/* Surface d'édition du moteur (padding = demi-cible tactile, posé par le moteur). */
/* overflow : un texte plus grand que l'étiquette ne recouvre pas l'aide sous l'aperçu (le padding
   du moteur contient déjà les poignées des textes placés sur l'étiquette). */
.cmb-studio__surface {
	max-width: 36rem;
	margin-inline: auto;
	overflow: hidden;
	border-radius: var(--cmb-radius-m);
}

.cmb-studio__surface canvas {
	filter: drop-shadow(0 6px 14px rgb(24 22 20 / 0.14));
}

/* Zone d'édition atteinte au clavier : contour visible. Le moteur cmb-core pose « outline: none » en
   style inline sur cette zone (fichier servi, immuable) : seul !important rétablit le contour du thème. */
.cmb-studio__surface:focus-visible {
	outline: 2px solid var(--cmb-color-focus) !important;
	outline-offset: -2px;
}

.cmb-studio__mode {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--cmb-space-2xs) var(--cmb-space-xs);
	margin-top: var(--cmb-space-2xs);
}

.cmb-studio__mode[hidden] {
	display: none;
}

.cmb-studio__mode-label {
	font-size: var(--cmb-text-sm);
	font-weight: var(--cmb-weight-medium);
}

.cmb-studio-segmented {
	display: inline-flex;
	padding: 0.2rem;
	background: var(--cmb-color-surface);
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-pill);
}

.cmb-studio-segmented button {
	min-height: var(--cmb-tap-target);
	padding: 0.4rem 1.1rem;
	background: transparent;
	color: var(--cmb-color-text);
	font: inherit;
	font-size: var(--cmb-text-sm);
	font-weight: var(--cmb-weight-medium);
	border: 0;
	border-radius: var(--cmb-radius-pill);
	cursor: pointer;
}

.cmb-studio-segmented button[aria-pressed="true"] {
	background: var(--cmb-color-charcoal);
	color: var(--cmb-color-white);
}

.cmb-studio__help {
	margin: var(--cmb-space-2xs) 0 0;
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-sm);
	line-height: var(--cmb-leading-snug);
}

.cmb-studio__preview-card > .cmb-studio__help {
	text-align: center;
}

.cmb-studio__messages:empty {
	display: none;
}

.cmb-studio__message {
	margin: var(--cmb-space-2xs) 0 0;
	padding: 0.6rem 0.85rem;
	font-size: var(--cmb-text-sm);
	line-height: var(--cmb-leading-snug);
	background: var(--cmb-color-surface);
	border-left: 3px solid var(--cmb-color-border-strong);
	border-radius: var(--cmb-radius-s);
}

.cmb-studio__message--error,
.cmb-studio__message--warning {
	color: var(--cmb-color-error);
	border-left-color: var(--cmb-color-error);
}

/* Lien-bouton discret (Agrandir, Fermer, Supprimer). */
.cmb-studio-link {
	display: inline-flex;
	align-items: center;
	min-height: var(--cmb-tap-target);
	padding: 0 0.25rem;
	background: none;
	color: var(--cmb-color-text);
	font: inherit;
	font-size: var(--cmb-text-sm);
	font-weight: var(--cmb-weight-medium);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
	border: 0;
	cursor: pointer;
}

.cmb-studio-link:hover {
	color: var(--cmb-color-accent-strong);
}

.cmb-studio-link--danger {
	color: var(--cmb-color-error);
}

/* 4. Onglets et panneaux ---------------------------------------------------------------------- */

.cmb-studio__controls {
	min-width: 0;
	background: var(--cmb-color-surface);
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-l);
}

.cmb-studio-tabs {
	display: grid;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	gap: 0.25rem;
	padding: 0.35rem;
	background: var(--cmb-color-linen);
	border-bottom: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-l) var(--cmb-radius-l) 0 0;
}

.cmb-studio-tabs [role="tab"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: var(--cmb-tap-target);
	padding: 0.4rem 0.35rem;
	background: transparent;
	color: var(--cmb-color-text-muted);
	font: inherit;
	font-size: var(--cmb-text-sm);
	font-weight: var(--cmb-weight-medium);
	border: 0;
	border-radius: var(--cmb-radius-m);
	cursor: pointer;
}

.cmb-studio-tabs [role="tab"][hidden] {
	display: none;
}

.cmb-studio-tabs [role="tab"][aria-selected="true"] {
	background: var(--cmb-color-surface);
	color: var(--cmb-color-text);
	box-shadow: var(--cmb-shadow-s);
}

.cmb-studio-tabs [role="tab"]:focus-visible {
	outline-offset: -2px;
}

/* Étape faite : petite coche verte (caractère, aucune icône externe). */
.cmb-studio-tabs__check {
	display: none;
	color: var(--cmb-color-success);
	font-weight: var(--cmb-weight-semibold);
	line-height: 1;
}

.cmb-studio-tabs [data-done="true"] .cmb-studio-tabs__check {
	display: inline;
}

.cmb-studio-tabs [data-done="true"] .cmb-studio-tabs__check::before {
	content: "✓";
}

.cmb-studio-panel {
	padding: var(--cmb-space-m) var(--cmb-space-s) var(--cmb-space-s);
}

.cmb-studio-panel[hidden] {
	display: none;
}

.cmb-studio-panel__title {
	margin: 0 0 var(--cmb-space-s);
	padding: 0;
	font-size: var(--cmb-text-xl);
}

.cmb-studio-panel__count {
	margin: 0 0 var(--cmb-space-2xs);
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-sm);
}

.cmb-studio-panel__empty {
	margin: var(--cmb-space-xs) 0;
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-sm);
}

.cmb-studio-panel__next {
	display: flex;
	justify-content: flex-end;
	margin-top: var(--cmb-space-m);
	padding-top: var(--cmb-space-s);
	border-top: 1px solid var(--cmb-color-border);
}

.cmb-studio-panel__next[hidden] {
	display: none;
}

.cmb-studio-panel__next .cmb-button::after {
	content: "→";
	margin-left: 0.5em;
}

/* 5. Champs ------------------------------------------------------------------------------------ */

.cmb-studio fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.cmb-studio-field,
.cmb-studio fieldset.cmb-studio-field {
	/* 0.1.1 : « .cmb-studio fieldset { margin: 0 } » annulait cet espacement pour Police, Couleur
	   du texte et Alignement (groupes collés les uns aux autres). */
	margin-bottom: var(--cmb-space-s);
}

.cmb-studio-field__label {
	display: block;
	margin-bottom: 0.35rem;
	padding: 0;
	font-size: var(--cmb-text-sm);
	font-weight: var(--cmb-weight-semibold);
}

.cmb-studio-input {
	display: block;
	width: 100%;
	min-height: var(--cmb-tap-target);
	padding: 0.6rem 0.85rem;
	background: var(--cmb-color-white);
	color: var(--cmb-color-text);
	font: inherit;
	font-size: 1rem; /* 16 px : pas de zoom automatique du clavier iOS */
	border: 1px solid var(--cmb-color-border-strong);
	border-radius: var(--cmb-radius-m);
}

.cmb-studio-input:focus-visible {
	outline-offset: 1px;
}

.cmb-studio-input--text {
	resize: vertical;
	line-height: var(--cmb-leading-snug);
}

.cmb-studio-btn {
	min-height: var(--cmb-tap-target);
	padding: 0.55rem 1.1rem;
	cursor: pointer;
}

.cmb-studio-btn:disabled {
	background: var(--cmb-color-beige);
	color: var(--cmb-color-stone);
	cursor: not-allowed;
}

/* Choix (radios natifs masqués, libellés cliquables). */
.cmb-studio-choice__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.cmb-studio-choices {
	display: flex;
	flex-wrap: wrap;
	gap: var(--cmb-space-2xs);
}

.cmb-studio-choice {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: var(--cmb-tap-target);
	padding: 0.4rem 0.95rem;
	background: var(--cmb-color-white);
	color: var(--cmb-color-text);
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-m);
	cursor: pointer;
	transition: border-color var(--cmb-duration-fast) var(--cmb-ease), background-color var(--cmb-duration-fast) var(--cmb-ease);
}

.cmb-studio-choices--fonts .cmb-studio-choice {
	min-width: 6.5rem;
	font-size: 1.125rem;
}

.cmb-studio-choice:hover {
	border-color: var(--cmb-color-border-strong);
}

.cmb-studio-choice__input:checked + .cmb-studio-choice {
	background: var(--cmb-color-ivory);
	border-color: var(--cmb-color-accent-strong);
	box-shadow: inset 0 0 0 1px var(--cmb-color-accent-strong);
}

.cmb-studio-choice__input:focus-visible + .cmb-studio-choice,
.cmb-studio-choice__input:focus-visible + .cmb-studio-swatch {
	outline: 2px solid var(--cmb-color-focus);
	outline-offset: 2px;
}

.cmb-studio-align-icon {
	display: inline-grid;
	gap: 2px;
	width: 1rem;
}

.cmb-studio-align-icon span {
	height: 2px;
	background: currentColor;
	border-radius: 1px;
}

.cmb-studio-align-icon span:nth-child(2) { width: 65%; }
.cmb-studio-align-icon span:nth-child(3) { width: 85%; }
[data-align="center"] .cmb-studio-align-icon { justify-items: center; }
[data-align="right"] .cmb-studio-align-icon { justify-items: end; }

/* Couleur du texte (0.1.1) : la couleur ACTIVE est nommée dans la légende et marquée sans dépendre
   de la teinte : coche ✓ dans la pastille + anneau charbon séparé par un liseré clair (le cuivre de
   la palette n'est plus utilisé comme marque de sélection). Bord renforcé pour Ivoire / Blanc chaud. */
.cmb-studio-field__current {
	color: var(--cmb-color-text-muted);
	font-weight: var(--cmb-weight-regular);
}

.cmb-studio-field__current:not(:empty)::before {
	content: "· ";
}

.cmb-studio-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.cmb-studio-swatch {
	display: inline-grid;
	place-items: center;
	width: var(--cmb-tap-target);
	height: var(--cmb-tap-target);
	border-radius: 50%;
	cursor: pointer;
}

.cmb-studio-swatch__dot {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border: 1px solid rgb(24 22 20 / 0.35);
	border-radius: 50%;
	transition: box-shadow var(--cmb-duration-fast) var(--cmb-ease);
}

.cmb-studio-swatch__check {
	visibility: hidden;
	color: var(--cmb-color-white);
	font-size: 1rem;
	font-weight: var(--cmb-weight-semibold);
	line-height: 1;
}

.cmb-studio-swatch[data-tone="light"] .cmb-studio-swatch__check {
	color: var(--cmb-color-charcoal);
}

.cmb-studio-swatch:hover .cmb-studio-swatch__dot {
	box-shadow: 0 0 0 2px var(--cmb-color-white), 0 0 0 3px var(--cmb-color-taupe);
}

.cmb-studio-choice__input:checked + .cmb-studio-swatch .cmb-studio-swatch__dot {
	box-shadow: 0 0 0 2px var(--cmb-color-white), 0 0 0 4px var(--cmb-color-charcoal);
}

.cmb-studio-choice__input:checked + .cmb-studio-swatch .cmb-studio-swatch__check {
	visibility: visible;
}

.cmb-studio-field--range {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	column-gap: var(--cmb-space-xs);
}

.cmb-studio-field--range .cmb-studio-field__label {
	grid-column: 1 / -1;
}

.cmb-studio-field--range[hidden] {
	display: none;
}

.cmb-studio-range {
	width: 100%;
	min-height: var(--cmb-tap-target);
	margin: 0;
	accent-color: var(--cmb-color-accent-strong);
	cursor: pointer;
	/* Glissement vertical = défilement de la page ; seul un glissement horizontal parti de la poignée
	   règle la valeur (garde de la piste dans personnalisation.js). */
	touch-action: pan-y;
}

.cmb-studio-field--range output {
	min-width: 3ch;
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-sm);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

/* Puces (univers). */
.cmb-studio-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: var(--cmb-space-xs);
}

.cmb-studio-chips[hidden] {
	display: none;
}

.cmb-studio-chip {
	min-height: var(--cmb-tap-target);
	padding: 0.3rem 0.95rem;
	background: var(--cmb-color-white);
	color: var(--cmb-color-text);
	font: inherit;
	font-size: var(--cmb-text-sm);
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-pill);
	cursor: pointer;
}

.cmb-studio-chip[aria-pressed="true"] {
	background: var(--cmb-color-charcoal);
	color: var(--cmb-color-white);
	border-color: var(--cmb-color-charcoal);
}

/* 6. Parfums ----------------------------------------------------------------------------------- */

.cmb-studio-products__list {
	display: grid;
	gap: 0.35rem;
	max-height: 22rem;
	margin: 0;
	padding: 0.15rem 0.35rem 0.15rem 0.15rem;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
	scrollbar-gutter: stable;
}

.cmb-studio-product[hidden] {
	display: none;
}

/* Les radios masqués (position absolue) restent DANS leur ligne : sinon ils s'échappent de la liste
   défilante et allongent la page. */
.cmb-studio-product,
.cmb-studio-format,
.cmb-studio-choice__wrap,
.cmb-studio-photo__actions {
	position: relative;
}

.cmb-studio-product__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.cmb-studio-product__label {
	display: grid;
	grid-template-columns: 3rem minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--cmb-space-xs);
	min-height: 3.5rem;
	padding: 0.35rem 0.75rem 0.35rem 0.35rem;
	background: var(--cmb-color-white);
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-m);
	cursor: pointer;
}

.cmb-studio-product__label::after {
	content: "";
	width: 1.15rem;
	height: 1.15rem;
	border: 1.5px solid var(--cmb-color-border-strong);
	border-radius: 50%;
}

.cmb-studio-product__label:hover {
	border-color: var(--cmb-color-border-strong);
}

.cmb-studio-product__input:checked + .cmb-studio-product__label {
	background: var(--cmb-color-ivory);
	border-color: var(--cmb-color-accent-strong);
	box-shadow: inset 0 0 0 1px var(--cmb-color-accent-strong);
}

.cmb-studio-product__input:checked + .cmb-studio-product__label::after {
	border-color: var(--cmb-color-accent-strong);
	background: radial-gradient(circle, var(--cmb-color-accent-strong) 0 45%, transparent 48%);
}

.cmb-studio-product__input:focus-visible + .cmb-studio-product__label {
	outline: 2px solid var(--cmb-color-focus);
	outline-offset: 1px;
}

.cmb-studio-product__thumb {
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	overflow: hidden;
	background: var(--cmb-color-linen);
	border-radius: var(--cmb-radius-s);
}

.cmb-studio-product__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cmb-studio-product__placeholder {
	color: var(--cmb-color-accent-strong);
	font-family: var(--cmb-font-heading);
	font-size: 1.25rem;
}

.cmb-studio-product__text {
	display: grid;
	min-width: 0;
}

.cmb-studio-product__name {
	font-weight: var(--cmb-weight-medium);
	line-height: var(--cmb-leading-snug);
}

.cmb-studio-product__meta {
	overflow: hidden;
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-xs);
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 7. Étiquettes -------------------------------------------------------------------------------- */

.cmb-studio-formats .cmb-studio-panel__title {
	float: left; /* légende en titre, dans le flux */
	width: 100%;
}

.cmb-studio-formats__list {
	clear: both;
	display: grid;
	gap: var(--cmb-space-xs);
}

.cmb-studio-format__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.cmb-studio-format__label {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	align-items: center;
	gap: var(--cmb-space-s);
	padding: var(--cmb-space-s);
	background: var(--cmb-color-white);
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-l);
	cursor: pointer;
}

.cmb-studio-format__label:hover {
	border-color: var(--cmb-color-border-strong);
}

.cmb-studio-format__input:checked + .cmb-studio-format__label {
	background: var(--cmb-color-ivory);
	border-color: var(--cmb-color-accent-strong);
	box-shadow: inset 0 0 0 1px var(--cmb-color-accent-strong);
}

.cmb-studio-format__input:focus-visible + .cmb-studio-format__label {
	outline: 2px solid var(--cmb-color-focus);
	outline-offset: 2px;
}

.cmb-studio-format__visual {
	display: grid;
	place-items: center;
	padding: 0.5rem;
	background: var(--cmb-color-linen);
	border-radius: var(--cmb-radius-m);
}

.cmb-studio-format__visual img {
	display: block;
	width: 100%;
	height: auto;
	filter: drop-shadow(0 2px 4px rgb(24 22 20 / 0.12));
}

.cmb-studio-format__shape {
	display: block;
	width: 100%;
	background:
		linear-gradient(var(--cmb-color-white), var(--cmb-color-white)) padding-box,
		var(--cmb-color-border-strong);
	border: 1px solid transparent;
	box-shadow: 0 2px 4px rgb(24 22 20 / 0.1);
}

.cmb-studio-format__body {
	display: grid;
	gap: 0.15rem;
}

.cmb-studio-format__title {
	font-family: var(--cmb-font-heading);
	font-size: var(--cmb-text-lg);
	line-height: var(--cmb-leading-snug);
}

.cmb-studio-format__size {
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-xs);
	letter-spacing: var(--cmb-tracking-wide);
}

.cmb-studio-format__lines {
	display: grid;
	gap: 0.1rem;
	margin-top: 0.35rem;
	font-size: var(--cmb-text-sm);
	line-height: var(--cmb-leading-snug);
}

.cmb-studio-format__lines span::before {
	content: "·";
	margin-right: 0.45em;
	color: var(--cmb-color-accent);
	font-weight: var(--cmb-weight-semibold);
}

.cmb-studio-format__lines span:last-child {
	color: var(--cmb-color-accent-strong);
	font-weight: var(--cmb-weight-medium);
}

/* 8. Textes ------------------------------------------------------------------------------------ */

.cmb-studio-texts__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--cmb-space-xs);
	margin-bottom: var(--cmb-space-xs);
}

.cmb-studio-texts__head .cmb-studio-panel__count {
	margin: 0;
}

.cmb-studio-texts {
	display: grid;
	gap: 0.35rem;
	margin: 0 0 var(--cmb-space-s);
	padding: 0;
	list-style: none;
}

.cmb-studio-texts:empty {
	display: none;
}

.cmb-studio-texts__item {
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--cmb-space-xs);
	width: 100%;
	min-height: var(--cmb-tap-target);
	padding: 0.45rem 0.85rem;
	background: var(--cmb-color-white);
	color: var(--cmb-color-text);
	font: inherit;
	text-align: left;
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-m);
	cursor: pointer;
}

.cmb-studio-texts__item[aria-pressed="true"] {
	background: var(--cmb-color-ivory);
	border-color: var(--cmb-color-accent-strong);
	box-shadow: inset 0 0 0 1px var(--cmb-color-accent-strong);
}

/* Couleur de chaque texte, rappelée dans la liste (0.1.1). */
.cmb-studio-texts__color {
	width: 0.9rem;
	height: 0.9rem;
	border: 1px solid rgb(24 22 20 / 0.35);
	border-radius: 50%;
}

.cmb-studio-texts__num {
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-xs);
	font-weight: var(--cmb-weight-semibold);
	letter-spacing: var(--cmb-tracking-wide);
	text-transform: uppercase;
}

.cmb-studio-texts__excerpt {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cmb-studio-texts__flag {
	padding: 0.1rem 0.5rem;
	background: #f6e3de;
	color: var(--cmb-color-error);
	font-size: var(--cmb-text-xs);
	font-weight: var(--cmb-weight-semibold);
	border-radius: var(--cmb-radius-pill);
}

.cmb-studio-edit {
	margin-bottom: var(--cmb-space-s);
	padding: var(--cmb-space-s);
	background: var(--cmb-color-ivory);
	border-radius: var(--cmb-radius-m);
}

.cmb-studio-edit[hidden] {
	display: none;
}

/* 9. Photo ------------------------------------------------------------------------------------- */

.cmb-studio-photo__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--cmb-space-xs) var(--cmb-space-s);
	margin: var(--cmb-space-s) 0;
}

/* Champ fichier natif : invisible mais focalisable ; son libellé sert de bouton. */
.cmb-studio-file {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cmb-studio-file:focus-visible + label {
	outline: 2px solid var(--cmb-color-focus);
	outline-offset: 3px;
}

/* 10. Récapitulatif ---------------------------------------------------------------------------- */

.cmb-studio-summary {
	display: grid;
	gap: var(--cmb-space-m);
	margin-top: var(--cmb-space-l);
	padding: var(--cmb-space-m) var(--cmb-space-s);
	background: var(--cmb-color-surface);
	border: 1px solid var(--cmb-color-border);
	border-radius: var(--cmb-radius-l);
}

.cmb-studio-summary__title {
	margin-bottom: var(--cmb-space-s);
	font-size: var(--cmb-text-2xl);
}

.cmb-studio-summary dl {
	margin: 0;
}

.cmb-studio-summary dl div {
	display: flex;
	justify-content: space-between;
	gap: var(--cmb-space-s);
	padding-block: 0.45rem;
	border-bottom: 1px solid var(--cmb-color-border);
}

.cmb-studio-summary dt {
	color: var(--cmb-color-text-muted);
}

.cmb-studio-summary dd {
	margin: 0;
	font-weight: var(--cmb-weight-medium);
	text-align: right;
}

.cmb-studio-summary__notes {
	display: grid;
	gap: 0.35rem;
	margin: var(--cmb-space-s) 0 0;
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-sm);
	line-height: var(--cmb-leading-snug);
}

.cmb-studio-summary__side {
	display: grid;
	align-content: start;
	gap: var(--cmb-space-xs);
	padding: var(--cmb-space-s);
	background: var(--cmb-color-linen);
	border-radius: var(--cmb-radius-m);
}

.cmb-studio-summary__prices div:last-child {
	border-bottom: 0;
}

.cmb-studio-summary__total dt,
.cmb-studio-summary__total dd {
	color: var(--cmb-color-text);
	font-size: var(--cmb-text-lg);
	font-weight: var(--cmb-weight-semibold);
}

.cmb-studio-summary__state {
	margin: 0;
	font-size: var(--cmb-text-sm);
	line-height: var(--cmb-leading-snug);
}

.cmb-studio-summary[data-ready="true"] .cmb-studio-summary__state {
	color: var(--cmb-color-success);
	font-weight: var(--cmb-weight-semibold);
}

/* Ajout au panier (page 0.2.0) : inactif tant que la création n'est pas prête (lisible, focalisable),
   « Ajout en cours… » pendant l'envoi, confirmation ou erreur juste en dessous. */
.cmb-studio-summary__cart {
	width: 100%;
}

.cmb-studio-summary__cart[aria-disabled="true"],
.cmb-studio-summary__cart[aria-disabled="true"]:hover {
	background: var(--cmb-color-beige);
	color: var(--cmb-color-stone);
	cursor: not-allowed;
}

.cmb-studio-summary__cart[aria-busy="true"],
.cmb-studio-summary__cart[aria-busy="true"]:hover {
	cursor: progress;
}

.cmb-studio-summary__cart-error {
	margin: 0;
	color: var(--cmb-color-error);
	font-size: var(--cmb-text-sm);
	font-weight: var(--cmb-weight-semibold);
	text-align: center;
}

.cmb-studio-summary__added {
	display: grid;
	gap: var(--cmb-space-xs);
	padding: var(--cmb-space-s);
	border: 1px solid var(--cmb-color-success);
	border-radius: var(--cmb-radius-m);
	background: var(--cmb-color-white);
	text-align: center;
}

.cmb-studio-summary__added[hidden],
.cmb-studio-summary__cart-error[hidden] {
	display: none;
}

.cmb-studio-summary__added-text {
	margin: 0;
	color: var(--cmb-color-success);
	font-weight: var(--cmb-weight-semibold);
	overflow-wrap: anywhere;
}

.cmb-studio-summary__added-link {
	width: 100%;
}

.cmb-studio-summary__cart-note {
	margin: 0;
	color: var(--cmb-color-text-muted);
	font-size: var(--cmb-text-xs);
	text-align: center;
	transition: color var(--cmb-duration-base) var(--cmb-ease);
}

.cmb-studio-summary__cart-note[data-flash="true"] {
	color: var(--cmb-color-accent-strong);
	font-weight: var(--cmb-weight-semibold);
}

/* 11. Fenêtres (aperçu agrandi, confirmation) ------------------------------------------------- */

.cmb-studio-dialog {
	width: min(100% - 2rem, 56rem);
	max-height: calc(100dvh - 2rem);
	padding: var(--cmb-space-s) var(--cmb-space-s) var(--cmb-space-m);
	background: var(--cmb-color-ivory);
	color: var(--cmb-color-text);
	border: 0;
	border-radius: var(--cmb-radius-l);
	box-shadow: var(--cmb-shadow-l);
}

.cmb-studio-dialog::backdrop {
	background: rgb(24 22 20 / 0.55);
}

.cmb-studio-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--cmb-space-s);
	margin-bottom: var(--cmb-space-2xs);
}

.cmb-studio-dialog__title {
	margin: 0;
	font-size: var(--cmb-text-xl);
}

.cmb-studio-dialog__body {
	display: grid;
	place-items: center;
	padding: var(--cmb-space-s);
	background: var(--cmb-color-linen);
	border-radius: var(--cmb-radius-m);
}

.cmb-studio-dialog__canvas {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100dvh - 10rem);
	filter: drop-shadow(0 8px 18px rgb(24 22 20 / 0.16));
}

.cmb-studio-dialog--confirm {
	width: min(100% - 2rem, 30rem);
	padding: var(--cmb-space-m);
}

.cmb-studio-dialog--confirm .cmb-studio-dialog__title {
	margin-bottom: var(--cmb-space-xs);
}

.cmb-studio-dialog__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--cmb-space-xs);
	margin-top: var(--cmb-space-m);
}

/* 11 bis. Aides de l'aperçu (page 0.2.0) : guides de centrage, zone sûre du texte de l'arrondie.
   Calque de la PAGE au-dessus du canevas : jamais dans le fichier d'impression. ------------------- */

.cmb-studio-guides {
	position: absolute;
	inset: 0;
	pointer-events: none;
	container-type: inline-size;
}

.cmb-studio-guides__v,
.cmb-studio-guides__h {
	position: absolute;
	opacity: 0;
	transition: opacity 80ms linear;
}

.cmb-studio-guides__v {
	top: 0;
	bottom: 0;
	left: 50%;
	border-left: 1px solid #e0245e;
	transform: translateX(-0.5px);
}

.cmb-studio-guides__h {
	left: 0;
	right: 0;
	top: 50%;
	border-top: 1px solid #e0245e;
	transform: translateY(-0.5px);
}

.cmb-studio-guides[data-x="true"] .cmb-studio-guides__v,
.cmb-studio-guides[data-y="true"] .cmb-studio-guides__h {
	opacity: 1;
}

/* Zone sûre du TEXTE (arrondie) : trait fin pointillé, discret, en mode Texte seulement. */
.cmb-studio-guides__zone {
	position: absolute;
	box-sizing: border-box;
	border: 1px dashed rgb(43 111 214 / 0.55);
	border-radius: 2px;
	opacity: 0;
	transition: opacity 150ms linear;
}

.cmb-studio-guides[data-zone="true"] .cmb-studio-guides__zone {
	opacity: 1;
}

/* Libellé SOUS le bord bas de la zone (dans la marge de l'étiquette) : il ne masque jamais un texte. */
.cmb-studio-guides__zone-label {
	position: absolute;
	top: 100%;
	right: 0;
	padding: 0 0.35em;
	color: rgb(32 84 163);
	background: rgb(255 255 255 / 0.8);
	border-radius: 2px;
	font-size: 0.625rem;
	line-height: 1.35;
	white-space: nowrap;
}

/* Aperçu trop petit (clavier ouvert…) : le pointillé suffit. */
@container (max-width: 15rem) {
	.cmb-studio-guides__zone-label {
		display: none;
	}
}

/* 11 ter. Mobile et tablette (< 64em) : l'aperçu RESTE VISIBLE pendant les réglages ------------- */

@media (max-width: 63.99em) {
	/* Intro réduite une fois l'atelier prêt : l'étiquette est la vedette. */
	.cmb-studio-ready .cmb-studio-intro {
		padding-block: var(--cmb-space-s) var(--cmb-space-2xs);
	}

	.cmb-studio-ready .cmb-studio-intro__lead {
		display: none;
	}

	.cmb-studio-ready .cmb-studio-intro__title {
		margin-bottom: var(--cmb-space-3xs);
		font-size: clamp(1.4rem, 1.2rem + 1.2vw, 2rem);
	}

	.cmb-studio__app {
		gap: var(--cmb-space-s);
	}

	/* Aperçu collant sous l'en-tête (hauteur mesurée, barre d'administration comprise si fixe), pendant
	   l'ÉDITION (onglets Texte et Photo) : la liste des parfums et les étiquettes gardent tout l'écran. */
	[data-cmb-studio][data-tab="texte"] .cmb-studio__preview,
	[data-cmb-studio][data-tab="photo"] .cmb-studio__preview {
		position: sticky;
		top: var(--cmb-studio-sticky-top, calc(var(--cmb-header-height) + var(--cmb-admin-bar)));
		z-index: 20;
	}

	.cmb-studio__preview-card {
		padding: 0 var(--cmb-space-3xs) var(--cmb-space-3xs);
		box-shadow: 0 10px 18px -14px rgb(24 22 20 / 0.45);
	}

	.cmb-studio__preview-label {
		font-size: var(--cmb-text-xs);
	}

	/* Canevas borné par la hauteur VISIBLE (clavier compris) : il reste de la place pour les réglages. */
	.cmb-studio__surface {
		--cmb-studio-canvas-h: clamp(5.5rem, calc(var(--cmb-studio-vvh, 100svh) * 0.27), 17rem);
		max-width: min(36rem, calc(var(--cmb-studio-canvas-h) * var(--cmb-studio-ratio, 1.45) + 44px));
	}

	.cmb-studio__mode {
		margin-top: 0;
	}

	/* Libellé lu par les lecteurs d'écran, masqué à l'écran (le bouton se suffit). */
	.cmb-studio__mode-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.cmb-studio__preview-card > .cmb-studio__help {
		margin-top: 0.15rem;
		font-size: var(--cmb-text-xs);
	}

	/* Champ ou onglet atteint au clavier / par un bouton : jamais caché sous l'aperçu collant. */
	[data-cmb-studio]:is([data-tab="texte"], [data-tab="photo"]) .cmb-studio__controls :is(input, textarea, button, label),
	[data-cmb-studio]:is([data-tab="texte"], [data-tab="photo"]) .cmb-studio-tabs {
		scroll-margin-top: calc(var(--cmb-studio-sticky-top, 4.5rem) + var(--cmb-studio-preview-h, 0px) + 0.5rem);
		scroll-margin-bottom: 0.5rem;
	}

	/* Clavier virtuel ouvert sur un champ : aperçu compact (canevas seul). */
	[data-cmb-studio][data-keyboard="true"] .cmb-studio__preview-head,
	[data-cmb-studio][data-keyboard="true"] .cmb-studio__mode,
	[data-cmb-studio][data-keyboard="true"] .cmb-studio__preview-card > .cmb-studio__help {
		display: none;
	}

	[data-cmb-studio][data-keyboard="true"] .cmb-studio__surface {
		--cmb-studio-canvas-h: clamp(5rem, calc(var(--cmb-studio-vvh, 100svh) * 0.24), 10rem);
	}
}

/* 12. Tablette et bureau ----------------------------------------------------------------------- */

@media (min-width: 48em) {
	.cmb-studio-panel {
		padding: var(--cmb-space-m);
	}

	.cmb-studio-formats__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cmb-studio-format__label {
		grid-template-columns: minmax(0, 1fr);
		align-content: start;
		height: 100%;
	}

	.cmb-studio-format__visual {
		aspect-ratio: 16 / 10;
		padding: var(--cmb-space-s) var(--cmb-space-m);
	}

	.cmb-studio-format__visual img,
	.cmb-studio-format__shape {
		width: auto;
		max-width: 100%;
		max-height: 7rem;
	}

	.cmb-studio-format__shape {
		height: 6.2rem;
	}

	.cmb-studio-products__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-height: 25rem;
	}

	.cmb-studio-summary {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
		align-items: start;
		padding: var(--cmb-space-l);
	}
}

@media (min-width: 64em) {
	.cmb-studio-intro {
		padding-block: var(--cmb-space-xl) var(--cmb-space-l);
	}

	/* Contrôles à gauche (~60 %), aperçu à droite (~40 %), collant pendant l'édition. */
	.cmb-studio__app {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
		grid-template-areas: "controls preview";
		align-items: start;
		gap: var(--cmb-space-l);
	}

	.cmb-studio__controls {
		grid-area: controls;
	}

	.cmb-studio__preview {
		grid-area: preview;
		position: sticky;
		top: calc(var(--cmb-header-height) + var(--cmb-admin-bar) + var(--cmb-space-s));
	}

	.cmb-studio__preview-card {
		padding: var(--cmb-space-m);
	}

	.cmb-studio-products__list {
		max-height: min(30rem, 55vh);
	}
}

/* 13. Mouvement réduit ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.cmb-studio__status[data-state="loading"] .cmb-studio__status-title::before {
		animation: none;
	}

	.cmb-studio-choice,
	.cmb-studio-swatch__dot,
	.cmb-studio-summary__cart-note {
		transition: none;
	}
}
