/*
 * Front CST — UI autonome (indépendante du thème).
 * Tokens locaux ; zone .cst-app hors sidebar thème.
 */
:root {
	--cst-color-text: #1e1e1e;
	--cst-color-muted: #50575e;
	--cst-color-accent: #2271b1;
	--cst-color-surface: #ffffff;
	--cst-color-border: rgba(0, 0, 0, 0.1);
	--cst-max-width: 1200px;
}

html:has(body.cst-tables-front-page),
html:has([data-cst-front-root]),
html:has([data-cst-app]) {
	height: auto !important;
	max-height: none !important;
	overflow-x: hidden !important;
	overflow-y: scroll !important;
}

body.cst-tables-front-page,
body:has([data-cst-front-root]),
body:has([data-cst-app]) {
	height: auto !important;
	max-height: none !important;
	min-height: 0 !important;
	overflow-x: hidden !important;
	overflow-y: visible !important;
	position: static !important;
}

body.cst-tables-front-page.modal-open,
body:has([data-cst-front-root]).modal-open {
	overflow-y: visible !important;
	padding-right: 0 !important;
}

/* Shell plein largeur — hors colonnes / sidebars du thème */
.cst-app {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	clear: both;
	float: none;
}

.cst-app__inner {
	width: 100%;
	max-width: var(--cst-max-width);
	margin: 0 auto;
	padding: 1.25rem 1.25rem 3rem;
	box-sizing: border-box;
}

.cst-app__header {
	margin: 0 0 1rem;
}

.cst-app__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.5rem, 2.2vw, 2rem);
	line-height: 1.25;
	color: var(--cst-color-text);
}

.cst-app__content {
	min-width: 0;
}

.cst-app__content > *:first-child {
	margin-top: 0;
}

.cst-front-shell,
[data-cst-front-root] {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0 0 2rem;
	box-sizing: border-box;
	color: var(--cst-color-text);
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
	position: relative !important;
}

/* Contenir les tables CST ; ne pas écraser bordures/fonds (sinon > .cst-front-table th/td). */
.cst-app table.cst-gallery-fields,
.cst-app table.cst-front-table,
.cst-app table.cst-records-table,
.cst-app table.cst-detail-fields-table,
.cst-front-shell table.cst-gallery-fields,
.cst-front-shell table.cst-front-table,
.cst-front-shell table.cst-records-table,
.cst-front-shell table.cst-detail-fields-table {
	width: 100%;
	max-width: 100%;
	border-collapse: collapse;
	box-sizing: border-box;
}

/* Réaffirmer le style CST face aux règles thème (#left-area table, etc.). */
.cst-app .cst-front-table th,
.cst-app .cst-front-table td,
.cst-front-shell .cst-front-table th,
.cst-front-shell .cst-front-table td {
	border: 1px solid var(--cst-color-border);
	padding: 0.55rem 0.65rem;
	text-align: left;
	vertical-align: middle;
	background: var(--cst-color-surface);
}

.cst-app .cst-front-form-table th[scope="row"],
.cst-app .cst-front-form-table .cst-col-label,
.cst-front-shell .cst-front-form-table th[scope="row"],
.cst-front-shell .cst-front-form-table .cst-col-label {
	font-weight: 600;
	background: rgba(0, 0, 0, 0.03);
}

.cst-app .cst-front-table thead th,
.cst-front-shell .cst-front-table thead th {
	background: rgba(0, 0, 0, 0.04);
	font-weight: 600;
}

.cst-front-nav {
	margin-bottom: 1rem;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.cst-front-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	list-style: none;
	margin: 0;
	padding: 0.5rem 0 0.85rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.cst-front-menu > li {
	flex: 0 1 auto;
	max-width: 100%;
}

.cst-front-menu a {
	text-decoration: none;
	font-weight: 600;
}

.cst-front-menu .current-menu-item > a,
.cst-front-menu a:hover {
	color: var(--cst-color-accent);
}

.cst-front-header {
	margin: 0 0 0.5rem;
}

.cst-table-comment {
	margin: 0 0 1.25rem;
}

.cst-table-comment-body {
	margin: 0 0 0.75rem;
	line-height: 1.55;
}

.cst-table-comment-body p:last-child {
	margin-bottom: 0;
}

/* Liens du commentaire : soulignés, surbrillance au survol, nouvel onglet (target en HTML). */
.cst-table-comment-body a {
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1.5px;
	font-weight: 600;
	color: var(--cst-color-accent);
	border-radius: 2px;
	padding: 0 0.1em;
	transition:
		color 0.15s ease,
		background-color 0.15s ease,
		filter 0.15s ease,
		text-shadow 0.15s ease,
		box-shadow 0.15s ease;
}

.cst-table-comment-body a:hover,
.cst-table-comment-body a:focus-visible {
	filter: brightness(1.45);
	background-color: rgba(255, 236, 80, 0.55);
	text-shadow:
		0 0 0.2em rgba(255, 255, 220, 0.95),
		0 0 0.55em rgba(255, 240, 120, 0.85);
	box-shadow: 0 0 0 2px rgba(255, 236, 80, 0.35);
	outline: none;
}

.cst-table-comment-edit {
	margin: 0.5rem 0 0;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	padding: 0.35rem 0.85rem 0.85rem;
	background: rgba(0, 0, 0, 0.02);
}

.cst-table-comment-edit > summary {
	cursor: pointer;
	font-weight: 600;
	padding: 0.45rem 0;
	list-style-position: outside;
}

.cst-front-comment-form {
	margin-top: 0.5rem;
}

.cst-front-comment-form .wp-editor-wrap {
	margin-bottom: 0.75rem;
}

/*
 * Barre éditeur + mise en forme : défilent avec la page et disparaissent
 * derrière l’entête sticky (pas de barre collante au viewport).
 */
.cst-front-shell .wp-editor-wrap,
.cst-front-shell .wp-editor-wrap .wp-editor-tools,
.cst-front-shell .wp-editor-wrap .wp-editor-container,
.cst-front-shell .wp-editor-wrap .mce-tinymce,
.cst-front-shell .wp-editor-wrap .mce-toolbar-grp,
.cst-front-shell .wp-editor-wrap .mce-toolbar,
.cst-front-shell .wp-editor-wrap .mce-stack-layout,
.cst-front-shell .wp-editor-wrap .quicktags-toolbar,
.cst-front-shell .wp-editor-wrap .mce-top-part,
.cst-front-shell .wp-editor-wrap .mce-container,
.cst-front-shell .wp-editor-wrap .mce-panel {
	position: static !important;
	top: auto !important;
	bottom: auto !important;
	z-index: 0 !important;
}

/* L’entête doit couvrir l’éditeur au scroll. */
body.cst-tables-front-page #masthead,
body.cst-tables-front-page #masthead.element-is-sticky,
body:has([data-cst-front-root]) #masthead,
body:has([data-cst-front-root]) #masthead.element-is-sticky {
	z-index: 200 !important;
	background-color: var(--cst-color-surface);
}

