body {
    background: #f4f6f9;
}

.grid-editor {
    --cell-size: 70px;
    display: grid;
    min-height: 500px;
    background-color: #fff;
    background-image:
        linear-gradient(to right, rgba(13,110,253,.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(13,110,253,.12) 1px, transparent 1px);
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    padding: 12px;
    align-content: stretch;
}

.grid-item {
    position: relative;
    min-width: 25px;
    min-height: 25px;
    background: rgba(13,110,253,.75);
    color: #fff;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 6px;
    padding: 8px 28px 8px 8px;
    cursor: move;
    user-select: none;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.grid-item.selected {
    outline: 3px solid #ffc107;
    z-index: 10;
}

.resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    right: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 2px;
    cursor: nwse-resize;
}

.item-label {
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.code-output {
    width: 100%;
    min-height: 330px;
    resize: vertical;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    padding: 12px;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    background: #111827;
    color: #e5e7eb;
}

@media (max-width: 768px) {
    .grid-editor {
        min-height: 400px;
    }
}
