* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 2px solid #000;
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: bold;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: #000000;
    color: #ffffff;
}

.btn:active {
    transform: scale(0.95);
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 10px;
    gap: 15px;
}

.left-pane, .right-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 15px;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 2px solid #000;
    border-radius: 4px;
    overflow: hidden;
}

/* On right pane, the canvas wrapper takes the full height */
.full-height {
    flex: 1;
}

h3 {
    padding: 8px;
    font-size: 1rem;
    border-bottom: 1px solid #000;
    background: #fff;
    z-index: 10;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #000;
    background: #fff;
    z-index: 10;
}

.pane-header h3 {
    border-bottom: none;
    flex-grow: 1;
}

.preset-select {
    margin: 5px 10px;
    padding: 6px;
    font-size: 0.9rem;
    border: 1px solid #000;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
}

.instruction {
    font-size: 0.85rem;
    color: #555;
    padding: 0 8px 8px 8px;
    border-bottom: 1px solid #eee;
}

canvas {
    flex: 1;
    width: 100%;
    /* Keep the height working nicely */
    display: block;
    cursor: crosshair;
    touch-action: none; /* Prevent scrolling while drawing */
}

/* Tablet and Phone Responsive Layout */
@media (max-width: 800px) {
    body {
        overflow: auto;
    }
    
    .main-container {
        flex-direction: column;
        min-height: 150vh;
    }
    
    .left-pane, .right-pane {
        flex: none;
        height: 50vh;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}
