/* ==========================================================================
   Tableau de bord « État du baker » (baker.121.tez)
   Mise en page à la largeur du conteneur (container queries) : le tableau
   s'adapte à la colonne qui l'accueille, pas seulement à l'écran.
   ========================================================================== */

.ch-tzd {
	--tzd-text: #f1f5f9;
	--tzd-white: #fff;
	--tzd-muted: #94a3b8;
	--tzd-faint: #64748b;
	--tzd-soft: #cbd5e1;
	--tzd-line: rgba(255, 255, 255, .1);
	--tzd-glass: rgba(255, 255, 255, .05);
	--tzd-good: #34d399;
	--tzd-warn: #fbbf24;
	--tzd-bad: #f87171;

	container-type: inline-size;
	width: 100%;
	padding: 24px;
	border-radius: 24px;
	background: linear-gradient(160deg, #1a0d2e 0%, #140a24 45%, #0d1b2a 100%);
	color: var(--tzd-text);
	font-size: 14px;
	line-height: 1.5;
	text-align: left;
	box-sizing: border-box;
}

.ch-tzd *,
.ch-tzd *::before,
.ch-tzd *::after {
	box-sizing: border-box;
}

/* Remise à zéro des marges et retraits du thème dans le tableau. */
.ch-tzd h2,
.ch-tzd h3,
.ch-tzd p,
.ch-tzd ul,
.ch-tzd dl,
.ch-tzd dd {
	margin: 0;
	padding: 0;
}

.ch-tzd ul {
	list-style: none;
}

.ch-tzd [hidden] {
	display: none !important;
}

.ch-tzd__inner {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 1152px;
	margin: 0 auto;
}

.ch-tzd__icon {
	width: 20px;
	height: 20px;
	flex: none;
}

.ch-tzd__icon.is-small {
	width: 16px;
	height: 16px;
}

.ch-tzd__icon.is-xs {
	width: 14px;
	height: 14px;
}

/* --- En-tête --- */

.ch-tzd__header {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Ligne titre (à gauche) + badges (à droite) */
.ch-tzd__headline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}

.ch-tzd__badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	/*margin-left: auto;*/
}

.ch-tzd__badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	border: 1px solid;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
}

.ch-tzd .ch-tzd__badge.is-violet {
	border-color: rgba(139, 92, 246, .4);
	background: rgba(139, 92, 246, .1);
	color: #c4b5fd;
}

/* Badge en lien (opérations du baker sur tzkt.io) */
.ch-tzd a.ch-tzd__badge {
	text-decoration: none;
	transition: background-color .15s, border-color .15s;
}

.ch-tzd a.ch-tzd__badge.is-violet:hover {
	border-color: rgba(139, 92, 246, .7);
	background: rgba(139, 92, 246, .22);
	color: #ddd6fe;
}

.ch-tzd a.ch-tzd__badge:focus-visible {
	outline: 2px solid #8b5cf6;
	outline-offset: 2px;
}

.ch-tzd .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ch-tzd__badge.is-emerald {
	border-color: rgba(16, 185, 129, .4);
	background: rgba(16, 185, 129, .1);
	color: #6ee7b7;
}

.ch-tzd__pulse {
	width: 8px;
	height: 8px;
	margin-right: 2px;
	border-radius: 50%;
	background: var(--tzd-good);
	animation: ch-tzd-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
}

@keyframes ch-tzd-pulse {
	50% { opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
	.ch-tzd__pulse { animation: none; }
}

.ch-tzd h2.ch-tzd__title {
	color: var(--tzd-white);
	font-size: 30px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -.025em;
	text-transform: uppercase;
}

/* Titre en lien (page des statistiques du baker) */
.ch-tzd .ch-tzd__title a {
	color: inherit;
	text-decoration: none;
	transition: color .15s;
}

.ch-tzd .ch-tzd__title a:hover {
	color: #c4b5fd;
}

.ch-tzd .ch-tzd__title a:focus-visible {
	border-radius: 4px;
	outline: 2px solid #8b5cf6;
	outline-offset: 2px;
}

.ch-tzd .ch-tzd__subtitle {
	margin-top: 4px;
	color: var(--tzd-muted);
	font-size: 14px;
}

.ch-tzd__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ch-tzd__pill {
	padding: 8px 16px;
	border: 1px solid var(--tzd-line);
	border-radius: 12px;
	background: var(--tzd-glass);
	text-align: center;
}

.ch-tzd__pill strong {
	display: block;
	color: var(--tzd-white);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.4;
}

.ch-tzd__pill strong.is-muted {
	color: var(--tzd-muted);
}

.ch-tzd__pill span {
	display: block;
	color: var(--tzd-muted);
	font-size: 10px;
	letter-spacing: .025em;
	text-transform: uppercase;
}

/* --- Indicateurs clés --- */

.ch-tzd__stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.ch-tzd__stat {
	--c: #8b5cf6;
	padding: 16px;
	border: 1px solid var(--tzd-line);
	border-radius: 16px;
	background: var(--tzd-glass);
	box-shadow: 0 0 24px color-mix(in srgb, var(--c) 13%, transparent);
	backdrop-filter: blur(8px);
}

.ch-tzd__stat-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.ch-tzd__stat-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: color-mix(in srgb, var(--c) 13%, transparent);
	color: var(--c);
}