.cst-front-shell .wp-editor-wrap .mce-floatpanel,
.cst-front-shell .wp-editor-wrap .mce-menu,
.cst-front-shell .wp-editor-wrap .mce-popover {
	z-index: 100050 !important;
}

.cst-front-header .cst-page-title,
.cst-front-header h1 {
	margin: 0;
	font-size: 1.75rem;
	line-height: 1.25;
}

.cst-form-panel {
	margin: 0 0 1rem;
}

.cst-form-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3rem 0.45rem;
	margin: 0 0 0.5rem;
}

.cst-readonly-select-toolbar {
	margin: 0 0 0.75rem;
}

.cst-form-panel-body {
	margin: 0;
}

.cst-form-panel-body[hidden] {
	display: none !important;
}

.cst-form-mode-banner {
	margin: 0 0 0.85rem;
	padding: 0.55rem 0.75rem;
	font-weight: 600;
	font-size: 0.95em;
	border-left: 4px solid #3182ce;
	background: #ebf8ff;
}

.cst-form-mode-banner.cst-form-mode-new {
	border-left-color: #38a169;
	background: #f0fff4;
}

.cst-form-mode-banner.cst-form-mode-edit {
	border-left-color: #dd6b20;
	background: #fffaf0;
}

.cst-front-form-below-title {
	margin: 0 0 1.5rem;
}

.cst-front-actions-top {
	margin: 0 0 1rem;
}

.cst-front-actions-bottom {
	margin: 1rem 0 0;
}

.cst-select-range,
.cst-select-date-range {
	display: flex;
	flex-wrap: nowrap;
	flex-direction: row;
	gap: 0.75rem 1.25rem;
	align-items: center;
}

.cst-select-range-bound,
.cst-select-date-bound {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.4rem;
	font-weight: 500;
	font-size: 0.9em;
	white-space: nowrap;
}

.cst-select-range-bound input[type="date"],
.cst-select-date-bound input[type="date"] {
	width: 10.5rem;
	min-width: 10.5rem;
}

.cst-select-range-bound input[type="number"] {
	width: 7.5rem;
	min-width: 6rem;
}

.cst-front-data-below {
	margin-top: 0.25rem;
}

.cst-front-table-wrap {
	overflow-x: auto;
}

.cst-front-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--cst-color-surface);
}

.cst-front-table th,
.cst-front-table td {
	border: 1px solid rgba(0, 0, 0, 0.1);
	padding: 0.55rem 0.65rem;
	text-align: left;
	vertical-align: middle;
}

.cst-front-table thead th {
	background: rgba(0, 0, 0, 0.04);
	font-weight: 600;
}

.cst-front-form-table {
	margin-bottom: 0.75rem;
	font-size: 0.875rem; /* libellés + champs plus petits que le reste de la page */
}

.cst-field-separator-row > td {
	padding: 0.2rem 0.65rem;
	background: rgba(0, 0, 0, 0.05);
	border-top: none;
	vertical-align: middle;
}

.cst-field-separator {
	margin: 0;
	padding: 0;
	border-top: none;
}

.cst-field-separator-title {
	margin: 0;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.25;
	color: var(--cst-color-text);
}

.cst-field-separator-text {
	margin: 0.1rem 0 0;
	font-size: 0.9em;
	line-height: 1.25;
	color: var(--cst-color-muted);
}

.cst-row-audit-form {
	margin: 1.25rem 0 1.5rem;
	padding: 0.85rem 1rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.02);
}

.cst-row-audit-title {
	margin: 0 0 0.65rem;
	font-size: 1rem;
	font-weight: 600;
}

.cst-row-audit-table {
	margin-bottom: 0;
}

.cst-row-audit-value {
	color: var(--cst-color-muted);
}

.cst-detail-audit {
	margin-top: 0.75rem;
	padding: 0.45rem 0.65rem 0.35rem;
	border-top: none;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.045);
}

.cst-detail-audit-row {
	border-top-color: rgba(0, 0, 0, 0.06);
}

.cst-detail-audit-row:first-child {
	border-top: none;
	padding-top: 0.2rem;
}

.cst-detail-audit-row:last-child {
	padding-bottom: 0.2rem;
}

.cst-detail-audit-row .cst-detail-label,
.cst-detail-audit-row .cst-detail-value {
	font-size: 0.9rem;
	color: var(--cst-color-muted);
}

.cst-front-form-table .cst-col-label,
.cst-front-form-table th[scope="row"] {
	width: 28%;
	min-width: 8rem;
	font-weight: 600;
	background: rgba(0, 0, 0, 0.03);
}

.cst-front-form-table th[scope="row"] label {
	font-size: inherit;
	font-family: inherit;
	font-weight: inherit;
}

