.t3tv-app {
	--t3tv-green: #279e0c;
	--t3tv-green-dark: #21830a;
	--t3tv-green-soft: #eef9eb;
	--t3tv-border: #dfe4e7;
	--t3tv-text: #1f2933;
	--t3tv-muted: #667085;
	max-width: 1120px;
	margin: 0 auto;
	font-family: inherit;
	color: var(--t3tv-text);
}

.t3tv-app *,
.t3tv-app *::before,
.t3tv-app *::after {
	box-sizing: border-box;
}


.t3tv-product-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 0 0 18px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--t3tv-border);
	border-radius: 12px;
	box-shadow: 0 3px 14px rgba(31, 41, 51, 0.05);
}

.t3tv-product-bar[hidden] {
	display: none !important;
}

.t3tv-product-bar-info {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.t3tv-product-bar-info strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.t3tv-product-bar-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 9px;
	background: var(--t3tv-green-soft);
	color: var(--t3tv-green);
	flex: 0 0 auto;
}

.t3tv-product-bar-icon svg {
	width: 19px;
	height: 19px;
}

.t3tv-panel {
	background: #fff;
	border: 1px solid var(--t3tv-border);
	border-radius: 14px;
	padding: 22px;
	box-shadow: 0 4px 18px rgba(31, 41, 51, 0.05);
}

.t3tv-section-heading {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	margin-bottom: 18px;
}

.t3tv-section-heading-compact {
	margin-bottom: 16px;
}

.t3tv-section-heading h2,
.t3tv-preview-topbar h2 {
	font-size: 20px;
	line-height: 1.25;
	margin: 0 0 5px;
	color: var(--t3tv-text);
}

.t3tv-section-heading p,
.t3tv-preview-topbar p {
	margin: 0;
	color: var(--t3tv-muted);
	font-size: 14px;
	line-height: 1.5;
}

.t3tv-section-icon,
.t3tv-selected-icon {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: var(--t3tv-green-soft);
	color: var(--t3tv-green);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.t3tv-section-icon svg,
.t3tv-selected-icon svg,
.t3tv-product-bar-icon svg,
.t3tv-btn svg,
.t3tv-mode-btn svg,
.t3tv-order-btn svg,
.t3tv-brush-label-text svg,
.t3tv-dropzone-icon svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.t3tv-dropzone {
	border: 2px dashed var(--t3tv-green);
	border-radius: 12px;
	padding: 54px 24px;
	text-align: center;
	cursor: pointer;
	color: var(--t3tv-text);
	background: #fbfefb;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	outline: none;
}

.t3tv-dropzone:hover,
.t3tv-dropzone.t3tv-dragover,
.t3tv-dropzone:focus-visible {
	background: var(--t3tv-green-soft);
	border-color: var(--t3tv-green-dark);
	box-shadow: 0 0 0 4px rgba(39, 158, 12, 0.12);
}

.t3tv-dropzone-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	margin-bottom: 14px;
	background: var(--t3tv-green);
	color: #fff;
}

.t3tv-dropzone-icon svg {
	width: 28px;
	height: 28px;
}

.t3tv-dropzone-text {
	font-size: 16px;
	font-weight: 650;
	margin: 0 0 7px;
}

.t3tv-dropzone-subtext {
	display: block;
	font-size: 12px;
	color: var(--t3tv-muted);
}

.t3tv-workspace-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
	gap: 18px;
	margin-bottom: 18px;
}

.t3tv-colors {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 9px;
}

.t3tv-color-swatch {
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid var(--t3tv-border);
	border-radius: 9px;
	background: #fff;
	color: var(--t3tv-text);
	padding: 8px 10px;
	cursor: pointer;
	text-align: left;
	font: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.t3tv-color-swatch:hover,
.t3tv-color-swatch:focus-visible {
	border-color: var(--t3tv-green);
	box-shadow: 0 0 0 3px rgba(39, 158, 12, 0.10);
	outline: none;
}

.t3tv-color-swatch.t3tv-active {
	border-color: var(--t3tv-green);
	background: var(--t3tv-green-soft);
	box-shadow: inset 0 0 0 1px var(--t3tv-green);
}

.t3tv-color-dot {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.18);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
	flex: 0 0 auto;
}