/* Symbole ꜩ à la place du pictogramme. */
.ch-tzd__stat-glyph {
	font-size: 20px;
	font-weight: 600;
	line-height: 1;
}

.ch-tzd__trend {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--tzd-good);
	font-size: 12px;
	font-weight: 500;
}

.ch-tzd__trend .ch-tzd__icon {
	width: 14px;
	height: 14px;
}

.ch-tzd__stat-value {
	margin-top: 12px;
	color: var(--tzd-white);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.3;
}

.ch-tzd__stat-label {
	margin-top: 4px;
	color: var(--tzd-muted);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .025em;
	text-transform: uppercase;
}

.ch-tzd__stat-sub {
	margin-top: 4px;
	color: var(--tzd-faint);
	font-size: 12px;
}

/* --- Onglets --- */

.ch-tzd__tablist {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	align-self: flex-start;
	gap: 4px;
	margin-bottom: -8px;
	padding: 4px;
	border-radius: 8px;
	background: var(--tzd-glass);
}

.ch-tzd .ch-tzd__tab {
	appearance: none;
	margin: 0;
	padding: 6px 12px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--tzd-muted);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	transition: color .15s, background-color .15s;
}

.ch-tzd .ch-tzd__tab:hover {
	color: #e2e8f0;
}

.ch-tzd .ch-tzd__tab[aria-selected="true"] {
	background: rgba(255, 255, 255, .1);
	color: var(--tzd-white);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.ch-tzd .ch-tzd__tab:focus-visible {
	outline: 2px solid #8b5cf6;
	outline-offset: 2px;
}

.ch-tzd__panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* --- Grilles et cartes --- */

.ch-tzd__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

.ch-tzd__stack {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ch-tzd__card {
	border: 1px solid var(--tzd-line);
	border-radius: 12px;
	background: var(--tzd-glass);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
}

.ch-tzd h3.ch-tzd__card-title {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 24px 24px 18px;
	color: var(--tzd-white);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -.01em;
}

.ch-tzd__card-title > span {
	display: inline-flex;
}

.ch-tzd__card-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0 24px 24px;
}

/* Lignes libellé / valeur */
.ch-tzd__kvs {
	display: flex;
	flex-direction: column;
}

.ch-tzd__kv {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.ch-tzd__kv:last-child {
	border-bottom: 0;
}

.ch-tzd__kv dt {
	color: var(--tzd-muted);
	font-size: 12px;
	font-weight: 400;
}

.ch-tzd .ch-tzd__kv-value {
	color: var(--tzd-white);
	font-size: 14px;
	font-weight: 500;
	text-align: right;
}

.ch-tzd .ch-tzd__kv-value.is-good { color: var(--tzd-good); }
.ch-tzd .ch-tzd__kv-value.is-warn { color: var(--tzd-warn); }
.ch-tzd .ch-tzd__kv-value.is-bad { color: var(--tzd-bad); }
.ch-tzd .ch-tzd__kv-value.is-muted { color: var(--tzd-faint); font-style: italic; }

/* Barres de progression */
.ch-tzd__bar-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 4px;
	font-size: 12px;
}

.ch-tzd__bar-head span {
	color: var(--tzd-soft);
}

.ch-tzd__bar-head strong {
	color: var(--tzd-white);
	font-weight: 600;
	white-space: nowrap;
}

.ch-tzd__bar-track {
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(255, 255, 255, .1);
}

.ch-tzd__bar-fill {
	height: 100%;
	border-radius: inherit;
	transition: width .3s;
}

/* Notes */
.ch-tzd .ch-tzd__note {
	color: var(--tzd-faint);
	font-size: 11px;
	line-height: 1.5;
}

.ch-tzd .ch-tzd__note.is-tight { margin-top: -8px; }
.ch-tzd .ch-tzd__note.is-pull { margin-top: -6px; }
.ch-tzd .ch-tzd__note.is-amber { color: rgba(251, 191, 36, .8); }

.ch-tzd .ch-tzd__note.is-footer {
	padding-bottom: 4px;
	text-align: center;
}

.ch-tzd .ch-tzd__overline {
	color: var(--tzd-faint);
	font-size: 10px;
	letter-spacing: .025em;
	text-transform: uppercase;
}

.ch-tzd__sep {
	height: 0;
	margin: 4px 0;
	border: 0;
	border-top: 1px solid var(--tzd-line);
}

/* --- Graphiques --- */

.ch-tzd__chart {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.ch-tzd .ch-tzd__gridline {
	stroke: rgba(255, 255, 255, .07);
	stroke-width: 1;
}

.ch-tzd .ch-tzd__axis {
	fill: var(--tzd-muted);
	font-size: 11px;
}

.ch-tzd .ch-tzd__axis.is-small {
	font-size: 9px;
	fill: var(--tzd-faint);
}

.ch-tzd__dot {
	stroke: #140a24;
	stroke-width: 1.5;
	transition: r .15s;
}

.ch-tzd__dot:hover {
	r: 5.5;
}

.ch-tzd__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	font-size: 12px;
}

.ch-tzd__legend li {
	--c: #8b5cf6;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--c);
}

.ch-tzd__legend li::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 2px;
	background: var(--c);
}