.cst-front-form-table input[type="text"],
.cst-front-form-table input[type="email"],
.cst-front-form-table input[type="url"],
.cst-front-form-table input[type="number"],
.cst-front-form-table input[type="date"],
.cst-front-form-table input[type="datetime-local"],
.cst-front-form-table select,
.cst-front-form-table textarea,
.cst-front-form-table .cst-fixed-field-value,
.cst-front-form-table .cst-front-check {
	width: 100%;
	max-width: 100%;
	padding: 0.45rem 0.6rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 3px;
	background: #fff;
	box-sizing: border-box;
	font-size: inherit;
	font-family: inherit;
	line-height: inherit;
}

.cst-front-form-table .cst-fixed-field-value,
.cst-front-form-table .cst-front-check {
	width: auto;
	max-width: none;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
}

/* Date : texte jj/mm/aaaa + icône ; input natif transparent sur l’icône (calendrier sans virgule OS). */
.cst-date-wrap {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: 16rem;
}

.cst-date-wrap--datetime {
	max-width: 18rem;
}

.cst-date-wrap .cst-date-text {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	padding-right: 2.4rem;
}

.cst-date-picker-hit {
	position: absolute;
	right: 0;
	top: 0;
	width: 2.4rem;
	height: 100%;
	min-height: 2rem;
	z-index: 3;
}

.cst-date-picker-btn {
	position: absolute;
	inset: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 3px;
	background: transparent;
	color: rgba(0, 0, 0, 0.55);
	cursor: pointer;
	pointer-events: auto;
	z-index: 3;
}

.cst-date-picker-btn:hover,
.cst-date-picker-btn:focus-visible {
	color: rgba(0, 0, 0, 0.85);
}