.t3tv-color-name {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
}

.t3tv-mode-switch {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
}

.t3tv-mode-btn,
.t3tv-btn,
.t3tv-order-btn {
	border: 1px solid var(--t3tv-green);
	background: var(--t3tv-green);
	color: #fff !important;
	border-radius: 7px;
	padding: 9px 12px;
	font-size: 13px;
	line-height: 1.25;
	cursor: pointer;
	font-weight: 650;
	text-decoration: none !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.t3tv-mode-btn:hover,
.t3tv-mode-btn:focus-visible,
.t3tv-btn:hover,
.t3tv-btn:focus-visible,
.t3tv-order-btn:hover,
.t3tv-order-btn:focus-visible {
	background: var(--t3tv-green-dark);
	border-color: var(--t3tv-green-dark);
	color: #fff !important;
	outline: none;
	box-shadow: 0 0 0 3px rgba(39, 158, 12, 0.14);
}

.t3tv-mode-btn:not(.t3tv-active) {
	background: #fff;
	color: var(--t3tv-green) !important;
}

.t3tv-mode-btn:not(.t3tv-active):hover,
.t3tv-mode-btn:not(.t3tv-active):focus-visible {
	background: var(--t3tv-green-soft);
	color: var(--t3tv-green-dark) !important;
}

.t3tv-mode-btn svg,
.t3tv-btn svg,
.t3tv-order-btn svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.t3tv-brush-label {
	display: grid;
	gap: 8px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--t3tv-border);
	font-size: 13px;
	color: var(--t3tv-text);
}

.t3tv-brush-label-text {
	display: flex;
	align-items: center;
	gap: 7px;
	font-weight: 600;
}

.t3tv-brush-label-text svg {
	width: 17px;
	height: 17px;
	color: var(--t3tv-green);
}

.t3tv-brush-label input[type="range"] {
	accent-color: var(--t3tv-green);
	width: 100%;
}

.t3tv-preview-panel {
	padding: 20px;
}

.t3tv-preview-topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 14px;
}

.t3tv-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.t3tv-hint {
	max-width: 620px;
}

.t3tv-status {
	font-size: 13px;
	color: #246b13;
	background: var(--t3tv-green-soft);
	border: 1px solid rgba(39, 158, 12, 0.24);
	border-radius: 8px;
	padding: 10px 12px;
	margin: 0 0 12px;
}

.t3tv-click-marker {
	position: absolute;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: var(--t3tv-green);
	box-shadow: 0 0 0 2px var(--t3tv-green), 0 2px 8px rgba(0, 0, 0, .25);
	pointer-events: none;
	transform: translate(-50%, -50%);
}

.t3tv-canvas-wrap {
	position: relative;
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
	background: #20252a;
	touch-action: none;
	line-height: 0;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

#t3tv-canvas {
	width: 100%;
	height: auto;
	display: block;
	cursor: crosshair;
}

.t3tv-selected-product {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 14px 0 0;
	padding: 12px 14px;
	background: var(--t3tv-green-soft);
	border: 1px solid rgba(39, 158, 12, .22);
	border-radius: 9px;
	font-size: 14px;
}

.t3tv-selected-icon {
	width: 34px;
	height: 34px;
	background: #fff;
}

.t3tv-selected-icon svg {
	width: 18px;
	height: 18px;
}

.t3tv-selected-label {
	color: var(--t3tv-muted);
	margin-right: 3px;
}

.t3tv-selected-color {
	font-size: 15px;
}

.t3tv-order-btn {
	margin-left: auto;
	padding: 9px 14px;
}