/* --- Dernières preuves --- */

.ch-tzd__proofs {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}

.ch-tzd__proof {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border: 1px solid var(--tzd-line);
	border-radius: 12px;
	background: var(--tzd-glass);
}

.ch-tzd__proof code {
	padding: 0;
	background: none;
	color: var(--tzd-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
}

.ch-tzd__proof strong {
	color: var(--tzd-good);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

/* --- Largeurs du conteneur --- */

@container (min-width: 520px) {
	.ch-tzd__proofs {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container (min-width: 720px) {
	.ch-tzd__header {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.ch-tzd__stats {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container (min-width: 940px) {
	.ch-tzd__grid.is-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ch-tzd__grid.is-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ch-tzd__grid.is-3 > .is-wide {
		grid-column: span 2;
	}
}

@container (min-width: 1150px) {
	.ch-tzd__stats {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ch-tzd {
		padding: 16px;
		border-radius: 16px;
	}

	.ch-tzd h3.ch-tzd__card-title {
		padding: 18px 18px 14px;
	}

	.ch-tzd__card-body {
		padding: 0 18px 18px;
	}
}

/* ==========================================================================
   Version courte : en-tête et indicateurs clés, en format compact
   (colonne étroite, à partir d'environ 300 px de large).
   ========================================================================== */

.ch-tzd.ch-tzd--mini {
	padding: 24px 20px;
	border: 1px solid var(--tzd-line);
	border-radius: 16px;
	font-size: 12px;
}

.ch-tzd--mini .ch-tzd__inner {
	gap: 24px;
}

.ch-tzd--mini .ch-tzd__header {
	gap: 18px;
}

.ch-tzd--mini .ch-tzd__badges {
	gap: 6px;
}

.ch-tzd--mini .ch-tzd__badge {
	padding: 1px 8px;
	font-size: 11px;
}

.ch-tzd--mini h2.ch-tzd__title {
	font-size: 30px;
}

.ch-tzd--mini .ch-tzd__subtitle {
	margin-top: 8px;
	font-size: 12px;
}

.ch-tzd--mini .ch-tzd__pills {
	flex-wrap: nowrap;
	gap: 6px;
}

.ch-tzd--mini .ch-tzd__pill {
	display: flex;
	flex: 1 1 0;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
	padding: 8px 10px;
	border-radius: 10px;
	text-align: left;
}

.ch-tzd--mini .ch-tzd__pill strong {
	flex: none;
	font-size: 15px;
}

.ch-tzd--mini .ch-tzd__pill span {
	font-size: 9px;
	line-height: 1.3;
}

.ch-tzd--mini .ch-tzd__stats {
	gap: 12px;
}

.ch-tzd--mini .ch-tzd__stat {
	padding: 12px;
	border-radius: 12px;
	box-shadow: 0 0 16px color-mix(in srgb, var(--c) 10%, transparent);
}

.ch-tzd--mini .ch-tzd__stat-icon {
	width: 26px;
	height: 26px;
	border-radius: 7px;
}

.ch-tzd--mini .ch-tzd__stat-icon .ch-tzd__icon {
	width: 15px;
	height: 15px;
}

.ch-tzd--mini .ch-tzd__stat-glyph {
	font-size: 15px;
}

.ch-tzd--mini .ch-tzd__trend {
	font-size: 10px;
}

.ch-tzd--mini .ch-tzd__trend .ch-tzd__icon {
	width: 12px;
	height: 12px;
}

.ch-tzd--mini .ch-tzd__stat-value {
	margin-top: 12px;
	font-size: 17px;
	white-space: nowrap;
}

/* Chiffres à chasse fixe : pas de tremblement pendant le comptage animé. */
.ch-tzd--mini .ch-tzd__stat-value,
.ch-tzd--mini .ch-tzd__pill strong {
	font-variant-numeric: tabular-nums;
}

.ch-tzd--mini .ch-tzd__stat-label {
	margin-top: 2px;
	font-size: 9.5px;
	line-height: 1.35;
}

.ch-tzd--mini .ch-tzd__stat-sub {
	margin-top: 2px;
	font-size: 10.5px;
	line-height: 1.35;
}

@container (min-width: 380px) {
	.ch-tzd--mini .ch-tzd__stats {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ch-tzd.ch-tzd--mini {
		padding: 14px;
	}
}
