/* ========================================================
   LA FABRIQUE À BÉDÉ - STYLES PRINCIPAUX
   Application de création de bandes dessinées pour enfants
   ======================================================== */

:root {
	--bg-app: #1a2035;
	--bg-canvas: #0f1423;
	--panel-bg: #222b45;
	--panel-border: #334267;
	
	--color-primary: #ff5e36;
	--color-primary-hover: #e04b24;
	--color-secondary: #ffb703;
	--color-accent: #06d6a0;
	--color-blue: #118ab2;
	--color-dark: #073b4c;
	
	--text-light: #f8fafc;
	--text-muted: #94a3b8;
	--text-dark: #1e293b;
	
	--font-title: 'Fredoka', cursive, sans-serif;
	--font-body: 'Nunito', sans-serif;
	--font-comic: 'Comic Neue', 'Patrick Hand', cursive;
	--font-onomato: 'Bangers', cursive;
	
	--shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.25);
	--shadow-sheet: 0 15px 40px rgba(0, 0, 0, 0.45);
	--radius-md: 12px;
	--radius-lg: 18px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	-webkit-tap-highlight-color: transparent;
}

body.bd-app-body {
	font-family: var(--font-body);
	background-color: var(--bg-app);
	color: var(--text-light);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	user-select: none;
	-webkit-user-select: none;
}

/* Rétablir la sélection et la saisie de texte sur iPad / Safari pour les zones éditables */
[contenteditable="true"],
.comic-bubble-text,
input,
textarea,
select {
	-webkit-user-select: text !important;
	user-select: text !important;
}

.bd-app-wrapper {
	display: flex;
	flex-direction: column;
	height: 100vh;
	overflow: hidden;
}

/* ========================================================
   1. BARRE SUPÉRIEURE (TOP BAR)
   ======================================================== */