/* Input natif conservé hors écran (sync / accessibilité) — le popover sert au choix. */
.cst-date-wrap .cst-date-native {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

/* Popover : champs date/heure VISIBLES (fiable sous Firefox, contrairement à l’overlay). */
.cst-date-popover {
	position: absolute;
	right: 0;
	top: calc(100% + 0.35rem);
	z-index: 40;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	min-width: 12rem;
	padding: 0.55rem 0.65rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.cst-date-popover[hidden] {
	display: none !important;
}

.cst-date-popover input[type="date"],
.cst-date-popover input[type="time"] {
	margin: 0;
	padding: 0.25rem 0.35rem;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	font: inherit;
	line-height: 1.3;
	color: inherit;
	background: #fff;
}

.cst-date-popover input[type="date"] {
	flex: 1 1 auto;
	min-width: 9.5rem;
}

.cst-date-popover input[type="time"] {
	flex: 0 0 auto;
	width: 7rem;
}

.cst-date-pop-apply,
.cst-date-pop-clear {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.28rem 0.7rem;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	background: #f3f3f3;
	cursor: pointer;
	font: inherit;
}

.cst-date-pop-apply:hover,
.cst-date-pop-clear:hover {
	background: #e8e8e8;
}

.cst-date-pop-clear {
	color: #6d2c2c;
}

.cst-select-date-range .cst-date-wrap {
	max-width: none;
}

.cst-req {
	color: #b32d2e;
}

/* Pastille couleur (codes.COD_PARAM1 = fond/texte) */
.cst-code-badge {
	display: inline-block;
	padding: 0.12rem 0.45rem;
	border-radius: 3px;
	font-size: 0.9em;
	line-height: 1.35;
	white-space: nowrap;
	vertical-align: baseline;
}

select.cst-liste-code-styled {
	font-weight: 600;
	border-color: transparent;
}

.cst-field-hint {
	margin: 0.35rem 0 0;
	color: #646970;
	font-size: 0.85rem;
	font-weight: 400;
	line-height: 1.35;
}

.cst-age-preview {
	display: block;
	margin: 0.25rem 0 0;
	color: #1d2327;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.35;
}

.cst-age-preview[hidden] {
	display: none;
}

.cst-select-age-range .cst-select-range-bound .cst-age-preview {
	margin-top: 0.2rem;
	font-weight: 500;
}

.cst-field-required-hint {
	margin: 0.4rem 0 0;
	color: #b32d2e;
	font-size: 0.9rem;
	font-weight: 600;
}

.cst-field-name-row input[aria-invalid="true"],
.cst-field-name-row textarea[aria-invalid="true"] {
	border-color: #d63638;
	box-shadow: 0 0 0 1px #d63638;
}

.cst-front-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.45rem;
	margin: 0.75rem 0 0;
}

.cst-front-filter-active {
	margin: 1rem 0 0.35rem;
	font-size: 0.95rem;
}

/*
 * Bouton « Effacer la sélection » : gabarit cst-front-btn + couleurs
 * de l’item Mega Menu sélectionné (fallback CST : fond blanc, texte #e16e13).
 */
[data-cst-front-root] .cst-front-btn.cst-front-clear-select,
.cst-front-shell .cst-front-btn.cst-front-clear-select,
.cst-front-btn.cst-front-clear-select {
	background-color: var(--cst-menu-current-bg, #fff);
	color: var(--cst-menu-current-fg, #e16e13);
	border-color: var(--cst-menu-current-fg, #e16e13);
	font-weight: 600;
	text-decoration: none;
}

[data-cst-front-root] .cst-front-btn.cst-front-clear-select:hover,
[data-cst-front-root] .cst-front-btn.cst-front-clear-select:focus,
.cst-front-shell .cst-front-btn.cst-front-clear-select:hover,
.cst-front-shell .cst-front-btn.cst-front-clear-select:focus,
.cst-front-btn.cst-front-clear-select:hover,
.cst-front-btn.cst-front-clear-select:focus {
	background-color: var(--cst-menu-current-bg, #fff);
	color: var(--cst-menu-current-fg, #e16e13);
	border-color: var(--cst-menu-current-fg, #e16e13);
	filter: brightness(0.96);
	text-decoration: none;
}

.cst-select-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: min(44rem, calc(100vw - 2rem));
	width: 100%;
	background: var(--cst-color-surface);
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cst-select-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cst-select-dialog-inner,
.cst-multi-dialog-inner {
	display: flex;
	flex-direction: column;
	padding: 0;
	max-height: min(80vh, 40rem);
	overflow: hidden;
}

.cst-dialog-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 0.75rem;
	flex: 0 0 auto;
	padding: 0.85rem 1.1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	background: var(--cst-color-surface);
	position: sticky;
	top: 0;
	z-index: 2;
}

.cst-dialog-head h2 {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.3;
	flex: 1 1 10rem;
	min-width: 0;
}

.cst-dialog-head-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.35rem;
	flex: 0 0 auto;
}

.cst-dialog-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 0.85rem 1.1rem 1.15rem;
}

.cst-select-fields-table {
	margin: 0.75rem 0 0;
}

.cst-select-fields-table th {
	width: 38%;
	vertical-align: middle;
}

.cst-by-year-dialog {
	max-width: min(28rem, calc(100vw - 2rem));
}

.cst-by-year-dialog-inner {
	align-items: center;
	text-align: center;
	padding: 1.1rem 1.25rem 1.35rem;
	overflow: auto;
	max-height: min(80vh, 40rem);
}

.cst-by-year-dialog-title {
	margin: 0 0 0.45rem;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.3;
}

.cst-by-year-dialog-lead {
	margin: 0 0 0.85rem;
	max-width: 24rem;
}

.cst-by-year-table-wrap {
	width: 100%;
	max-width: 22rem;
	margin: 0 auto;
}

.cst-by-year-table {
	margin: 0 auto;
	width: 100%;
}

.cst-by-year-table th,
.cst-by-year-table td {
	text-align: center;
}

.cst-by-year-table .cst-num {
	text-align: center;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cst-by-year-table tfoot th,
.cst-by-year-table tfoot td {
	font-weight: 600;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	padding-top: 0.55rem;
}

.cst-by-year-dialog-actions {
	justify-content: center;
	margin: 1rem 0 0;
	padding-bottom: 0.35rem;
}

/* Boutons front : compacts / discrets (même taille partout) */
[data-cst-front-root] .cst-front-btn,
.cst-front-shell .cst-front-btn,
.cst-front-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.18rem 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.35;
	font-weight: 500;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 2px;
	background: transparent;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	box-shadow: none;
}

[data-cst-front-root] .cst-front-btn:hover,
[data-cst-front-root] .cst-front-btn:focus,
.cst-front-shell .cst-front-btn:hover,
.cst-front-shell .cst-front-btn:focus,
.cst-front-btn:hover,
.cst-front-btn:focus {
	background: rgba(0, 0, 0, 0.04);
	border-color: rgba(0, 0, 0, 0.22);
	color: inherit;
}

[data-cst-front-root] .cst-front-btn-primary,
.cst-front-shell .cst-front-btn-primary,
.cst-front-btn-primary {
	background: transparent;
	border-color: rgba(0, 0, 0, 0.22);
	color: inherit;
	font-weight: 600;
}

[data-cst-front-root] .cst-front-btn-primary:hover,
[data-cst-front-root] .cst-front-btn-primary:focus,
.cst-front-shell .cst-front-btn-primary:hover,
.cst-front-shell .cst-front-btn-primary:focus,
.cst-front-btn-primary:hover,
.cst-front-btn-primary:focus {
	background: rgba(0, 0, 0, 0.05);
	border-color: rgba(0, 0, 0, 0.28);
	color: inherit;
}

.cst-front-btn-quiet {
	font-weight: 400;
}

.cst-front-notice {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border-radius: 3px;
}

.cst-front-info {
	background: #e8f1fa;
	border: 1px solid #9ec2e6;
	color: #1d3a5c;
}

.cst-code-offer-msg {
	margin: 0 0 0.65rem;
	font-weight: 600;
}

.cst-code-offer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
}

.cst-front-success {
	background: #edfaef;
	border: 1px solid #68de7c;
}

.cst-front-error {
	background: #fcf0f1;
	border: 1px solid #d63638;
}

.cst-front-empty {
	margin: 1rem 0;
}

.cst-front-row-actions {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	white-space: nowrap;
}

.cst-inline-form {
	display: inline-flex;
	margin: 0;
}

/* Contre Bootstrap / Attire : a et button.cst-action-btn doivent être identiques. */
[data-cst-front-root] a.cst-action-btn,
[data-cst-front-root] button.cst-action-btn,
.cst-front-shell a.cst-action-btn,
.cst-front-shell button.cst-action-btn,
.cst-gallery-actions a.cst-action-btn,
.cst-gallery-actions button.cst-action-btn,
.cst-front-row-actions a.cst-action-btn,
.cst-front-row-actions button.cst-action-btn,
a.cst-action-btn,
button.cst-action-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 1.7rem !important;
	height: 1.7rem !important;
	min-width: 1.7rem !important;
	min-height: 1.7rem !important;
	max-width: 1.7rem !important;
	max-height: 1.7rem !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 1px solid rgba(0, 0, 0, 0.18) !important;
	border-radius: 3px !important;
	background: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	color: inherit !important;
	font-family: inherit !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	vertical-align: middle !important;
	cursor: pointer !important;
	box-sizing: border-box !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

a.cst-action-btn svg,
button.cst-action-btn svg,
.cst-action-btn svg {
	display: block;
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	pointer-events: none;
}

[data-cst-front-root] a.cst-action-btn:hover,
[data-cst-front-root] a.cst-action-btn:focus,
[data-cst-front-root] button.cst-action-btn:hover,
[data-cst-front-root] button.cst-action-btn:focus,
.cst-front-shell a.cst-action-btn:hover,
.cst-front-shell a.cst-action-btn:focus,
.cst-front-shell button.cst-action-btn:hover,
.cst-front-shell button.cst-action-btn:focus,
a.cst-action-btn:hover,
a.cst-action-btn:focus,
button.cst-action-btn:hover,
button.cst-action-btn:focus {
	border-color: var(--cst-color-accent) !important;
	color: var(--cst-color-accent) !important;
	background: #f6f7f7 !important;
}

[data-cst-front-root] a.cst-action-delete,
[data-cst-front-root] button.cst-action-delete,
.cst-front-shell a.cst-action-delete,
.cst-front-shell button.cst-action-delete,
.cst-gallery-actions a.cst-action-delete,
.cst-gallery-actions button.cst-action-delete,
a.cst-action-btn.cst-action-delete,
button.cst-action-btn.cst-action-delete {
	color: #b32d2e !important;
}

[data-cst-front-root] a.cst-action-delete:hover,
[data-cst-front-root] a.cst-action-delete:focus,
[data-cst-front-root] button.cst-action-delete:hover,
[data-cst-front-root] button.cst-action-delete:focus,
.cst-front-shell a.cst-action-delete:hover,
.cst-front-shell a.cst-action-delete:focus,
.cst-front-shell button.cst-action-delete:hover,
.cst-front-shell button.cst-action-delete:focus,
a.cst-action-btn.cst-action-delete:hover,
a.cst-action-btn.cst-action-delete:focus,
button.cst-action-btn.cst-action-delete:hover,
button.cst-action-btn.cst-action-delete:focus {
	border-color: #b32d2e !important;
	color: #b32d2e !important;
	background: #fcf0f1 !important;
}

.cst-front-media {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.cst-front-media-preview img {
	display: block;
	max-width: 72px;
	height: auto;
	border-radius: 3px;
}

.cst-front-video-preview,
.cst-detail-video {
	width: 100%;
	max-width: 28rem;
}

.cst-detail-videos {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.cst-front-video-preview video,
.cst-detail-video video {
	display: block;
	width: 100%;
	max-height: 16rem;
	border-radius: 4px;
	background: #111;
}

.cst-front-media--video {
	align-items: flex-start;
	flex-direction: column;
}

.cst-media-slot__frame--video {
	position: relative;
	background: #111;
}

.cst-media-slot__frame--video video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cst-media-slot__play,
.cst-detail-thumb__play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 1.35rem;
	height: 1.35rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 0.65rem;
	line-height: 1.35rem;
	text-align: center;
	pointer-events: none;
}

/*
 * Médiathèque WP ouverte en front : le thème (Attire / Astra / etc.)
 * force souvent color:#fff sur button — onglet « Téléverser » illisible.
 */
.media-modal.wp-core-ui {
	color: #1d2327;
}

.media-modal.wp-core-ui .media-frame,
.media-modal.wp-core-ui .media-frame a,
.media-modal.wp-core-ui .media-frame button:not(.button-primary):not(.media-button-select) {
	color: #1d2327;
}

.media-modal.wp-core-ui .media-router .media-menu-item {
	color: #2271b1 !important;
	background: transparent !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

.media-modal.wp-core-ui .media-router .media-menu-item:hover {
	color: #135e96 !important;
}

.media-modal.wp-core-ui .media-router .media-menu-item.active {
	color: #1d2327 !important;
	border-bottom-color: #1d2327;
}

.media-modal.wp-core-ui .media-frame .button-primary,
.media-modal.wp-core-ui .media-button-select {
	color: #fff !important;
	background: #2271b1 !important;
	border-color: #2271b1 !important;
	text-shadow: none !important;
}

.media-modal.wp-core-ui .uploader-inline,
.media-modal.wp-core-ui .upload-ui,
.media-modal.wp-core-ui .upload-ui h2,
.media-modal.wp-core-ui .upload-ui h3,
.media-modal.wp-core-ui .upload-instructions {
	color: #1d2327 !important;
}

.cst-media-multi__slots {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	align-items: flex-start;
}

.cst-media-slot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	width: 5.5rem;
}

.cst-media-slot__frame {
	width: 5.5rem;
	height: 5.5rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 4px;
	background: #f3f3f3;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cst-media-slot__frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cst-media-slot__empty {
	color: #888;
	font-size: 1.4rem;
	line-height: 1;
	user-select: none;
}

.cst-media-slot__actions {
	display: flex;
	gap: 0.25rem;
}

.cst-media-multi__hint {
	margin: 0.35rem 0 0;
}

.cst-list-inline-input {
	width: 12rem;
	max-width: 40vw;
	padding: 0.35rem 0.5rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 3px;
}

.cst-list-edit-form {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.cst-multi-picker {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	max-width: 100%;
}

.cst-multi-summary-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.5rem 0.75rem;
}

.cst-multi-summary {
	margin: 0;
	flex: 1 1 12rem;
	min-width: 0;
	line-height: 1.35;
}

.cst-multi-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: min(28rem, calc(100vw - 2rem));
	width: 100%;
	background: var(--cst-color-surface);
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cst-multi-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cst-multi-dialog-inner {
	max-height: min(80vh, 36rem);
}

.cst-multi-dialog-lead {
	margin: 0 0 0.5rem;
}

.cst-multi-custom-add {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
}

.cst-multi-custom-input {
	flex: 1 1 10rem;
	min-width: 0;
	max-width: 100%;
}

.cst-table-values-hint {
	margin: 0.35rem 0 0;
	font-size: 0.9em;
	opacity: 0.85;
}

.cst-table-values-picker {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	max-width: 100%;
}

.cst-table-values-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
}

.cst-table-values-text {
	flex: 1 1 14rem;
	min-width: 0;
	max-width: 100%;
}

.cst-liste-code-picker {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	max-width: 100%;
}

.cst-liste-code-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
}

.cst-liste-code-row select {
	flex: 1 1 12rem;
	min-width: 0;
	max-width: 100%;
}

.cst-liste-code-new-label {
	display: block;
	margin: 0 0 0.35rem;
	font-weight: 600;
}

.cst-liste-code-new-input {
	width: 100%;
	max-width: 100%;
}

.cst-multi-selected-count {
	margin: 0 0 0.65rem;
	font-size: 0.9em;
	font-weight: 600;
}

.cst-multi-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-height: 12rem;
}

.cst-multi-item-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0;
	cursor: pointer;
	line-height: 1.35;
}

