.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 10px;
    gap: 4px;
    color: #475569;
    background: transparent;
    border: 1px solid transparent;
    text-align: center;
}

.tool-btn:hover {
    background-color: #f1f5f9;
}

.tool-btn.active {
    background-color: #ebf5ff;
    color: #2563eb;
    border-color: #bfdbfe;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.tool-btn.active i {
    color: #2563eb;
}

.top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    color: #64748b;
    border: 1px solid transparent;
}

.top-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.top-btn:active {
    background-color: #e2e8f0;
}

/* Background Engineering Grid (rendered efficiently via CSS for the wrapper) */
#canvas-wrapper {
    background-image: 
        linear-gradient(to right, rgba(203, 213, 225, 0.4) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(203, 213, 225, 0.4) 1px, transparent 1px);
    background-position: center center;
    /* We'll control the background size via JS to match zoom level */
}

/* Fix text selection when dragging */
canvas {
    user-select: none;
    -webkit-user-select: none;
}