*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f2f2e7;
    overflow: hidden;
    min-height: 100vh;
}

#grid {
    display: grid;
    width: 100vw;
    height: 100vh;
    padding: 0;
    gap: 0;
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s;
}

/* Checkbox cells */
.cell-checkbox {
    display: grid;
    gap: 0;
    padding: 4px;
}

.cell-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    border: 1.5px solid currentColor;
    transition: background-color 0.15s;
}

.cell-checkbox input[type="checkbox"]:checked {
    background-color: currentColor;
}

/* Range/slider cells */
.cell-range {
    padding: 8px;
    flex-direction: column;
    gap: 2px;
}

.cell-range input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0,0,0,0.15);
    border-radius: 0;
    outline: none;
    cursor: pointer;
}

.cell-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 100%;
    background: currentColor;
    cursor: pointer;
}

/* Radio cells */
.cell-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 6px;
    align-content: center;
}

.cell-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    margin: 2px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.cell-radio input[type="radio"]:checked {
    background-color: currentColor;
}

/* Button cells */
.cell-button {
    padding: 4px;
}

.cell-button button {
    width: 100%;
    height: 100%;
    border: 2px solid currentColor;
    background: transparent;
    color: currentColor;
    font-size: clamp(0.6rem, 1.5vw, 1rem);
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background-color 0.15s, color 0.15s;
}

.cell-button button:hover {
    background: currentColor;
    color: white;
}

/* Text input cells */
.cell-text {
    padding: 4px;
}

.cell-text input[type="text"] {
    width: 100%;
    height: 100%;
    border: none;
    border-bottom: 2px solid currentColor;
    background: transparent;
    color: currentColor;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    font-family: inherit;
    text-align: center;
    outline: none;
}

/* Select cells */
.cell-select {
    padding: 6px;
}

.cell-select select {
    width: 100%;
    border: 2px solid currentColor;
    background: transparent;
    color: currentColor;
    font-family: inherit;
    font-size: 0.75rem;
    padding: 4px;
    cursor: pointer;
    outline: none;
}

/* Progress cells */
.cell-progress {
    padding: 4px;
    flex-direction: column;
    gap: 3px;
}

.cell-progress progress {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    border: none;
}

.cell-progress progress::-webkit-progress-bar {
    background: rgba(0,0,0,0.1);
}

.cell-progress progress::-webkit-progress-value {
    background: currentColor;
}