.cst-multi-item-label input {
	margin-top: 0.2rem;
	flex-shrink: 0;
}

.cst-multi-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin: 0.85rem 0 0.25rem;
}

.cst-multi-page-info {
	font-size: 0.9em;
}

.cst-ref-picker {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	max-width: 100%;
}

.cst-ref-search-label {
	display: block;
	margin: 0 0 0.65rem;
}

.cst-ref-search {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.45rem 0.6rem;
	font: inherit;
}

.cst-ref-option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2rem;
	width: 100%;
	text-align: left;
	padding: 0.45rem 0.55rem;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	font: inherit;
	color: inherit;
	cursor: pointer;
	line-height: 1.35;
}

.cst-ref-option-label {
	display: block;
	font-weight: inherit;
}

.cst-ref-option-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.65rem;
	font-size: 0.85em;
	opacity: 0.75;
	font-weight: 400;
}

.cst-ref-option-meta-item {
	display: inline-block;
}

.cst-ref-option:hover,
.cst-ref-option:focus {
	background: rgba(0, 0, 0, 0.06);
	outline: none;
}

.cst-ref-option.is-selected {
	border-color: currentColor;
	font-weight: 600;
}

.cst-ref-option.is-selected .cst-ref-option-meta {
	font-weight: 400;
}