@media (max-width: 900px) {
	.t3tv-workspace-grid {
		grid-template-columns: 1fr;
	}
	.t3tv-colors {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.t3tv-preview-topbar {
		flex-direction: column;
	}
	.t3tv-buttons {
		justify-content: flex-start;
	}
}

@media (max-width: 700px) {

	.t3tv-product-bar {
		align-items: stretch;
		flex-direction: column;
	}
	.t3tv-product-bar .t3tv-order-btn {
		width: 100%;
		margin-left: 0;
	}
	.t3tv-panel {
		padding: 16px;
		border-radius: 10px;
	}
	.t3tv-colors {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.t3tv-mode-switch {
		grid-template-columns: 1fr;
	}
	.t3tv-buttons {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
	}
	.t3tv-btn {
		width: 100%;
	}
	.t3tv-order-btn {
		margin-left: 0;
		width: 100%;
	}
	.t3tv-selected-product {
		align-items: flex-start;
	}
}

@media (max-width: 430px) {
	.t3tv-colors {
		grid-template-columns: 1fr;
	}
	.t3tv-buttons {
		grid-template-columns: 1fr;
	}
	.t3tv-section-heading h2,
	.t3tv-preview-topbar h2 {
		font-size: 18px;
	}
	.t3tv-dropzone {
		padding: 38px 16px;
	}
}

/* Produit selectionne + etat de prechargement IA. */
.t3tv-product-picker {
	display: grid;
	gap: 4px;
	min-width: min(460px, 48vw);
	font-size: 12px;
	font-weight: 650;
	color: var(--t3tv-muted);
}

.t3tv-product-picker select {
	width: 100%;
	min-height: 38px;
	padding: 7px 34px 7px 10px;
	border: 1px solid var(--t3tv-border);
	border-radius: 8px;
	background: #fff;
	color: var(--t3tv-text);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
}

.t3tv-product-picker select:focus {
	outline: none;
	border-color: var(--t3tv-green);
	box-shadow: 0 0 0 3px rgba(39, 158, 12, .12);
}

.t3tv-ai-preload-state {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-left: 4px;
	padding: 6px 9px;
	border-radius: 999px;
	background: #f6f8f9;
	color: var(--t3tv-muted);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.t3tv-ai-preload-state[hidden] {
	display: none !important;
}

.t3tv-ai-preload-spinner {
	width: 13px;
	height: 13px;
	border: 2px solid rgba(39, 158, 12, .22);
	border-top-color: var(--t3tv-green);
	border-radius: 50%;
	animation: t3tv-spin .8s linear infinite;
}

.t3tv-ai-preload-state.t3tv-ready {
	background: var(--t3tv-green-soft);
	color: #246b13;
}

.t3tv-ai-preload-state.t3tv-ready .t3tv-ai-preload-spinner {
	border: 0;
	animation: none;
	width: 14px;
	height: 14px;
}

.t3tv-ai-preload-state.t3tv-ready .t3tv-ai-preload-spinner::before {
	content: "✓";
	display: block;
	font-size: 13px;
	line-height: 14px;
	font-weight: 800;
}

.t3tv-ai-preload-state.t3tv-failed {
	background: #f6f8f9;
	color: var(--t3tv-muted);
}

.t3tv-ai-preload-state.t3tv-failed .t3tv-ai-preload-spinner {
	display: none;
}

.t3tv-mode-btn.t3tv-loading::after {
	content: "";
	width: 13px;
	height: 13px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: t3tv-spin .8s linear infinite;
	flex: 0 0 auto;
}

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

@media (max-width: 700px) {
	.t3tv-product-bar-info {
		align-items: flex-start;
		flex-wrap: wrap;
	}
	.t3tv-product-picker {
		min-width: 0;
		width: calc(100% - 46px);
	}
	.t3tv-ai-preload-state {
		margin-left: 46px;
	}
}


/* v2.5.0: aperçu prioritaire et états IA explicites */
.t3tv-preview-first { margin-bottom: 18px; }
.t3tv-preview-first .t3tv-canvas-wrap { margin: 0; }
.t3tv-preview-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:12px; }
.t3tv-preview-first .t3tv-selected-product { margin:0; }
.t3tv-preview-first .t3tv-hint { margin:10px 0 0; }
#t3tv-canvas { touch-action:none; user-select:none; -webkit-user-select:none; }
.t3tv-mode-btn:disabled,
.t3tv-mode-btn.t3tv-disabled { opacity:.42; cursor:not-allowed; filter:grayscale(.25); }
.t3tv-mode-btn:disabled:hover,
.t3tv-mode-btn:disabled:focus-visible { background:#eef1f2; color:#5e676d; border-color:#d7dcdf; box-shadow:none; }
.t3tv-ai-preload-state.t3tv-slow { background:#fff8e6; color:#6c5200; }
.t3tv-ai-preload-state.t3tv-slow .t3tv-ai-preload-spinner { border-color:rgba(108,82,0,.18); border-top-color:#6c5200; }
.t3tv-ai-wait-more { display:inline-flex; align-items:center; justify-content:center; min-height:32px; padding:6px 11px; border-radius:7px; border:1px solid var(--t3tv-green); background:var(--t3tv-green); color:#fff; font-weight:700; cursor:pointer; }
.t3tv-ai-wait-more:hover,.t3tv-ai-wait-more:focus-visible { background:var(--t3tv-green-dark); border-color:var(--t3tv-green-dark); }
.t3tv-ai-wait-more[hidden] { display:none!important; }
@media (max-width:700px){ .t3tv-preview-actions{align-items:stretch}.t3tv-preview-actions .t3tv-buttons{width:100%;justify-content:flex-start}.t3tv-ai-wait-more{margin-left:46px} }

/* v2.6.2 : barre d'outils compacte au-dessus de l'image */
.t3tv-compact-stage {
	padding: 16px;
}
.t3tv-compact-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding: 2px 1px 10px;
	margin-bottom: 2px;
}
.t3tv-color-picker {
	position: relative;
	flex: 0 0 auto;
}
.t3tv-color-trigger,
.t3tv-tool-icon-btn {
	width: 42px;
	height: 42px;
	min-width: 42px;
	border: 1px solid var(--t3tv-border);
	border-radius: 10px;
	background: #fff;
	color: var(--t3tv-green);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 0;
	cursor: pointer;
	transition: .15s ease;
}
.t3tv-color-trigger:hover,
.t3tv-color-trigger:focus-visible,
.t3tv-tool-icon-btn:hover,
.t3tv-tool-icon-btn:focus-visible {
	border-color: var(--t3tv-green);
	box-shadow: 0 0 0 3px rgba(39,158,12,.11);
	outline: none;
}
.t3tv-tool-icon-btn.t3tv-active {
	background: var(--t3tv-green);
	border-color: var(--t3tv-green);
	color: #fff;
}
.t3tv-tool-icon-btn:disabled,
.t3tv-tool-icon-btn.t3tv-disabled {
	background: #f3f4f5;
	border-color: #dde1e4;
	color: #8b949b;
	opacity: .6;
	cursor: not-allowed;
	box-shadow: none;
}
.t3tv-tool-icon-btn svg,
.t3tv-color-trigger svg,
.t3tv-size-icon svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.t3tv-color-trigger svg {
	width: 13px;
	height: 13px;
	color: #667085;
}
.t3tv-color-trigger-dot {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid rgba(0,0,0,.28);
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 1px 2px rgba(0,0,0,.08);
	background: #fff;
}
.t3tv-color-popover {
	position: absolute;
	z-index: 30;
	top: calc(100% + 8px);
	left: 0;
	width: min(330px, calc(100vw - 44px));
	max-height: 300px;
	overflow: auto;
	grid-template-columns: 1fr;
	gap: 5px;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--t3tv-border);
	border-radius: 12px;
	box-shadow: 0 12px 34px rgba(31,41,51,.16);
}
.t3tv-color-popover[hidden] { display: none !important; }
.t3tv-color-popover .t3tv-color-swatch {
	padding: 7px 8px;
	border-radius: 8px;
}
.t3tv-color-popover .t3tv-color-dot {
	width: 26px;
	height: 26px;
}
.t3tv-size-control {
	display: flex;
	align-items: center;
	gap: 7px;
	min-width: 150px;
	max-width: 230px;
	flex: 1 1 190px;
	margin: 0;
	padding: 0 2px 0 5px;
	border: 0;
}
.t3tv-size-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--t3tv-green);
	flex: 0 0 auto;
}
.t3tv-size-icon svg { width: 18px; height: 18px; }
.t3tv-size-control input[type="range"] {
	width: 100%;
	min-width: 100px;
	accent-color: var(--t3tv-green);
}
.t3tv-ai-copy {
	margin: 0 0 10px;
}
.t3tv-zone-help {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--t3tv-muted);
}
.t3tv-ai-copy .t3tv-status {
	margin: 7px 0 0;
	padding: 8px 10px;
	font-size: 12px;
}
.t3tv-compact-stage .t3tv-canvas-wrap {
	margin: 0;
	border-radius: 11px;
	overflow: hidden;
	background: #f5f6f7;
}
.t3tv-compact-stage #t3tv-canvas {
	display: block;
	max-width: 100%;
	width: 100%;
	height: auto;
}
.t3tv-compact-stage .t3tv-preview-actions {
	margin-top: 10px;
}
.t3tv-selected-product { display: none !important; }
.t3tv-tool-icon-btn.t3tv-loading::after {
	content: "";
	position: absolute;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 2px var(--t3tv-green);
	transform: translate(12px,-12px);
}
@media (max-width:700px) {
	.t3tv-compact-stage { padding: 10px; }
	.t3tv-compact-toolbar { gap: 6px; }
	.t3tv-color-trigger,
	.t3tv-tool-icon-btn { width: 40px; height: 40px; min-width: 40px; }
	.t3tv-size-control { min-width: 128px; flex-basis: 150px; }
	.t3tv-compact-stage .t3tv-buttons { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
	.t3tv-compact-stage .t3tv-btn { white-space: nowrap; }
}
.t3tv-tool-icon-btn { position: relative; }
.t3tv-app .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0,0,0,0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
.t3tv-color-popover { position: fixed; top: auto; left: auto; }


.t3tv-simulation-notice {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 10px 0 0;
	padding: 9px 11px;
	border: 1px solid var(--t3tv-border);
	border-radius: 9px;
	background: #f8fafb;
	color: var(--t3tv-muted);
	font-size: 12px;
	line-height: 1.45;
}
.t3tv-simulation-notice p {
	margin: 0;
}
.t3tv-simulation-notice strong {
	color: var(--t3tv-text);
}
.t3tv-simulation-notice-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	color: var(--t3tv-green);
	flex: 0 0 auto;
}
.t3tv-simulation-notice-icon svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}


/* v2.6.4 : correction Safari iOS pour la palette de couleurs. */
.t3tv-color-popover {
	--t3tv-green: #279e0c;
	--t3tv-green-dark: #21830a;
	--t3tv-green-soft: #eef9eb;
	--t3tv-border: #dfe4e7;
	--t3tv-text: #1f2933;
	--t3tv-muted: #667085;
	position: fixed !important;
	z-index: 2147483647 !important;
	pointer-events: auto !important;
	isolation: isolate;
	touch-action: pan-y;
	-webkit-overflow-scrolling: touch;
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
}
.t3tv-color-popover .t3tv-color-swatch,
.t3tv-color-trigger {
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.t3tv-compact-stage .t3tv-canvas-wrap {
	z-index: 1;
}
.t3tv-compact-toolbar {
	position: relative;
	z-index: 2;
}
