body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
}

#canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: crosshair;
}

canvas {
    display: block;
}

#toolbar {
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    gap: 10px;
    align-items: center;
}

.tool-btn {
    padding: 8px 12px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #e0e0e0;
}

.tool-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.separator {
    width: 1px;
    height: 24px;
    background: #ccc;
    margin: 0 5px;
}

#status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-top: 1px solid #ccc;
    font-size: 12px;
    pointer-events: none;
    user-select: none;
}

#scale-container {
    position: absolute;
    bottom: 35px;
    left: 10px;
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#scale-line {
    border: 2px solid #333;
    border-top: none;
    height: 6px;
    width: 100px; /* Will be set dynamically */
    box-sizing: border-box;
}

#scale-text {
    text-align: center;
    font-size: 12px;
    color: #333;
    margin-bottom: 2px;
    text-shadow: 1px 1px 0 #fff;
    font-weight: bold;
}

input[type="color"] {
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    padding: 0;
    background: none;
}
