.pe-program-lines-grid {
    display: contents;
}

.pe-program-lines-grid .pe-point-action.rz-button {
    padding-right: 3px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    /* 1. Target the TD and the internal div specifically to break Radzen's clipping */
    .pe-program-lines-grid .dense-grid .allow-overflow-cell,
.pe-program-lines-grid .dense-grid .allow-overflow-cell .rz-cell-data {
        overflow: visible !important;
        position: relative !important;
    }

    /* 2. The Spanning Overlay - we use a high z-index and force it to be visible */
    .pe-program-lines-grid .dense-grid .instruction-colspan-overlay {
        position: absolute !important;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10 !important;
        white-space: nowrap;
        width: 600px;
        background-color: transparent !important;
        display: block !important;
        pointer-events: auto !important;
    }

    /* 3. Formatting for the View Mode Text */
    .pe-program-lines-grid .logic-text {
        font-family: 'Consolas', monospace;
        font-weight: bold;
        color: var(--rz-info-dark);
        background: rgba(255, 255, 255, 0.9); /* Opaque background to cover grid lines */
        padding: 2px 8px;
        border-radius: 4px;
    }

    .pe-program-lines-grid .comment-text {
        font-style: italic;
        color: var(--rz-text-tertiary-color);
        background: rgba(255, 255, 255, 0.9);
        padding: 2px 8px;
    }

    /* 4. Formatting for the Input Box - Critical to have background white */
    .pe-program-lines-grid .dense-grid .instruction-colspan-overlay .rz-textbox {
        width: 550px !important;
        background-color: var(--rz-input-background-color) !important; color: var(--rz-input-text-color) !important;
        border: 1px solid var(--rz-primary) !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* 5. Ensure the row doesn't have a stacking context that clips the child */
    .pe-program-lines-grid .dense-grid .rz-datagrid-data tr {
        overflow: visible !important;
    }
