body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}
.container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 800px;
    width: 100%;
}

/* --- Fenêtre de visualisation du grand canva --- */
.canvas-viewport {
    width: 100%;
    height: 400px; /* Taille affichée à l'écran */
    overflow: auto; /* Fait apparaître les barres de défilement */
    border: 2px dashed #ccc;
    border-radius: 5px;
    margin-bottom: 15px;
    background-color: #d1d5db; /* Gris clair derrière le canva pour voir les limites */
    position: relative;
}

canvas {
    display: block;
    background-color: #fff;
	/* Pour éviter le flou sur les écrans retina */
    touch-action: none; 
}

/* Gestion dynamique de l'icône de la souris selon l'outil */
.viewport-pen, .viewport-eraser { cursor: crosshair; }
.viewport-pan { cursor: grab; }
.viewport-pan:active { cursor: grabbing; }


.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}
button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-primary { 
	background-color: #0056b3; 
	color: white; 
}

.btn-primary:hover { 
	background-color: #004494; 

}
.btn-secondary { 
	background-color: #e0e0e0; 
	color: #333; 
}

.btn-secondary:hover { 
	background-color: #ccc; 
}

.hidden { 
	display: none; 
}

#loading { 
	color: #d97706; 
	font-weight: bold; 
	margin-bottom: 10px; 
}

#pdfFrame {
    width: 100%;
    height: 400px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #eaeaea;
    margin-top: 10px;
}

pre { 
    background: #f8f9fa; 
    padding: 15px; 
    border-radius: 5px; 
    overflow-x: auto;
    max-height: 200px; /* Limite la hauteur du code brut */
    overflow-y: auto;
}

/* --- barre d'outils --- */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.tool-btn {
    background-color: #f8f9fa;
    border: 2px solid #ccc;
    color: #333;
    padding: 8px 15px;
}
.tool-btn:hover {
    background-color: #e2e6ea;
}
.tool-btn.active {
    background-color: #e0f0ff;
    border-color: #0056b3;
    color: #0056b3;
    font-weight: bold;
}

.tool-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    border-left: 2px solid #ccc;
    padding-left: 15px;
}
.tool-options label {
    font-size: 14px;
    color: #555;
}
.color-select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
}