/* =========================================
   6. PIANO ROLL KEYS & STEP GRID
   ========================================= */

.piano-roll-editor {
    --key-height: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pr-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #2b3339;
    user-select: none;
    font-family: system-ui, -apple-system, sans-serif;
}

.pr-keys {
    position: sticky;
    left: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #111;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
}

.pr-key {
    width: 55px;
    height: var(--key-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-size: 11px;
    flex-shrink: 0;
    border-bottom: 1px solid #111;
    cursor: pointer;
}

.pr-key.white {
    background: #dcdcdc;
    color: #444;
}

.pr-key.black {
    background: #1e1e1e;
    color: #888;
}

.pr-piano {
    overflow-y: hidden;
}

.pr-piano-column {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pr-main-area {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.pr-ruler-spacer {
    flex-shrink: 0;
}

.pr-grid {
    display: flex;
    flex-direction: column;
    min-width: max-content;
}

.pr-row {
    display: flex;
    height: var(--key-height);
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.pr-row.black-row {
    background: rgba(0, 0, 0, 0.15);
}

.pr-cell {
    width: 48px;
    height: 100%;
    box-sizing: border-box;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.pr-cell:nth-child(4n) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.pr-cell:nth-child(16n) {
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.pr-cell:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pr-cell.active {
    background: #6dd966;
    border: 1px solid #3c8c36;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

/* =========================================
   MENUBAR SNAP CONTROL
   ========================================= */

.pr-menubar label.snap-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    cursor: pointer;
}