.bd-top-bar {
	background: #151b2e;
	border-bottom: 2px solid #283556;
	padding: 10px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	flex-shrink: 0;
	z-index: 100;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.bd-top-left {
	display: flex;
	align-items: center;
	gap: 14px;
}

.btn-top-back {
	background: #2a375a;
	color: #fff;
	text-decoration: none;
	padding: 8px 14px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s;
	border: 1px solid #3d4f80;
}

.btn-top-back:hover {
	background: #3d4f80;
	transform: translateY(-1px);
}

.bd-logo-badge {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bd-logo-icon {
	font-size: 28px;
	background: linear-gradient(135deg, #ff5e36, #ffb703);
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(255, 94, 54, 0.35);
}

.bd-logo-img {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	object-fit: contain;
	display: block;
	box-shadow: 0 4px 14px rgba(2, 185, 251, 0.35);
	transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bd-logo-badge:hover .bd-logo-img {
	transform: scale(1.08) rotate(-3deg);
}

.bd-logo-text h1 {
	font-family: var(--font-title);
	font-size: 17px;
	font-weight: 800;
	color: #fff;
	letter-spacing: 0.5px;
	line-height: 1.1;
}

.bd-logo-sub {
	font-size: 11px;
	color: var(--text-muted);
	font-weight: 600;
}

/* Centre : Métadonnées (Titre + Auteur + Format) */
.bd-top-center {
	flex: 1;
	max-width: 740px;
}

.bd-meta-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bd-input-pill {
	background: #202a43;
	border: 1.5px solid #33436d;
	border-radius: 10px;
	padding: 4px 10px;
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1;
}

.bd-input-pill label {
	font-size: 11px;
	font-weight: 800;
	color: var(--color-secondary);
	white-space: nowrap;
}

.bd-input-pill input {
	background: transparent;
	border: none;
	outline: none;
	color: #fff;
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 700;
	width: 100%;
}

.btn-bd-pill-action {
	background: #202a43;
	border: 1.5px solid #3d5180;
	border-radius: 10px;
	padding: 5px 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-family: var(--font-title);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.2s ease;
}

.btn-bd-pill-action:hover {
	background: #2c3a5e;
	border-color: var(--color-secondary);
	transform: translateY(-1px);
}

.btn-bd-pill-action strong {
	color: var(--color-secondary);
}

/* Droite : Boutons d'action */
.bd-top-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.btn-bd-action {
	background: #222e4d;
	border: 1.5px solid #394d7d;
	color: #fff;
	padding: 8px 13px;
	border-radius: 10px;
	font-family: var(--font-title);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s;
	white-space: nowrap;
}

.btn-bd-action:hover {
	background: #2f3f69;
	transform: translateY(-2px);
}

.btn-bd-action.btn-help,
.btn-bd-action.btn-load,
.btn-bd-action.btn-save,
.btn-bd-action.btn-export,
.btn-bd-action.btn-print {
	background: #24355b;
	border: 1.5px solid #3c5287;
	color: #f1f5f9;
	box-shadow: none;
}

.btn-bd-action.btn-help:hover,
.btn-bd-action.btn-load:hover,
.btn-bd-action.btn-save:hover,
.btn-bd-action.btn-export:hover,
.btn-bd-action.btn-print:hover {
	background: #32477a;
	border-color: #5575b9;
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-bd-action.btn-reset {
	padding: 8px 10px;
	background: rgba(239, 68, 68, 0.15);
	border-color: rgba(239, 68, 68, 0.4);
	color: #fca5a5;
}

.btn-bd-action.btn-reset:hover {
	background: #ef4444;
	color: #fff;
}

/* ========================================================
   2. ESPACE DE TRAVAIL PRINCIPAL (PLANCHE + BOÎTE À OUTILS)
   ======================================================== */
.bd-main-workspace {
	display: flex;
	flex: 1;
	height: calc(100vh - 66px);
	overflow: hidden;
}

/* ========================================================
   3. ZONE DE LA PLANCHE (CANVAS SECTION)
   ======================================================== */
.bd-canvas-section {
	flex: 1;
	background: var(--bg-canvas);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
}

.bd-canvas-toolbar {
	background: #151b2e;
	padding: 8px 18px;
	border-bottom: 1px solid #232d47;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 13px;
	flex-shrink: 0;
}

.bd-active-case-tag {
	color: #e2e8f0;
}

.bd-active-case-tag strong {
	color: var(--color-secondary);
}

.bd-active-case-tag span {
	background: var(--color-primary);
	color: #fff;
	padding: 2px 8px;
	border-radius: 6px;
	font-weight: 800;
	margin-right: 4px;
}

.bd-canvas-actions {
	display: flex;
	gap: 8px;
}

.btn-mini-tool {
	background: #242f4c;
	border: 1px solid #3a4b77;
	color: #cbd5e1;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-mini-tool:hover:not(:disabled) {
	background: #364670;
	color: #fff;
}

.btn-mini-tool:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* CONTENEUR DE LA FEUILLE BLANCHE DE BD */
.bd-sheet-container {
	flex: 1;
	overflow: auto;
	padding: 25px;
	display: flex;
	justify-content: center;
	align-items: flex-start;
}

.bd-sheet-paper {
	background: #ffffff;
	color: #111;
	border-radius: 8px;
	box-shadow: var(--shadow-sheet);
	padding: 20px 24px;
	width: 100%;
	max-width: 960px;
	min-height: 520px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	position: relative;
	transition: all 0.3s;
}

/* En-tête de la planche */
.bd-sheet-header {
	border-bottom: 2.5px solid #111;
	padding-bottom: 8px;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}

.bd-comic-title-display {
	font-family: var(--font-title);
	font-size: 24px;
	font-weight: 800;
	color: #111;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.bd-comic-author-display {
	font-family: var(--font-comic);
	font-size: 14px;
	font-weight: 700;
	color: #555;
}

/* PIED DE PAGE DE LA PLANCHE */
.bd-sheet-footer {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: #777;
	font-family: var(--font-comic);
	border-top: 1px dashed #ccc;
	padding-top: 8px;
}

/* ========================================================
   4. GRILLE DE CASES BD (PANELS GRID)
   ======================================================== */
/* ========================================================
   4. GRILLE DE CASES BD (PANELS GRID ET VRAIES GOUTTIÈRES D'ALBUM)
   ======================================================== */
.bd-panels-grid {
	display: grid;
	gap: 22px 18px; /* Véritables gouttières BD : 22px entre bandes, 18px entre cases */
	flex: 1;
	width: 100%;
}

/* Formats de mise en page */
.bd-sheet-paper[data-layout="strip-3"] .bd-panels-grid {
	grid-template-columns: repeat(3, 1fr);
	min-height: 340px;
}

.bd-sheet-paper[data-layout="strip-4"] .bd-panels-grid {
	grid-template-columns: repeat(4, 1fr);
	min-height: 300px;
}

.bd-sheet-paper[data-layout="grid-4"] .bd-panels-grid {
	grid-template-columns: repeat(2, 1fr);
	grid-template-rows: repeat(2, 290px);
}

/* 6 Cases - Format classique Planche d'Album Franco-Belge (3 bandes de 2 cases spacieuses) */
.bd-sheet-paper[data-layout="grid-6"] .bd-panels-grid {
	grid-template-columns: repeat(2, 1fr);
	grid-template-rows: repeat(3, 270px);
}

/* 6 Cases - Format panoramique (2 bandes de 3 cases) */
.bd-sheet-paper[data-layout="grid-6-wide"] .bd-panels-grid {
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(2, 250px);
}

/* VIGNETTE / CASE DE BD INDIVIDUELLE (TRAIT D'ENCRE NOIR ALBUM) */
.bd-panel-box {
	background: #ffffff;
	border: 3.5px solid #0a0a0a;
	border-radius: 2px;
	position: relative;
	overflow: hidden;
	cursor: pointer;
	min-height: 250px;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s, outline 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.bd-panel-box.active {
	border-color: #0a0a0a;
	outline: 3.5px solid var(--color-primary);
	outline-offset: 3px;
}

/* Numéro de case discret de repérage (masqué à l'exportation et impression) */
.bd-panel-badge-number {
	position: absolute;
	top: 8px;
	left: 8px;
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(4px);
	color: #fff;
	font-family: var(--font-comic);
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 6px;
	z-index: 10;
	pointer-events: none;
	border: 1px solid rgba(255, 255, 255, 0.2);
	transition: all 0.2s;
}

.bd-panel-box:hover .bd-panel-badge-number,
.bd-panel-box.active .bd-panel-badge-number {
	background: var(--color-primary);
	border-color: var(--color-primary);
}

/* Couche de Fond (Background) de la case */
.panel-background-layer {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	z-index: 1;
	pointer-events: none;
}

/* Couche des éléments (Personnages, Bulles, Objets) */
.panel-elements-layer {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
}

/* ========================================================
   5. ÉLÉMENTS DANS LA CASE (PERSONNAGES, BULLES, OBJETS)
   ======================================================== */
.comic-item {
	position: absolute;
	cursor: grab;
	touch-action: none;
	user-select: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transform-origin: center center;
	transition: outline 0.15s;
}

.comic-item:active {
	cursor: grabbing;
}

.comic-item.selected,
.comic-bubble-wrapper.selected {
	outline: 2px dashed #ff5e36;
	outline-offset: 4px;
}

/* Croix discrète de suppression directe */
.comic-item-delete-btn {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 22px;
	height: 22px;
	background: #ef4444;
	color: #ffffff;
	border: 2px solid #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: Arial, sans-serif;
	font-size: 11px;
	font-weight: 900;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
	z-index: 9999;
	transition: all 0.15s ease;
	user-select: none;
	padding: 0;
	outline: none;
}

.comic-item-delete-btn:hover {
	background: #dc2626;
	transform: scale(1.2);
	box-shadow: 0 3px 10px rgba(220, 38, 38, 0.7);
}

.comic-item-delete-btn:active {
	transform: scale(0.95);
}

/* Bouton direct d'édition du texte sur la bulle de dialogue sélectionnée */
.comic-item-edit-btn {
	position: absolute;
	top: -10px;
	left: -10px;
	width: 24px;
	height: 24px;
	background: #3b82f6;
	color: #ffffff;
	border: 2px solid #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
	z-index: 9999;
	transition: all 0.15s ease;
	user-select: none;
	padding: 0;
	outline: none;
}

.comic-item-edit-btn:hover {
	background: #2563eb;
	transform: scale(1.2);
	box-shadow: 0 3px 10px rgba(37, 99, 235, 0.7);
}

.comic-item-edit-btn:active {
	transform: scale(0.95);
}

/* Poignée de redimensionnement de largeur pour bulle sélectionnée */
.comic-bubble-resize-handle {
	position: absolute;
	right: -10px;
	top: 50%;
	transform: translateY(-50%);
	width: 22px;
	height: 22px;
	background: #0284c7;
	color: #ffffff;
	border: 2px solid #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 800;
	cursor: ew-resize;
	touch-action: none;
	z-index: 9999;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
	user-select: none;
	transition: background 0.15s, transform 0.15s;
}

.comic-bubble-resize-handle:hover {
	background: #0369a1;
	transform: translateY(-50%) scale(1.2);
}

.comic-bubble-resize-handle:active {
	transform: translateY(-50%) scale(0.95);
}

/* Poignée de redimensionnement direct pour personnage, objet ou onomatopée */
.comic-item-scale-handle {
	position: absolute;
	bottom: -10px;
	right: -10px;
	width: 22px;
	height: 22px;
	background: #0284c7;
	color: #ffffff;
	border: 2px solid #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 800;
	cursor: nwse-resize;
	touch-action: none;
	z-index: 9999;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
	user-select: none;
	transition: background 0.15s, transform 0.15s;
}

.comic-item-scale-handle:hover {
	background: #0369a1;
	transform: scale(1.2);
}

.comic-item-scale-handle:active {
	transform: scale(0.95);
}

/* Longs traits blancs au milieu des 4 bords pointillés pour rogner (recadrer) un personnage ou objet */
.comic-item-crop-handle {
	position: absolute;
	background: #ffffff;
	border: 2px solid #ff5e36;
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
	z-index: 9998;
	touch-action: none;
	user-select: none;
	transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.comic-item-crop-handle.crop-top {
	top: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 30px;
	height: 8px;
	cursor: ns-resize;
}

.comic-item-crop-handle.crop-bottom {
	bottom: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 30px;
	height: 8px;
	cursor: ns-resize;
}

.comic-item-crop-handle.crop-left {
	left: -8px;
	top: 50%;
	transform: translateY(-50%);
	width: 8px;
	height: 30px;
	cursor: ew-resize;
}

.comic-item-crop-handle.crop-right {
	right: -8px;
	top: 50%;
	transform: translateY(-50%);
	width: 8px;
	height: 30px;
	cursor: ew-resize;
}

.comic-item-crop-handle.crop-top:hover,
.comic-item-crop-handle.crop-bottom:hover {
	background: #fff7ed;
	border-color: #ea580c;
	transform: translateX(-50%) scale(1.15);
}

.comic-item-crop-handle.crop-left:hover,
.comic-item-crop-handle.crop-right:hover {
	background: #fff7ed;
	border-color: #ea580c;
	transform: translateY(-50%) scale(1.15);
}

.comic-item-crop-handle:active {
	background: #ffedd5;
	border-color: #c2410c;
}

.comic-item-content {
	width: 100%;
	height: 100%;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.comic-item-content svg {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.comic-item-content img {
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
	user-select: none;
}

/* ========================================================
   6. BULLES DE DIALOGUE (PHYLACTÈRES)
   ======================================================== */
.comic-bubble-wrapper {
	position: absolute;
	cursor: grab;
	touch-action: none;
	z-index: 20;
	max-width: 90%;
}

.comic-bubble-body {
	background: #ffffff;
	border: 2.5px solid #111111;
	padding: 8px 12px;
	border-radius: 18px;
	color: #000;
	position: relative;
	box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}

.comic-bubble-text {
	outline: none;
	border: none;
	font-family: var(--font-comic);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	color: #111;
	min-width: 40px;
	cursor: text;
	user-select: text !important;
	-webkit-user-select: text !important;
	touch-action: manipulation;
}

.comic-bubble-text:empty::before {
	content: "Tape ton texte...";
	color: #999;
	font-style: italic;
}

/* Queue bulle gauche */
.bubble-type-speech-left .comic-bubble-body::after {
	content: "";
	position: absolute;
	bottom: -12px;
	left: 20px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 12px 12px 0 0;
	border-color: #fff transparent transparent transparent;
	z-index: 2;
}
.bubble-type-speech-left .comic-bubble-body::before {
	content: "";
	position: absolute;
	bottom: -15px;
	left: 19px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 14px 14px 0 0;
	border-color: #111 transparent transparent transparent;
	z-index: 1;
}

/* Queue bulle droite */
.bubble-type-speech-right .comic-bubble-body::after {
	content: "";
	position: absolute;
	bottom: -12px;
	right: 20px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 12px 0 0 12px;
	border-color: #fff transparent transparent transparent;
	z-index: 2;
}
.bubble-type-speech-right .comic-bubble-body::before {
	content: "";
	position: absolute;
	bottom: -15px;
	right: 19px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 14px 0 0 14px;
	border-color: #111 transparent transparent transparent;
	z-index: 1;
}

/* Bulle Pensée (Queue à gauche) */
.bubble-type-thought .comic-bubble-body,
.bubble-type-thought-left .comic-bubble-body {
	border-radius: 24px;
	border: 2.5px solid #111;
}
.bubble-type-thought .comic-bubble-body::after,
.bubble-type-thought-left .comic-bubble-body::after {
	content: "";
	position: absolute;
	bottom: -10px;
	left: 18px;
	width: 8px;
	height: 8px;
	background: #fff;
	border: 2px solid #111;
	border-radius: 50%;
}
.bubble-type-thought .comic-bubble-body::before,
.bubble-type-thought-left .comic-bubble-body::before {
	content: "";
	position: absolute;
	bottom: -18px;
	left: 12px;
	width: 5px;
	height: 5px;
	background: #fff;
	border: 2px solid #111;
	border-radius: 50%;
}

/* Bulle Pensée (Queue à droite) */
.bubble-type-thought-right .comic-bubble-body {
	border-radius: 24px;
	border: 2.5px solid #111;
}
.bubble-type-thought-right .comic-bubble-body::after {
	content: "";
	position: absolute;
	bottom: -10px;
	right: 18px;
	width: 8px;
	height: 8px;
	background: #fff;
	border: 2px solid #111;
	border-radius: 50%;
}
.bubble-type-thought-right .comic-bubble-body::before {
	content: "";
	position: absolute;
	bottom: -18px;
	right: 12px;
	width: 5px;
	height: 5px;
	background: #fff;
	border: 2px solid #111;
	border-radius: 50%;
}

/* Bulle Cri / Explosion (SVG Vectoriel Franco-Belge) */
.bubble-type-shout .comic-bubble-body,
.bubble-type-shout-left .comic-bubble-body,
.bubble-type-shout-right .comic-bubble-body {
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	clip-path: none;
	padding: 20px 26px 32px 26px;
	min-width: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.comic-shout-svg-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
	overflow: visible;
	transform-origin: center center;
}

.bubble-type-shout-right .comic-shout-svg-bg {
	transform: scaleX(-1);
}

.bubble-type-shout .comic-bubble-text,
.bubble-type-shout-left .comic-bubble-text,
.bubble-type-shout-right .comic-bubble-text {
	position: relative;
	z-index: 2;
	font-family: var(--font-onomato);
	font-size: 18px;
	letter-spacing: 1px;
	color: #111111;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Encadré Narrateur */
.bubble-type-narration .comic-bubble-body {
	background: #fef08a;
	border: 2.5px solid #111;
	border-radius: 0;
	box-shadow: 2px 2px 0px #111;
	padding: 6px 12px;
}
.bubble-type-narration .comic-bubble-text {
	font-family: var(--font-comic);
	font-style: italic;
	font-size: 13px;
	text-align: left;
}

/* ========================================================
   7. BOÎTE À OUTILS LATÉRALE (SIDE TOOLBOX)
   ======================================================== */
.bd-toolbox-panel {
	width: 380px;
	background: #182033;
	border-left: 2px solid #283556;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	position: relative;
	overflow: hidden;
}

.bd-toolbox-tabs {
	display: flex;
	background: #121828;
	border-bottom: 2px solid #283556;
	overflow-x: auto;
}

.toolbox-tab {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--text-muted);
	padding: 12px 6px;
	font-family: var(--font-title);
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
	border-bottom: 3px solid transparent;
	transition: all 0.2s;
}

.toolbox-tab .tab-icon {
	font-size: 20px;
}

.toolbox-tab:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.04);
}

.toolbox-tab.active {
	color: var(--color-primary);
	border-bottom-color: var(--color-primary);
	background: #182033;
}

.bd-toolbox-content {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
}

.toolbox-tab-pane {
	display: none;
	flex-direction: column;
	gap: 12px;
}

.toolbox-tab-pane.active {
	display: flex;
}

.toolbox-header-info {
	font-size: 12px;
	color: var(--color-secondary);
	font-weight: 700;
}

.sub-category-filters {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 4px;
}

.sub-filter-btn {
	background: #242f4c;
	border: 1px solid #374773;
	color: #cbd5e1;
	padding: 5px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.2s;
}

.sub-filter-btn.active,
.sub-filter-btn:hover {
	background: var(--color-primary);
	color: #fff;
	border-color: var(--color-primary);
}

.assets-scroll-grid,
.backgrounds-scroll-grid,
.onomatopoeia-grid {
	display: grid;
	gap: 10px;
}

.assets-scroll-grid {
	grid-template-columns: repeat(3, 1fr);
}

.backgrounds-scroll-grid {
	grid-template-columns: repeat(2, 1fr);
}

.onomatopoeia-grid {
	grid-template-columns: repeat(2, 1fr);
}

/* Carte d'asset individuel */
.asset-card {
	background: #212c47;
	border: 1.5px solid #35456f;
	border-radius: 10px;
	padding: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s;
	position: relative;
	min-height: 85px;
}

.asset-card:hover {
	background: #2d3b5e;
	border-color: var(--color-secondary);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.asset-card-emo-pill {
	position: absolute;
	top: 4px;
	left: 4px;
	font-size: 9px;
	font-weight: 800;
	background: rgba(14, 165, 233, 0.9);
	color: #ffffff;
	padding: 1px 5px;
	border-radius: 6px;
	pointer-events: none;
	z-index: 2;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.asset-card-pro {
	background: linear-gradient(145deg, #1e293b, #2a3857);
	border: 1.5px solid #f59e0b;
}

.asset-card-pro::after {
	content: "★ BD";
	position: absolute;
	top: 4px;
	right: 4px;
	font-size: 8px;
	font-weight: 800;
	background: #f59e0b;
	color: #0f172a;
	padding: 1px 4px;
	border-radius: 4px;
	line-height: 1;
}

.asset-card-pro:hover {
	border-color: #fbbf24;
	box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.asset-card-preview {
	width: 54px;
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.asset-card-preview svg,
.asset-card-preview img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.asset-card-name {
	font-size: 10px;
	color: var(--text-muted);
	font-weight: 700;
	margin-top: 4px;
	text-align: center;
}

/* Carte de décor illustré */
.bg-asset-card {
	border-radius: 10px;
	overflow: hidden;
	border: 2.5px solid #35456f;
	cursor: pointer;
	transition: all 0.25s;
	position: relative;
	height: 105px;
	display: flex;
	align-items: flex-end;
	background-size: cover;
	background-position: center;
	box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.bg-asset-card:hover {
	border-color: var(--color-primary);
	transform: scale(1.04);
	box-shadow: 0 6px 16px rgba(255, 94, 54, 0.4);
}

.bg-asset-label {
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.4));
	color: #fff;
	width: 100%;
	font-size: 11px;
	font-weight: 800;
	padding: 5px 6px;
	text-align: center;
	letter-spacing: 0.3px;
}

/* Cartes bulles */
.bubbles-preset-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bubble-preset-card {
	background: #212c47;
	border: 1.5px solid #35456f;
	border-radius: 10px;
	padding: 10px 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	transition: all 0.2s;
}

.bubble-preset-card:hover {
	background: #2d3b5e;
	border-color: var(--color-accent);
}

.bubble-preview {
	background: #fff;
	color: #000;
	padding: 4px 10px;
	border-radius: 12px;
	border: 1.5px solid #000;
	font-size: 11px;
	font-weight: 700;
	font-family: var(--font-comic);
	position: relative;
}

.bubble-preview.thought {
	border-radius: 20px;
	border-style: dashed;
}

.bubble-preview.shout {
	background: #facc15;
	border: 2px solid #111;
	border-radius: 4px;
	font-family: var(--font-onomato);
	font-size: 12px;
	letter-spacing: 0.8px;
	box-shadow: 2px 2px 0 #111;
	transform: rotate(-2deg);
}

.bubble-preview.narration {
	background: #fef08a;
	border-radius: 0;
	font-style: italic;
	box-shadow: 2px 2px 0 #111;
}

.bubble-preset-label {
	font-size: 12px;
	font-weight: 700;
	color: #f1f5f9;
}

/* Onomatopées */
.onomato-card {
	background: #202b46;
	border: 2px solid #344773;
	border-radius: 10px;
	padding: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s;
}

.onomato-card:hover {
	transform: scale(1.05) rotate(-2deg);
	border-color: var(--color-secondary);
}

.onomato-text-preview {
	font-family: var(--font-onomato);
	font-size: 24px;
	letter-spacing: 1.5px;
	text-shadow: 2px 2px 0px #000;
}

/* ========================================================
   8. HUD CONTRÔLE D'ÉLÉMENT
   ======================================================== */
.bd-element-controls-hud {
	background: #121828;
	border-top: 2px solid var(--color-primary);
	padding: 12px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.4);
}

.hud-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.hud-title {
	font-size: 12px;
	font-weight: 800;
	color: var(--color-secondary);
	font-family: var(--font-title);
}

.hud-close-btn {
	background: transparent;
	border: none;
	color: var(--text-muted);
	font-size: 14px;
	cursor: pointer;
}

.hud-buttons-row {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.hud-btn {
	background: #243050;
	border: 1px solid #394c7d;
	color: #fff;
	padding: 6px 10px;
	border-radius: 8px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 4px;
	transition: all 0.2s;
}

.hud-btn:hover {
	background: #354776;
	border-color: var(--color-accent);
}

.hud-btn.danger {
	background: rgba(239, 68, 68, 0.2);
	border-color: rgba(239, 68, 68, 0.5);
	color: #fca5a5;
}

.hud-btn.danger:hover {
	background: #ef4444;
	color: #fff;
}

.hud-bubble-options {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	background: #1c253d;
	padding: 8px 12px;
	border-radius: 8px;
}

.hud-opt-group {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
}

.hud-opt-group select {
	background: #283556;
	border: 1px solid #43588f;
	color: #fff;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 11px;
	outline: none;
}

.hud-btn-mini {
	background: #283556;
	border: 1px solid #43588f;
	color: #fff;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 800;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.hud-btn-mini:hover {
	background: #3b4d7c;
	border-color: #60a5fa;
}

/* ========================================================
   OPTIONS D'ÉMOTIONS DANS LE HUD (LÉO ET EMMA)
   ======================================================== */
.hud-emotions-options {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #182239;
	border: 1px solid #2d3b5e;
	border-radius: 8px;
	padding: 6px 10px;
	margin-top: 6px;
	width: 100%;
}

.hud-emotions-label {
	font-size: 11px;
	font-weight: 700;
	color: #94a3b8;
	white-space: nowrap;
}

.hud-emotions-btns {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.hud-emotion-btn {
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	border: 1px solid #334155;
	background: #243050;
	color: #cbd5e1;
	cursor: pointer;
	transition: all 0.2s ease;
}

.hud-emotion-btn:hover {
	transform: translateY(-1px);
	border-color: #64748b;
}

.hud-emotion-btn.btn-emo-joy.active {
	background: #14532d;
	border-color: #22c55e;
	color: #86efac;
}

.hud-emotion-btn.btn-emo-laugh.active {
	background: #713f12;
	border-color: #eab308;
	color: #fde047;
}

.hud-emotion-btn.btn-emo-sadness.active {
	background: #1e3a8a;
	border-color: #3b82f6;
	color: #93c5fd;
}

.hud-emotion-btn.btn-emo-anger.active {
	background: #7f1d1d;
	border-color: #ef4444;
	color: #fca5a5;
}

.hud-emotion-btn.btn-emo-fear.active {
	background: #581c87;
	border-color: #a855f7;
	color: #d8b4fe;
}

.hud-emotion-btn.btn-emo-think.active {
	background: #0f766e;
	border-color: #14b8a6;
	color: #99f6e4;
}

.comic-emotion-overlay-badge {
	position: absolute;
	top: -12px;
	right: -8px;
	font-size: 22px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
	animation: popBadge 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	pointer-events: none;
	z-index: 20;
}

.comic-emotion-overlay-badge svg {
	width: 100%;
	height: 100%;
	overflow: visible;
}

@keyframes popBadge {
	0% { transform: scale(0) rotate(-20deg); }
	100% { transform: scale(1) rotate(0deg); }
}

/* ========================================================
   BARRE FLOTTANTE D'ÉMOTIONS (DIRECTEMENT SUR LE PERSONNAGE)
   ======================================================== */
.comic-item-floating-emobar {
	position: absolute;
	top: -48px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 4px;
	background: #111a2e;
	border: 2px solid #38bdf8;
	border-radius: 24px;
	padding: 4px 8px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.4);
	z-index: 50;
	pointer-events: auto;
	animation: popFloatingBar 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popFloatingBar {
	from { transform: translateX(-50%) scale(0.6); opacity: 0; }
	to { transform: translateX(-50%) scale(1); opacity: 1; }
}

.floating-emo-btn {
	background: transparent;
	border: 2px solid transparent;
	font-size: 20px;
	cursor: pointer;
	padding: 2px 5px;
	border-radius: 12px;
	transition: all 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.floating-emo-btn:hover {
	transform: scale(1.25);
	background: rgba(255, 255, 255, 0.15);
}

.floating-emo-btn.active {
	background: rgba(56, 189, 248, 0.35);
	border-color: #38bdf8;
	transform: scale(1.15);
}

/* BANDEAU D'AIDE ÉMOTIONS DANS LA BOÎTE À OUTILS */
.emotions-helper-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(168, 85, 247, 0.15));
	border: 1px solid rgba(56, 189, 248, 0.4);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 11px;
	line-height: 1.4;
	color: #e2e8f0;
}

.emo-banner-icon {
	font-size: 22px;
	flex-shrink: 0;
}

.emo-banner-text strong {
	color: #38bdf8;
}

/* ========================================================
   8b. HUD DÉCOR (CADRAGE ET MIROIR AU BAS DE L'ÉCRAN)
   ======================================================== */
.bd-bg-controls-hud {
	border-top: 2px solid #0284c7;
	background: #111a2e;
}

.hud-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.btn-hud-mini {
	background: #1f2b48;
	border: 1px solid #364b7c;
	color: #cbd5e1;
	font-size: 10px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-hud-mini:hover {
	background: #2b3b64;
	color: #fff;
	border-color: var(--color-primary);
}

.btn-hud-mini.danger {
	color: #fca5a5;
	border-color: rgba(239, 68, 68, 0.4);
	background: rgba(239, 68, 68, 0.15);
}

.btn-hud-mini.danger:hover {
	background: #ef4444;
	color: #fff;
	border-color: #ef4444;
}

.hud-btn-group {
	display: flex;
	align-items: center;
	background: #18223a;
	border: 1px solid #2d3f6a;
	border-radius: 8px;
	padding: 2px 4px;
	gap: 4px;
}

.hud-zoom-badge {
	font-family: var(--font-title);
	font-size: 11px;
	font-weight: 800;
	color: var(--color-secondary);
	min-width: 42px;
	text-align: center;
}

.hud-btn-mirror {
	background: #1e3a5f;
	border-color: #0284c7;
	color: #e0f2fe;
}

.hud-btn-mirror:hover {
	background: #0284c7;
	color: #fff;
}

.hud-bg-framing-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	border-top: 1px solid #1e2a47;
	padding-top: 6px;
}

.hud-dpad-controls {
	display: flex;
	align-items: center;
	gap: 2px;
	background: #18223a;
	padding: 3px 5px;
	border-radius: 8px;
	border: 1px solid #2d3f6a;
}

.hud-dpad-vert {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.btn-dpad {
	background: #223152;
	border: 1px solid #364b7c;
	color: #fff;
	width: 26px;
	height: 22px;
	border-radius: 4px;
	font-size: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.15s;
	padding: 0;
}

.btn-dpad:hover {
	background: var(--color-secondary);
	border-color: var(--color-secondary);
	color: #000;
}

.hud-shot-presets {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: 1;
	justify-content: flex-end;
}

.hud-preset-btn {
	background: #1c2742;
	border: 1px solid #2f416c;
	color: #cbd5e1;
	font-size: 10px;
	font-weight: 700;
	padding: 5px 8px;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s;
	white-space: nowrap;
}

.hud-preset-btn:hover {
	background: var(--color-primary);
	border-color: var(--color-primary);
	color: #fff;
}

/* ========================================================
   9. MODALS
   ======================================================== */
.bd-modal-backdrop {
	position: fixed;
	top: 0; left: 0; width: 100vw; height: 100vh;
	background: rgba(8, 12, 24, 0.85);
	backdrop-filter: blur(4px);
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s;
}

.bd-modal-backdrop.open,
.bd-modal-backdrop.active {
	opacity: 1;
	visibility: visible;
}

.bd-modal-box {
	background: #182239;
	border: 2px solid #2e416d;
	border-radius: var(--radius-lg);
	width: 100%;
	max-width: 680px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
	transform: scale(0.95);
	transition: transform 0.3s;
}

.bd-modal-backdrop.open .bd-modal-box,
.bd-modal-backdrop.active .bd-modal-box {
	transform: scale(1);
}

.bd-modal-header {
	background: #131b2f;
	padding: 16px 20px;
	border-bottom: 1.5px solid #28375c;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bd-modal-header h3 {
	font-family: var(--font-title);
	font-size: 18px;
	color: #fff;
}

.bd-modal-close {
	background: transparent;
	border: none;
	color: var(--text-muted);
	font-size: 18px;
	cursor: pointer;
}

.bd-modal-body {
	padding: 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.bd-modal-intro {
	font-size: 14px;
	color: #cbd5e1;
	font-weight: 600;
}

.layout-cards-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.layout-card {
	background: #202b46;
	border: 2px solid #334570;
	border-radius: 12px;
	padding: 14px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 10px;
	transition: all 0.2s;
}

.layout-card:hover {
	border-color: var(--color-secondary);
	background: #283659;
}

.layout-card.active {
	border-color: var(--color-primary);
	background: #2a3350;
	box-shadow: 0 0 0 2px var(--color-primary);
}

.layout-thumb {
	background: #0f1423;
	border-radius: 6px;
	padding: 8px;
	height: 75px;
	display: flex;
	gap: 6px;
}

.thumb-grid-4,
.thumb-grid-6,
.thumb-grid-6-wide {
	flex-direction: column;
}

.thumb-cell {
	background: #fff;
	color: #111;
	border: 1.5px solid #111;
	border-radius: 2px;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-title);
	font-size: 11px;
	font-weight: 800;
}

.thumb-row {
	display: flex;
	gap: 6px;
	width: 100%;
	flex: 1;
}

.layout-info strong {
	display: block;
	font-size: 13px;
	color: #fff;
	margin-bottom: 2px;
}

.layout-info span {
	font-size: 11px;
	color: var(--text-muted);
}

.bd-modal-footer {
	background: #131b2f;
	padding: 14px 20px;
	border-top: 1.5px solid #28375c;
	display: flex;
	justify-content: flex-end;
}

.btn-bd-modal-confirm {
	background: linear-gradient(135deg, var(--color-primary), #ff8c42);
	color: #fff;
	border: none;
	padding: 10px 22px;
	border-radius: 10px;
	font-family: var(--font-title);
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-bd-modal-confirm:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(255, 94, 54, 0.4);
}

/* GUIDE PÉDAGOGIQUE */
.guide-steps-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

.guide-step-card {
	background: #212c47;
	border: 1px solid #35456f;
	border-radius: 10px;
	padding: 14px;
	position: relative;
}

.guide-step-num {
	width: 26px;
	height: 26px;
	background: var(--color-primary);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 900;
	font-family: var(--font-title);
	font-size: 12px;
	margin-bottom: 8px;
}

.guide-step-card h4 {
	font-family: var(--font-title);
	font-size: 14px;
	color: var(--color-secondary);
	margin-bottom: 4px;
}

.guide-step-card p {
	font-size: 12px;
	color: #cbd5e1;
	line-height: 1.4;
}

.guide-pro-tips {
	background: rgba(6, 214, 160, 0.1);
	border: 1.5px solid var(--color-accent);
	border-radius: 10px;
	padding: 14px;
}

.guide-pro-tips h4 {
	font-family: var(--font-title);
	font-size: 14px;
	color: var(--color-accent);
	margin-bottom: 8px;
}

.guide-pro-tips ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 12px;
	color: #e2e8f0;
}

/* ========================================================
   10. STYLE D'IMPRESSION (PRINT STYLESHEET)
   ======================================================== */
@media print {
	body, html {
		background: #ffffff !important;
		color: #000000 !important;
		height: auto !important;
		overflow: visible !important;
	}

	.bd-top-bar,
	.bd-canvas-toolbar,
	.bd-toolbox-panel,
	.bd-modal-backdrop,
	.bd-panel-badge-number,
	.comic-item-delete-btn,
	.comic-item-edit-btn,
	.comic-item-floating-emobar,
	.comic-bubble-resize-handle,
	.comic-item-scale-handle,
	.comic-item-crop-handle,
	.bd-toast-notification,
	.btn-bd-action {
		display: none !important;
	}

	.comic-item.selected,
	.comic-bubble-wrapper.selected {
		outline: none !important;
		box-shadow: none !important;
	}

	.bd-app-wrapper,
	.bd-main-workspace,
	.bd-canvas-section,
	.bd-sheet-container {
		height: auto !important;
		overflow: visible !important;
		padding: 0 !important;
		margin: 0 !important;
		background: transparent !important;
	}

	.bd-sheet-paper {
		max-width: 100% !important;
		width: 100% !important;
		box-shadow: none !important;
		border-radius: 0 !important;
		padding: 10mm !important;
		page-break-inside: avoid;
	}

	.bd-panel-box {
		border-color: #000 !important;
		box-shadow: none !important;
	}
}

/* ========================================================
   11. ADAPTATION RESPONSIVE ET TABLETTES
   ======================================================== */
@media (max-width: 900px) {
	.bd-top-bar {
		height: auto;
		flex-wrap: wrap;
		padding: 10px 14px;
		gap: 10px;
	}

	.bd-top-center {
		order: 3;
		width: 100%;
		max-width: 100%;
		flex: 1 1 100%;
	}

	.bd-meta-inputs {
		flex-wrap: wrap;
	}

	.bd-main-workspace {
		flex-direction: column;
		height: auto;
		overflow-y: auto;
	}

	.bd-toolbox-panel {
		width: 100%;
		height: 380px;
	}
}

/* ========================================================
   12. NOTIFICATION TOAST
   ======================================================== */
.bd-toast-notification {
	position: fixed;
	top: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(-25px);
	background: #1e293b;
	color: #fff;
	border: 2px solid #3b82f6;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
	padding: 12px 24px;
	border-radius: 999px;
	font-family: var(--font-title);
	font-size: 14px;
	font-weight: 800;
	z-index: 10000;
	opacity: 0;
	pointer-events: none;
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	align-items: center;
	gap: 10px;
}

.bd-toast-notification.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.bd-toast-notification.success {
	background: #064e3b;
	border-color: #10b981;
	color: #ecfdf5;
	box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.bd-toast-notification.warning {
	background: #78350f;
	border-color: #f59e0b;
	color: #fffbeb;
	box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

.bd-toast-notification.error {
	background: #7f1d1d;
	border-color: #ef4444;
	color: #fef2f2;
	box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

@media (pointer: coarse), (max-width: 1024px) {
	.bd-input-pill input {
		font-size: 16px;
	}
}

/* ========================================================
   MODAL DE SAISIE DU TEXTE DES BULLES (IDÉAL TABLETTES)
   ======================================================== */
.hud-btn-edit-bubble {
	background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
	color: #ffffff !important;
	border-color: #2563eb !important;
	font-weight: 800 !important;
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
}

.hud-btn-edit-bubble:hover {
	background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
	transform: translateY(-1px);
}

.bd-bubble-text-modal-box {
	max-width: 500px;
}

.bubble-text-modal-textarea {
	width: 100%;
	background: #0f1423;
	border: 2px solid #334570;
	border-radius: 10px;
	padding: 12px 14px;
	color: #fff;
	font-family: var(--font-comic);
	font-size: 17px;
	line-height: 1.4;
	resize: vertical;
	min-height: 120px;
	outline: none;
	-webkit-user-select: text !important;
	user-select: text !important;
	transition: border-color 0.2s;
}

.bubble-text-modal-textarea:focus {
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px rgba(255, 94, 54, 0.25);
}

.bubble-modal-actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	width: 100%;
}

.btn-bd-modal-cancel {
	background: #2a3756;
	color: #cbd5e1;
	border: none;
	padding: 10px 18px;
	border-radius: 10px;
	font-family: var(--font-title);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s;
}

.btn-bd-modal-cancel:hover {
	background: #37476f;
	color: #fff;
}

/* ========================================================
   12. ALBUM MULTIPAGES - NAVIGATION ET MODALES
   ======================================================== */
.bd-page-nav-pill {
	display: inline-flex;
	align-items: center;
	background: #0f1423;
	border: 1.5px solid #2a3756;
	border-radius: 999px;
	padding: 3px 6px;
	gap: 4px;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.btn-page-nav {
	background: #1e293b;
	color: #fff;
	border: 1px solid #334155;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-size: 11px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s;
}

.btn-page-nav:hover:not(:disabled) {
	background: var(--color-primary);
	border-color: var(--color-primary);
	transform: scale(1.08);
}

.btn-page-nav:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.btn-page-counter {
	background: transparent;
	border: none;
	color: #f1f5f9;
	font-family: var(--font-title);
	font-size: 13px;
	font-weight: 800;
	padding: 4px 10px;
	border-radius: 20px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 5px;
	transition: background 0.15s, color 0.15s;
}

.btn-page-counter:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #38bdf8;
}

.btn-page-action {
	background: #1e293b;
	color: #e2e8f0;
	border: 1px solid #334155;
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 11.5px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: all 0.15s;
}

.btn-page-action:hover {
	background: #334155;
	color: #fff;
	transform: translateY(-1px);
}

.btn-page-action.btn-delete-page:hover {
	background: #dc2626;
	border-color: #dc2626;
	color: #fff;
}

/* Modale de la grille de toutes les planches */
.pages-modal-box {
	max-width: 900px;
	width: 95%;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
}

.pages-modal-top-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
}

.pages-modal-hint {
	margin: 0;
	color: #475569;
	font-size: 14px;
	line-height: 1.4;
	flex: 1;
	min-width: 250px;
}

.bd-album-pages-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
	overflow-y: auto;
	max-height: calc(85vh - 220px);
	padding: 4px;
}

.bd-album-page-card {
	background: #ffffff;
	border: 2px solid #e2e8f0;
	border-radius: 14px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	transition: all 0.2s;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.bd-album-page-card:hover {
	border-color: #94a3b8;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.bd-album-page-card.active {
	border-color: #0284c7;
	background: #f0f9ff;
	box-shadow: 0 4px 14px rgba(2, 132, 199, 0.22);
}

.page-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.page-card-title {
	font-family: var(--font-title);
	font-size: 15px;
	font-weight: 800;
	color: #0f172a;
}

.page-card-badge {
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	background: #e2e8f0;
	color: #475569;
}

.bd-album-page-card.active .page-card-badge {
	background: #0284c7;
	color: #ffffff;
}

.page-card-preview {
	background: #ffffff;
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	height: 115px;
	padding: 6px;
	display: grid;
	gap: 4px;
	cursor: pointer;
	transition: transform 0.15s, border-color 0.15s;
}

.page-card-preview:hover {
	transform: scale(1.02);
	border-color: #0284c7;
}

.page-card-preview[data-layout="strip-3"] {
	grid-template-columns: repeat(3, 1fr);
}

.page-card-preview[data-layout="strip-4"] {
	grid-template-columns: repeat(4, 1fr);
}

.page-card-preview[data-layout="grid-4"] {
	grid-template-columns: repeat(2, 1fr);
	grid-template-rows: repeat(2, 1fr);
}

.page-card-preview[data-layout="grid-6"] {
	grid-template-columns: repeat(2, 1fr);
	grid-template-rows: repeat(3, 1fr);
}

.page-card-preview[data-layout="grid-6-wide"] {
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(2, 1fr);
}

.page-card-cell-mini {
	background: #f1f5f9;
	border: 1px dashed #cbd5e1;
	border-radius: 4px;
	background-size: cover;
	background-position: center;
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 2px;
}

.page-card-cell-mini .cell-element-tag {
	background: rgba(15, 23, 42, 0.7);
	color: #fff;
	font-size: 8px;
	font-weight: 700;
	padding: 1px 3px;
	border-radius: 3px;
}

.page-card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	padding-top: 6px;
	border-top: 1px solid #e2e8f0;
}

.page-card-actions {
	display: flex;
	gap: 4px;
}

.btn-page-card-sub {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	color: #334155;
	border-radius: 6px;
	padding: 4px 7px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.15s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.btn-page-card-sub:hover:not(:disabled) {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: #0f172a;
}

.btn-page-card-sub:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.btn-page-card-sub.btn-delete:hover:not(:disabled) {
	background: #fee2e2;
	border-color: #ef4444;
	color: #b91c1c;
}

.btn-page-card-open {
	background: #0284c7;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 11.5px;
	font-weight: 800;
	cursor: pointer;
	transition: background 0.15s;
}

.btn-page-card-open:hover {
	background: #0369a1;
}

/* Choix d'export et d'impression */
.btn-album-choice {
	background: #f8fafc;
	border: 2px solid #e2e8f0;
	border-radius: 14px;
	padding: 14px 18px;
	display: flex;
	align-items: center;
	gap: 14px;
	cursor: pointer;
	text-align: left;
	transition: all 0.2s;
	width: 100%;
}

.btn-album-choice:hover {
	border-color: #0284c7;
	background: #f0f9ff;
	transform: translateY(-1px);
}

.btn-album-choice.choice-primary {
	border-color: #38bdf8;
	background: #f0fdf4;
}

.btn-album-choice .choice-icon {
	font-size: 30px;
	line-height: 1;
	flex-shrink: 0;
}

.btn-album-choice .choice-text strong {
	display: block;
	font-size: 15px;
	color: #0f172a;
	font-family: var(--font-title);
	margin-bottom: 2px;
}

.btn-album-choice .choice-text small {
	display: block;
	font-size: 12.5px;
	color: #64748b;
}

/* Conteneur d'impression multipages */
#bdPrintAllContainer {
	display: none;
}

@media print {
	body.bd-printing-all #bdSheetContainer {
		display: none !important;
	}

	body.bd-printing-all #bdPrintAllContainer {
		display: block !important;
		width: 100% !important;
	}

	body.bd-printing-all #bdPrintAllContainer .bd-sheet-paper {
		display: block !important;
		page-break-after: always !important;
		break-after: page !important;
		box-shadow: none !important;
		border-radius: 0 !important;
		margin: 0 0 20mm 0 !important;
		padding: 10mm !important;
	}
}

@media (max-width: 768px) {
	.bd-canvas-toolbar {
		flex-wrap: wrap;
		gap: 8px;
	}
	.bd-page-nav-pill {
		order: 1;
		width: 100%;
		justify-content: center;
	}
}