.cst-front-check {
	font-weight: 400;
}

.cst-front-prix-wrap {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	max-width: 100%;
	font-weight: 400;
}

.cst-front-prix-wrap input[type="number"] {
	width: 10rem;
	max-width: calc(100% - 1.5rem);
}

.cst-front-prix-currency {
	font-weight: 700;
	color: var(--cst-color-muted);
}

/* Barre liste : compteur à gauche, lignes/page à droite. */
.cst-list-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	margin: 0.25rem 0 0.75rem;
}

.cst-list-toolbar-count {
	margin: 0;
	font-size: 0.95rem;
	color: var(--cst-color-muted);
}

.cst-front-fixed-filter {
	margin: 0.35rem 0 0.75rem;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--cst-color-muted);
}

.cst-field-readonly-row input[readonly],
.cst-field-readonly-row textarea[readonly] {
	background: rgba(0, 0, 0, 0.04);
	color: inherit;
	cursor: default;
}

.cst-field-label-wrap {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.cst-field-help-q {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.35rem;
	height: 1.35rem;
	padding: 0;
	/* Couleurs fixes : ne pas hériter du thème (live souvent blanc sur fond sombre). */
	color: #111;
	border: 2px solid #111;
	border-radius: 3px;
	background: transparent;
	font: inherit;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
}

.cst-field-help-q:hover,
.cst-field-help-q:focus {
	color: #e6b800;
	border-color: #e6b800;
	background: rgba(230, 184, 0, 0.12);
	outline: none;
}

.cst-field-help-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: min(40rem, calc(100vw - 2rem));
	width: 100%;
	background: #fff;
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cst-field-help-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cst-field-help-dialog-inner {
	position: relative;
	padding: 1.25rem 1.35rem 1.1rem;
}

.cst-field-help-view {
	margin: 0.75rem 0;
	line-height: 1.5;
	max-height: min(50vh, 28rem);
	overflow: auto;
}

.cst-field-help-textarea {
	width: 100%;
	min-height: 10rem;
}

.cst-field-help-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.cst-field-help-status {
	font-size: 0.85em;
	opacity: 0.8;
}

.cst-fixed-field-value {
	margin: 0;
	font-weight: 600;
}

.cst-list-toolbar-controls {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin: 0 0 0 auto;
}

.cst-per-page-form,
.cst-year-form {
	margin: 0;
}

.cst-per-page-label,
.cst-year-label {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
}

.cst-per-page-select,
.cst-year-select {
	min-width: 4.5rem;
	padding: 0.3rem 0.45rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 3px;
	background: #fff;
	font: inherit;
}

.cst-year-select {
	min-width: 5.5rem;
}

/* Pagination sous la liste. */
.cst-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	margin: 0.25rem 0 1.5rem;
	padding-top: 0.35rem;
}

.cst-pagination-info {
	margin: 0;
	font-size: 0.9rem;
	color: var(--cst-color-muted);
}

/* Divi : .entry-content ul { list-style-type: disc } — neutraliser explicitement. */
.cst-app .entry-content ul.cst-pagination-list,
.cst-app ul.cst-pagination-list,
.cst-front-shell ul.cst-pagination-list,
ul.cst-pagination-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	list-style: none !important;
	list-style-type: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.cst-app .entry-content ul.cst-pagination-list > li,
.cst-app ul.cst-pagination-list > li,
.cst-front-shell ul.cst-pagination-list > li,
ul.cst-pagination-list > li {
	display: block;
	list-style: none !important;
	list-style-type: none !important;
	margin: 0;
	padding: 0;
}

.cst-app ul.cst-pagination-list > li::marker,
ul.cst-pagination-list > li::marker,
.cst-app ul.cst-pagination-list > li::before,
ul.cst-pagination-list > li::before {
	content: none !important;
	display: none !important;
}

.cst-pagination-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.1rem;
	padding: 0.35rem 0.55rem;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 3px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9rem;
	color: inherit;
	background: #fff;
	box-sizing: border-box;
}

a.cst-pagination-link:hover,
a.cst-pagination-link:focus {
	border-color: rgba(0, 0, 0, 0.35);
	outline: none;
}

.cst-pagination-link.is-current {
	background: var(--cst-color-accent);
	border-color: var(--cst-color-accent);
	color: #fff;
}

.cst-pagination-link.is-disabled {
	opacity: 0.45;
	cursor: default;
}

.cst-pagination-ellipsis {
	padding: 0 0.25rem;
	color: #888;
}

/* Tableau (tables sans champ image) : une ligne par cellule, largeur selon le contenu. */
.cst-records-table-wrap {
	overflow-x: auto;
	margin: 0.75rem 0 1rem;
}

