body {
    font-family: sans-serif;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 0;
}

hr {
    width: 100%;
    border: none;
    border-top: 1px solid #eee;
    margin: 15px 0;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

#deleteLineBtn {
    background-color: #f8d7da;
    color: #721c24;
}

#deleteLineBtn:hover {
    background-color: #f5c6cb;
}

#deleteLineBtn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* --- THIS RULE IS NOW CORRECTED --- */
.property-controls {
    display: flex;       /* Changed from 'contents' */
    flex-wrap: wrap;     /* Added to allow items to wrap */
    gap: 15px;           /* Added for spacing */
    justify-content: center; /* Added to center the items */
    align-items: center;
}

h1 {
    color: #333;
}

canvas {
    border: 2px dashed #ccc;
    background-color: #fff;
    max-width: 100%;
    height: auto;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

.controls {
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

input, select, button {
    padding: 8px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

button {
    cursor: pointer;
    background-color: #e0e0e0;
    width: auto; /* Allow buttons to size to their content */
    height: 40px;
    font-weight: bold;
    padding: 8px 15px; /* Add horizontal padding */
}

/* Adjust zoom buttons back to square */
#zoomInBtn, #zoomOutBtn {
    width: 40px;
    padding: 8px;
}

button:hover {
    background-color: #d0d0d0;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
    padding: 0;
}

.control-group {
    display: none;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* This class will be added by JavaScript to show the relevant controls */
.control-group.visible {
    /* FIXED: This now properly contains the elements within it */
    display: flex;
}

.compound-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compound-control input[type="number"] {
    width: 60px; /* Give the number input a fixed width */
}

.add-font-container {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-bottom: 15px;
}

.add-font-container input {
    flex-grow: 1; /* Allows the input to take up available space */
}

.add-font-container button {
    flex-shrink: 0; /* Prevents the button from shrinking */
}

.font-helper-text {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    width: 100%;
    margin: -5px 0 10px 0;
}

.font-helper-text a {
    color: #007bff;
    text-decoration: none;
}
.font-helper-text a:hover {
    text-decoration: underline;
}

#downloadBtn {
    background-color: #d4edda; /* A soft green */
    color: #155724;
    font-weight: bold;
}
#downloadBtn:hover {
    background-color: #c3e6cb;
}