.generator-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    /* Removed fixed height to prevent footer overlap */
}

@media (max-width: 768px) {
    .generator-wrapper {
        flex-direction: column;
    }

    .selection-area {
        height: 500px;
        /* Keep scrollable on mobile too, but smaller */
    }
}

.selection-area {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    height: 600px;
    /* Fixed height for internal scrolling */
}

.search-box {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.categories {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #fff;
}

.category-group {
    margin-bottom: 20px;
}

.category-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #555;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.item-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.item-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.item-checkbox:hover {
    background: #f0f8ff;
}

.preview-area {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

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

.btn-copy {
    background: #4caf50;
    color: white;
}

.btn-download {
    background: #2196f3;
    color: white;
}

textarea {
    flex: 1;
    width: 100%;
    resize: none;
    padding: 15px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #282c34;
    color: #abb2bf;
    min-height: 400px;
}