.cst-records-table {
	width: max-content;
	max-width: none;
	min-width: 0;
	table-layout: auto;
	/* separate requis pour position:sticky sur la colonne Actions. */
	border-collapse: separate;
	border-spacing: 0;
	background: var(--cst-color-surface);
	font-size: 0.82rem;
}

.cst-records-table th,
.cst-records-table td {
	padding: 0.35rem 0.5rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	text-align: left;
	vertical-align: middle;
	font-size: inherit;
	white-space: nowrap;
	width: 1%;
}

.cst-records-table thead th {
	font-weight: 600;
	border-bottom-width: 2px;
}

.cst-records-table tbody tr:hover {
	background: rgba(0, 0, 0, 0.03);
}

/* Colonne Actions fixe à gauche ; les infos défilent à droite. */
.cst-records-table th.cst-records-table-actions-col,
.cst-records-table td.cst-records-table-actions-col {
	position: sticky;
	left: 0;
	z-index: 2;
	background: var(--cst-color-surface);
	box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.18);
}

.cst-records-table thead th.cst-records-table-actions-col {
	z-index: 3;
	background: #f3f3f3;
}

.cst-records-table tbody tr:hover td.cst-records-table-actions-col {
	background: #f7f7f7;
}

.cst-records-table-name {
	font-weight: 600;
}

.cst-records-table-link {
	display: inline;
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	color: var(--cst-color-accent);
	font: inherit;
	font-weight: 600;
	text-align: left;
	text-decoration: underline;
	text-underline-offset: 0.12em;
	cursor: pointer;
}

.cst-records-table-link:hover,
.cst-records-table-link:focus-visible {
	color: inherit;
	outline: none;
}

.cst-detail-value .cst-detail-ref-link {
	font-weight: 600;
}

.cst-detail-ref-sep {
	color: inherit;
}

.cst-records-amount-link {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cst-donations-dialog,
.cst-related-list-dialog {
	max-width: min(52rem, calc(100vw - 2rem));
}

.cst-donations-dialog-total {
	margin: 0 0 0.85rem;
	font-weight: 600;
}

.cst-donations-dialog-table-wrap {
	overflow-x: auto;
	max-height: min(50vh, 24rem);
	margin: 0 0 0.25rem;
}

.cst-donations-dialog-table {
	margin: 0;
	font-size: 0.92em;
}

.cst-donations-dialog-table th,
.cst-donations-dialog-table td {
	padding: 0.35rem 0.5rem;
	white-space: nowrap;
}

.cst-records-table-actions-col {
	width: 1%;
	white-space: nowrap;
	text-align: center;
}

.cst-records-table-actions-col .cst-front-row-actions {
	justify-content: center;
}

/* Galerie : cartes ~240px, wrap ; peu de résultats n’impose pas une grille 4 colonnes vide. */
.cst-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem 1rem;
	margin: 0.5rem 0 1.5rem;
	align-items: flex-start;
}

.cst-gallery-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex: 0 1 240px;
	width: 240px;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.cst-gallery-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0;
	margin: 0;
	border: none;
	background: #f0f0f0;
	cursor: pointer;
	border-radius: 4px;
	overflow: hidden;
	line-height: 0;
	aspect-ratio: 1 / 1;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.cst-gallery-photo:hover,
.cst-gallery-photo:focus {
	outline: 2px solid var(--cst-color-accent);
	outline-offset: 2px;
}

.cst-gallery-photo-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.cst-gallery-meta {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	width: 100%;
	margin: 0.35rem 0 0;
	text-align: left;
}

.cst-gallery-meta p,
.cst-gallery-name {
	margin: 0;
	padding: 0;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.25;
	word-break: break-word;
	text-align: left;
}

/* Même tableau Champ / Valeur que les formulaires, adapté à la largeur carte. */
.cst-gallery-meta .cst-gallery-fields {
	margin-bottom: 0;
}

.cst-gallery-meta .cst-gallery-fields .cst-col-label,
.cst-gallery-meta .cst-gallery-fields th[scope="row"] {
	min-width: 0;
}

.cst-gallery-meta .cst-gallery-fields .cst-fixed-field-value {
	margin: 0;
}

.cst-gallery-name-sub {
	font-weight: 500;
	font-size: 0.85rem;
	line-height: 1.15;
	opacity: 0.9;
}

.cst-gallery-actions {
	margin-top: 0.25rem;
	justify-content: center;
}

/* Sablier / chargement de page (navigation, submit) */
.cst-page-loading {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 0.85rem;
	margin: 0;
	padding: 1rem;
	border: 0;
	background: rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(1px);
	pointer-events: all;
	cursor: wait;
}

html.cst-is-loading,
html.cst-is-loading body {
	cursor: wait !important;
}

html.cst-is-loading .cst-page-loading {
	display: flex;
}

.cst-page-loading-hourglass {
	box-sizing: border-box;
	width: 2.6rem;
	height: 2.6rem;
	border: 3px solid rgba(29, 35, 39, 0.18);
	border-top-color: #1d2327;
	border-radius: 50%;
	animation: cst-hourglass-spin 0.75s linear infinite;
}

.cst-page-loading-label {
	font-size: 0.95rem;
	font-weight: 600;
	color: #1d2327;
	text-shadow: 0 0 8px #fff;
}

@keyframes cst-hourglass-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Pop-up détail */
.cst-detail-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: min(40rem, calc(100vw - 2rem));
	width: 100%;
	background: var(--cst-color-surface);
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cst-detail-dialog--photo {
	max-width: min(72rem, calc(100vw - 2rem));
	max-height: min(92vh, 56rem);
	height: auto;
}

.cst-detail-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cst-detail-inner {
	position: relative;
	padding: 1.25rem 1.25rem 2.25rem;
}

.cst-detail-inner--with-photo {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 1.25rem;
	max-height: min(92vh, 56rem);
	padding: 1.25rem 1.5rem 1.25rem;
	overflow: hidden;
	box-sizing: border-box;
}

.cst-detail-media {
	flex: 1 1 52%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding-top: 0.15rem;
	background: var(--cst-color-surface);
}

.cst-detail-scroll {
	flex: 1 1 48%;
	min-width: 0;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 0 0.15rem 0.25rem;
	margin-top: 0;
}

.cst-detail-close {
	position: absolute;
	top: 0.4rem;
	right: 0.5rem;
	z-index: 2;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cst-detail-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-height: 12rem;
	margin: 0 0 0.55rem;
	border-radius: 4px;
	overflow: auto;
	background: #f0f0f0;
	max-height: min(80vh, 48rem);
}

.cst-detail-photo img,
.cst-detail-photo video {
	display: block;
	max-width: 100%;
	max-height: min(80vh, 48rem);
	width: auto;
	height: auto;
	object-fit: contain;
}

.cst-detail-photo video {
	width: 100%;
	background: #111;
}

.cst-detail-thumbs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	margin: 0 0 0.55rem;
}

.cst-detail-thumb {
	position: relative;
	appearance: none;
	border: 2px solid transparent;
	padding: 0;
	width: 3.4rem;
	height: 3.4rem;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	background: #eee;
}

.cst-detail-thumb img,
.cst-detail-thumb video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cst-detail-thumb--video {
	background: #111;
}

.cst-detail-thumb__ph {
	display: block;
	width: 100%;
	height: 100%;
	background: #222;
}

.cst-detail-thumb:hover,
.cst-detail-thumb:focus {
	border-color: rgba(0, 0, 0, 0.35);
}

.cst-detail-thumb.is-active {
	border-color: #2271b1;
}

.cst-detail-title {
	margin: 0 0 0.85rem;
	font-size: 1.25rem;
	line-height: 1.3;
	text-align: left;
	padding-right: 2rem;
}

.cst-detail-inner--with-photo .cst-detail-title {
	text-align: left;
}

.cst-detail-fields-table {
	margin-bottom: 0.75rem;
}

.cst-detail-fields-table .cst-fixed-field-value {
	margin: 0;
}

.cst-detail-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cst-detail-row {
	display: grid;
	grid-template-columns: minmax(6.5rem, 38%) 1fr;
	column-gap: 0.75rem;
	align-items: start;
	padding: 0.45rem 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	font-size: 0.95rem;
	line-height: 1.4;
	word-break: break-word;
}

.cst-detail-separator {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	grid-template-columns: none;
	margin-top: 0.25rem;
	padding: 0.25rem 0.55rem;
	border-top: none;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.05);
}

.cst-detail-separator .cst-field-separator-title {
	font-size: 0.95em;
	line-height: 1.25;
}

.cst-detail-separator .cst-field-separator-text {
	font-size: 0.9em;
	line-height: 1.25;
}

.cst-detail-label {
	font-weight: 600;
	color: var(--cst-color-muted);
}

.cst-detail-sep {
	display: none;
}

.cst-detail-value {
	min-width: 0;
}

.cst-detail-form-cta {
	margin: 1.15rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	text-align: center;
}

.cst-detail-form-btn {
	display: inline-block;
	padding: 0.55rem 1.15rem;
	border-radius: 4px;
	background: var(--cst-color-accent);
	color: #fff !important;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.3;
	text-decoration: none !important;
	box-shadow: none;
}

.cst-detail-form-btn:hover,
.cst-detail-form-btn:focus {
	filter: brightness(0.92);
	color: #fff !important;
	text-decoration: none !important;
}

.cst-del-media-dialog {
	max-width: min(36rem, 96vw);
}

.cst-del-media-inner {
	padding: 1rem 1.1rem 1.15rem;
}

.cst-del-media-intro {
	margin: 0 0 0.85rem;
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--cst-color-muted);
}

.cst-del-media-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
	gap: 0.75rem;
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	max-height: min(50vh, 22rem);
	overflow: auto;
}

.cst-del-media-item {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 0.4rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	background: #fafafa;
}

.cst-del-media-check {
	display: flex;
	align-items: flex-start;
	gap: 0.35rem;
	font-size: 0.8rem;
	line-height: 1.25;
	cursor: pointer;
}

.cst-del-media-check input {
	margin: 0.15rem 0 0;
}

.cst-del-media-item--used {
	background: #f3f4f5;
	opacity: 0.95;
}

.cst-del-media-used {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.3;
	color: #646970;
}

.cst-del-media-preview {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 3px;
	background: #e8e8e8;
}

.cst-del-media-preview--video {
	background: #111;
}

.cst-del-media-preview img,
.cst-del-media-preview video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cst-del-media-play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 0.7rem;
	line-height: 1.5rem;
	text-align: center;
	pointer-events: none;
}

.cst-del-media-label {
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.25;
	font-weight: 600;
	word-break: break-word;
}

.cst-del-media-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.5rem;
}

.cst-del-media-actions .cst-action-delete {
	background: #b32d2e;
	border-color: #b32d2e;
	color: #fff;
}

@media (max-width: 800px) {
	.cst-detail-dialog--photo {
		max-width: min(40rem, calc(100vw - 2rem));
	}

	.cst-detail-inner--with-photo {
		flex-direction: column;
		max-height: min(92vh, 56rem);
	}

	.cst-detail-media,
	.cst-detail-scroll {
		flex: 0 0 auto;
		width: 100%;
	}

	.cst-detail-photo,
	.cst-detail-photo img,
	.cst-detail-photo video {
		max-height: min(45vh, 22rem);
	}

	.cst-detail-scroll {
		flex: 1 1 auto;
		min-height: 0;
	}
}

@media (max-width: 640px) {
	.cst-gallery {
		gap: 1rem 0.75rem;
	}

	.cst-gallery-card {
		flex-basis: calc(50% - 0.5rem);
		width: calc(50% - 0.5rem);
	}
}

@media (max-width: 380px) {
	.cst-gallery-card {
		flex-basis: 100%;
		width: 100%;
	}
}
